aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/arm/arm.c
diff options
context:
space:
mode:
authorJiong Wang <jiong.wang@arm.com>2014-09-09 12:29:36 +0000
committerJiong Wang <jiwang@gcc.gnu.org>2014-09-09 12:29:36 +0000
commit97f518b3fe714bb026f8070aa475e86ddbcca509 (patch)
treec16fc32b4d8965bc51c8fe032b60680a1cf133ac /gcc/config/arm/arm.c
parent1942d1a9e17406469aef7d38e927dd7a14f5b376 (diff)
downloadgcc-97f518b3fe714bb026f8070aa475e86ddbcca509.zip
gcc-97f518b3fe714bb026f8070aa475e86ddbcca509.tar.gz
gcc-97f518b3fe714bb026f8070aa475e86ddbcca509.tar.bz2
[ARM] Enable auto-vectorization for copysignf
gcc/ * config/arm/arm.c (NEON_COPYSIGNF): New enum. (arm_init_neon_builtins): Support NEON_COPYSIGNF. (arm_builtin_vectorized_function): Likewise. * config/arm/arm_neon_builtins.def: New macro for copysignf. * config/arm/neon.md (neon_copysignf<mode>): New pattern for vector copysignf. gcc/testsuite/ * gcc.target/arm/vect-copysignf.c: New testcase. From-SVN: r215067
Diffstat (limited to 'gcc/config/arm/arm.c')
-rw-r--r--gcc/config/arm/arm.c39
1 files changed, 32 insertions, 7 deletions
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index d75ca42..f0e622d 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -23289,6 +23289,7 @@ typedef enum {
NEON_SETLANE,
NEON_CREATE,
NEON_RINT,
+ NEON_COPYSIGNF,
NEON_DUP,
NEON_DUPLANE,
NEON_COMBINE,
@@ -24283,6 +24284,22 @@ arm_init_neon_builtins (void)
ftype = build_function_type_list (eltype, eltype, NULL);
break;
}
+ case NEON_COPYSIGNF:
+ {
+ tree eltype = NULL_TREE;
+ switch (insn_data[d->code].operand[1].mode)
+ {
+ case V2SFmode:
+ eltype = V2SF_type_node;
+ break;
+ case V4SFmode:
+ eltype = V4SF_type_node;
+ break;
+ default: gcc_unreachable ();
+ }
+ ftype = build_function_type_list (eltype, eltype, NULL);
+ break;
+ }
default:
gcc_unreachable ();
}
@@ -25486,6 +25503,7 @@ arm_expand_neon_builtin (int fcode, tree exp, rtx target)
return arm_expand_neon_args (target, icode, 1, type_mode, exp, fcode,
NEON_ARG_COPY_TO_REG, NEON_ARG_STOP);
+ case NEON_COPYSIGNF:
case NEON_COMBINE:
case NEON_VTBL:
return arm_expand_neon_args (target, icode, 1, type_mode, exp, fcode,
@@ -30063,27 +30081,34 @@ arm_builtin_vectorized_function (tree fndecl, tree type_out, tree type_in)
: ARM_FIND_VCVT_VARIANT (vcvtm);
#undef ARM_CHECK_BUILTIN_MODE
#define ARM_CHECK_BUILTIN_MODE(C, N) \
- (out_mode == N##Imode && out_n == C \
- && in_mode == N##Imode && in_n == C)
+ (out_mode == N##mode && out_n == C \
+ && in_mode == N##mode && in_n == C)
case BUILT_IN_BSWAP16:
- if (ARM_CHECK_BUILTIN_MODE (4, H))
+ if (ARM_CHECK_BUILTIN_MODE (4, HI))
return arm_builtin_decl (ARM_BUILTIN_NEON_bswapv4hi, false);
- else if (ARM_CHECK_BUILTIN_MODE (8, H))
+ else if (ARM_CHECK_BUILTIN_MODE (8, HI))
return arm_builtin_decl (ARM_BUILTIN_NEON_bswapv8hi, false);
else
return NULL_TREE;
case BUILT_IN_BSWAP32:
- if (ARM_CHECK_BUILTIN_MODE (2, S))
+ if (ARM_CHECK_BUILTIN_MODE (2, SI))
return arm_builtin_decl (ARM_BUILTIN_NEON_bswapv2si, false);
- else if (ARM_CHECK_BUILTIN_MODE (4, S))
+ else if (ARM_CHECK_BUILTIN_MODE (4, SI))
return arm_builtin_decl (ARM_BUILTIN_NEON_bswapv4si, false);
else
return NULL_TREE;
case BUILT_IN_BSWAP64:
- if (ARM_CHECK_BUILTIN_MODE (2, D))
+ if (ARM_CHECK_BUILTIN_MODE (2, DI))
return arm_builtin_decl (ARM_BUILTIN_NEON_bswapv2di, false);
else
return NULL_TREE;
+ case BUILT_IN_COPYSIGNF:
+ if (ARM_CHECK_BUILTIN_MODE (2, SF))
+ return arm_builtin_decl (ARM_BUILTIN_NEON_copysignfv2sf, false);
+ else if (ARM_CHECK_BUILTIN_MODE (4, SF))
+ return arm_builtin_decl (ARM_BUILTIN_NEON_copysignfv4sf, false);
+ else
+ return NULL_TREE;
default:
return NULL_TREE;