sparc.c (sparc_vis_init_builtins): Retrieve the return mode from the builtin itself.
* config/sparc/sparc.c (sparc_vis_init_builtins): Retrieve the return mode from the builtin itself. (sparc_fold_builtin): Fix cast of zero constant. From-SVN: r125768
This commit is contained in:
parent
b92d0c7126
commit
724d7c5534
|
@ -1,3 +1,9 @@
|
|||
2007-06-17 Eric Botcazou <ebotcazou@libertysurf.fr>
|
||||
|
||||
* config/sparc/sparc.c (sparc_vis_init_builtins): Retrieve the
|
||||
return mode from the builtin itself.
|
||||
(sparc_fold_builtin): Fix cast of zero constant.
|
||||
|
||||
2007-06-16 Uros Bizjak <ubizjak@gmail.com>
|
||||
|
||||
* targhooks.c (default_builtin_reciprocal): New default target hook.
|
||||
|
|
|
@ -8031,8 +8031,10 @@ sparc_vis_init_builtins (void)
|
|||
Expand builtin functions for sparc intrinsics. */
|
||||
|
||||
static rtx
|
||||
sparc_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED,
|
||||
enum machine_mode tmode, int ignore ATTRIBUTE_UNUSED)
|
||||
sparc_expand_builtin (tree exp, rtx target,
|
||||
rtx subtarget ATTRIBUTE_UNUSED,
|
||||
enum machine_mode tmode ATTRIBUTE_UNUSED,
|
||||
int ignore ATTRIBUTE_UNUSED)
|
||||
{
|
||||
tree arg;
|
||||
call_expr_arg_iterator iter;
|
||||
|
@ -8042,14 +8044,13 @@ sparc_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED,
|
|||
enum machine_mode mode[4];
|
||||
int arg_count = 0;
|
||||
|
||||
mode[arg_count] = tmode;
|
||||
|
||||
if (target == 0
|
||||
|| GET_MODE (target) != tmode
|
||||
|| ! (*insn_data[icode].operand[0].predicate) (target, tmode))
|
||||
op[arg_count] = gen_reg_rtx (tmode);
|
||||
mode[0] = insn_data[icode].operand[0].mode;
|
||||
if (!target
|
||||
|| GET_MODE (target) != mode[0]
|
||||
|| ! (*insn_data[icode].operand[0].predicate) (target, mode[0]))
|
||||
op[0] = gen_reg_rtx (mode[0]);
|
||||
else
|
||||
op[arg_count] = target;
|
||||
op[0] = target;
|
||||
|
||||
FOR_EACH_CALL_EXPR_ARG (arg, iter, exp)
|
||||
{
|
||||
|
@ -8162,11 +8163,11 @@ sparc_fold_builtin (tree fndecl, tree arglist, bool ignore)
|
|||
{
|
||||
tree arg0, arg1, arg2;
|
||||
tree rtype = TREE_TYPE (TREE_TYPE (fndecl));
|
||||
|
||||
|
||||
if (ignore && DECL_FUNCTION_CODE (fndecl) != CODE_FOR_alignaddrsi_vis
|
||||
if (ignore
|
||||
&& DECL_FUNCTION_CODE (fndecl) != CODE_FOR_alignaddrsi_vis
|
||||
&& DECL_FUNCTION_CODE (fndecl) != CODE_FOR_alignaddrdi_vis)
|
||||
return build_int_cst (rtype, 0);
|
||||
return fold_convert (rtype, integer_zero_node);
|
||||
|
||||
switch (DECL_FUNCTION_CODE (fndecl))
|
||||
{
|
||||
|
@ -8280,6 +8281,7 @@ sparc_fold_builtin (tree fndecl, tree arglist, bool ignore)
|
|||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,3 +1,15 @@
|
|||
2007-06-17 Eric Botcazou <ebotcazou@libertysurf.fr>
|
||||
|
||||
* gcc.target/sparc/align.c: Use 'unsigned char' as element type.
|
||||
* gcc.target/sparc/combined-2.c: Likewise.
|
||||
* gcc.target/sparc/fexpand.c : Likewise.
|
||||
* gcc.target/sparc/fnot.c: Likewise. Fix a couple of prototypes.
|
||||
* gcc.target/sparc/fpack16.c : Likewise.
|
||||
* gcc.target/sparc/fpmerge.c : Likewise.
|
||||
* gcc.target/sparc/fpmul.c : Likewise.
|
||||
* gcc.target/sparc/noresult.c : Likewise.
|
||||
* gcc.target/sparc/pdist.c: Likewise.
|
||||
|
||||
2007-06-16 Uros Bizjak <ubizjak@gmail.com>
|
||||
|
||||
PR middle-end/31723
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
/* { dg-do compile } */
|
||||
/* { dg-options "-mcpu=ultrasparc -mvis" } */
|
||||
|
||||
typedef long long int64_t;
|
||||
typedef int vec32 __attribute__((vector_size(8)));
|
||||
typedef short vec16 __attribute__((vector_size(8)));
|
||||
typedef char vec8 __attribute__((vector_size(8)));
|
||||
typedef unsigned char vec8 __attribute__((vector_size(8)));
|
||||
|
||||
vec16 foo1 (vec16 a, vec16 b) {
|
||||
return __builtin_vis_faligndatav4hi (a, b);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* { dg-do compile } */
|
||||
/* { dg-options "-O2 -mcpu=ultrasparc -mvis" } */
|
||||
typedef char pixel __attribute__((vector_size(4)));
|
||||
typedef char vec8 __attribute__((vector_size(8)));
|
||||
typedef unsigned char pixel __attribute__((vector_size(4)));
|
||||
typedef unsigned char vec8 __attribute__((vector_size(8)));
|
||||
typedef short vec16 __attribute__((vector_size(8)));
|
||||
|
||||
vec16 foo (pixel a, pixel b) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* { dg-do compile } */
|
||||
/* { dg-options "-mcpu=ultrasparc -mvis" } */
|
||||
typedef short vec16 __attribute__((vector_size(8)));
|
||||
typedef char vec8 __attribute__((vector_size(4)));
|
||||
typedef unsigned char vec8 __attribute__((vector_size(4)));
|
||||
|
||||
vec16 foo (vec8 a) {
|
||||
return __builtin_vis_fexpand (a);
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/* { dg-do compile } */
|
||||
/* { dg-options "-O -mcpu=ultrasparc -mvis" } */
|
||||
typedef char vec8 __attribute__((vector_size(8)));
|
||||
typedef unsigned char vec8 __attribute__((vector_size(8)));
|
||||
typedef short vec16 __attribute__((vector_size(8)));
|
||||
typedef int vec32 __attribute__((vector_size(8)));
|
||||
typedef int vec32 __attribute__((vector_size(8)));
|
||||
|
||||
extern vec8 foo1_8(void);
|
||||
extern void foo2_8(vec8);
|
||||
|
@ -21,7 +21,7 @@ vec8 fun8_2(vec8 a)
|
|||
#endif
|
||||
|
||||
extern vec16 foo1_16(void);
|
||||
extern void foo2_16(vec8);
|
||||
extern void foo2_16(vec16);
|
||||
|
||||
|
||||
vec16 fun16(void)
|
||||
|
@ -38,7 +38,7 @@ vec16 fun16_2(vec16 a)
|
|||
#endif
|
||||
|
||||
extern vec32 foo1_32(void);
|
||||
extern void foo2_32(vec8);
|
||||
extern void foo2_32(vec32);
|
||||
|
||||
vec32 fun32(void)
|
||||
{
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* { dg-do compile } */
|
||||
/* { dg-options "-mcpu=ultrasparc -mvis" } */
|
||||
typedef short vec16 __attribute__((vector_size(8)));
|
||||
typedef char vec8 __attribute__((vector_size(4)));
|
||||
typedef unsigned char vec8 __attribute__((vector_size(4)));
|
||||
|
||||
vec8 foo (vec16 a) {
|
||||
return __builtin_vis_fpack16 (a);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* { dg-do compile } */
|
||||
/* { dg-options "-mcpu=ultrasparc -mvis" } */
|
||||
typedef char pixel __attribute__((vector_size(8)));
|
||||
typedef char vec8 __attribute__((vector_size(4)));
|
||||
typedef unsigned char pixel __attribute__((vector_size(8)));
|
||||
typedef unsigned char vec8 __attribute__((vector_size(4)));
|
||||
|
||||
pixel foo (vec8 a, vec8 b) {
|
||||
return __builtin_vis_fpmerge (a, b);
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
/* { dg-options "-mcpu=ultrasparc -mvis" } */
|
||||
typedef int vec32 __attribute__((vector_size(8)));
|
||||
typedef short vec16 __attribute__((vector_size(8)));
|
||||
typedef char pixel __attribute__((vector_size(4)));
|
||||
typedef unsigned char pixel __attribute__((vector_size(4)));
|
||||
typedef short pixel16 __attribute__((vector_size(4)));
|
||||
typedef char vec8 __attribute__((vector_size(8)));
|
||||
typedef unsigned char vec8 __attribute__((vector_size(8)));
|
||||
|
||||
vec16 foo1 (pixel a, vec16 b) {
|
||||
return __builtin_vis_fmul8x16 (a, b);
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
/* { dg-do compile } */
|
||||
/* { dg-options "-mcpu=ultrasparc -mvis" } */
|
||||
typedef short vec16 __attribute__((vector_size(8)));
|
||||
typedef char vec8 __attribute__((vector_size(4)));
|
||||
|
||||
void foo (vec16 a) {
|
||||
__builtin_vis_fpack16 (a);
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
/* { dg-do compile } */
|
||||
/* { dg-options "-mcpu=ultrasparc -mvis" } */
|
||||
|
||||
typedef long long int64_t;
|
||||
typedef char vec8 __attribute__((vector_size(8)));
|
||||
typedef unsigned char vec8 __attribute__((vector_size(8)));
|
||||
|
||||
int64_t foo (vec8 a, vec8 b) {
|
||||
int64_t d = 0;
|
||||
|
|
Loading…
Reference in New Issue