aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKelvin Nilsen <kelvin@gcc.gnu.org>2017-05-10 13:52:01 +0000
committerKelvin Nilsen <kelvin@gcc.gnu.org>2017-05-10 13:52:01 +0000
commita2e37a213912c95b8514fe0fed4ffd1b835e64bf (patch)
treea74950fafa7fc0a7fc280692aa87d31aa9a04173
parent14f20ec179dc6e0a92b233746d474f65eaaab26d (diff)
segher feedback to change one condition testibm/bz139777
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/ibm/bz139777@247838 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/config/rs6000/rs6000-c.c54
-rw-r--r--gcc/config/rs6000/rs6000.h2
-rw-r--r--gcc/doc/extend.texi4
3 files changed, 30 insertions, 30 deletions
diff --git a/gcc/config/rs6000/rs6000-c.c b/gcc/config/rs6000/rs6000-c.c
index 6f3a41d791c..3ab9fb72380 100644
--- a/gcc/config/rs6000/rs6000-c.c
+++ b/gcc/config/rs6000/rs6000-c.c
@@ -6433,35 +6433,35 @@ altivec_resolve_overloaded_builtin (location_t loc, tree fndecl,
return error_mark_node;
}
- /* If any supplied arguments are wider than 32 bits, resolve to
- 64-bit variant of built-in function. */
- if ((arg1_mode == TImode) || (arg1_mode == DImode) ||
- (arg2_mode == TImode) || (arg2_mode == DImode))
- {
- /* Assure all argument and result types are compatible with
- the built-in function represented by P6_BUILTIN_CMPB. */
- overloaded_code = P6_BUILTIN_CMPB;
- }
- else
- {
- /* Assure all argument and result types are compatible with
- the built-in function represented by P6_BUILTIN_CMPB_32. */
- overloaded_code = P6_BUILTIN_CMPB_32;
- }
+ /* If any supplied arguments are wider than 32 bits, resolve to
+ 64-bit variant of built-in function. */
+ if ((GET_MODE_PRECISION (arg1_mode) > 32)
+ || (GET_MODE_PRECISION (arg2_mode) > 32))
+ {
+ /* Assure all argument and result types are compatible with
+ the built-in function represented by P6_BUILTIN_CMPB. */
+ overloaded_code = P6_BUILTIN_CMPB;
+ }
+ else
+ {
+ /* Assure all argument and result types are compatible with
+ the built-in function represented by P6_BUILTIN_CMPB_32. */
+ overloaded_code = P6_BUILTIN_CMPB_32;
+ }
- while (desc->code && desc->code == fcode &&
- desc->overloaded_code != overloaded_code)
- desc++;
+ while (desc->code && desc->code == fcode &&
+ desc->overloaded_code != overloaded_code)
+ desc++;
- if (desc->code && (desc->code == fcode)
- && rs6000_builtin_type_compatible (types[0], desc->op1)
- && rs6000_builtin_type_compatible (types[1], desc->op2))
- {
- if (rs6000_builtin_decls[desc->overloaded_code] != NULL_TREE)
- return altivec_build_resolved_builtin (args, n, desc);
- else
- unsupported_builtin = true;
- }
+ if (desc->code && (desc->code == fcode)
+ && rs6000_builtin_type_compatible (types[0], desc->op1)
+ && rs6000_builtin_type_compatible (types[1], desc->op2))
+ {
+ if (rs6000_builtin_decls[desc->overloaded_code] != NULL_TREE)
+ return altivec_build_resolved_builtin (args, n, desc);
+ else
+ unsupported_builtin = true;
+ }
}
else
{
diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h
index 54d2ea99d4f..c4e98dd2f13 100644
--- a/gcc/config/rs6000/rs6000.h
+++ b/gcc/config/rs6000/rs6000.h
@@ -2717,7 +2717,7 @@ extern int frame_pointer_needed;
aren't in target_flags. */
#define RS6000_BTM_ALWAYS 0 /* Always enabled. */
#define RS6000_BTM_ALTIVEC MASK_ALTIVEC /* VMX/altivec vectors. */
-#define RS6000_BTM_CMPB MASK_CMPB /* ISA 2.05: cmopare bytes. */
+#define RS6000_BTM_CMPB MASK_CMPB /* ISA 2.05: compare bytes. */
#define RS6000_BTM_VSX MASK_VSX /* VSX (vector/scalar). */
#define RS6000_BTM_P8_VECTOR MASK_P8_VECTOR /* ISA 2.07 vector. */
#define RS6000_BTM_P9_VECTOR MASK_P9_VECTOR /* ISA 3.0 vector. */
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 17d11585d52..3b16d4eb143 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -15111,14 +15111,14 @@ of processors, starting with ISA 2.05 or later (@option{-mcpu=power6}
or @option{-mcmpb}):
@smallexample
unsigned long long __builtin_cmpb (unsigned long long int, unsigned long long int);
-unsigned int __builtin_cmpb (int, int);
+unsigned int __builtin_cmpb (unsigned int, unsigned int);
@end smallexample
The @code{__builtin_cmpb} function
performs a byte-wise compare on the contents of its two arguments,
returning the result of the byte-wise comparison as the returned
value. For each byte comparison, the corresponding byte of the return
-value holds 0xff if the input bytes are equal, and 0 if the input bytes
+value holds 0xff if the input bytes are equal and 0 if the input bytes
are not equal. If either of the arguments to this built-in function
is wider than 32 bits, the function call expands into the form that
expects @code{unsigned long long int} arguments