From ab014eb3ae304092718018b8ae6122636b4c0b10 Mon Sep 17 00:00:00 2001 From: Tamar Christina Date: Thu, 19 Jan 2017 18:30:44 +0000 Subject: [PATCH] aarch64.c (aarch64_simd_gen_const_vector_dup): Change int to HOST_WIDE_INT. gcc/ 2017-01-19 Tamar Christina * config/aarch64/aarch64.c (aarch64_simd_gen_const_vector_dup): Change int to HOST_WIDE_INT. * config/aarch64/aarch64-protos.h (aarch64_simd_gen_const_vector_dup): Likewise. * config/aarch64/aarch64-simd.md: Add copysign3. gcc/testsuite/ 2017-01-19 Tamar Christina * gcc/testsuite/lib/target-supports.exp (check_effective_target_vect_call_copysignf): Enable for AArch64. From-SVN: r244649 --- gcc/ChangeLog | 8 ++++++++ gcc/config/aarch64/aarch64-protos.h | 2 +- gcc/config/aarch64/aarch64-simd.md | 18 ++++++++++++++++++ gcc/config/aarch64/aarch64.c | 6 ++++-- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/lib/target-supports.exp | 3 ++- 6 files changed, 38 insertions(+), 4 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a51167089e6..6bfb0c65b6f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2017-01-19 Tamar Christina + + * config/aarch64/aarch64.c (aarch64_simd_gen_const_vector_dup): + Change int to HOST_WIDE_INT. + * config/aarch64/aarch64-protos.h + (aarch64_simd_gen_const_vector_dup): Likewise. + * config/aarch64/aarch64-simd.md: Add copysign3. + 2017-01-19 David Malcolm * langhooks-def.h (lhd_type_for_size): New decl. diff --git a/gcc/config/aarch64/aarch64-protos.h b/gcc/config/aarch64/aarch64-protos.h index 8c4380b5953..7a9a21ea51c 100644 --- a/gcc/config/aarch64/aarch64-protos.h +++ b/gcc/config/aarch64/aarch64-protos.h @@ -362,7 +362,7 @@ rtx aarch64_eh_return_handler_rtx (void); rtx aarch64_mask_from_zextract_ops (rtx, rtx); const char *aarch64_output_move_struct (rtx *operands); rtx aarch64_return_addr (int, rtx); -rtx aarch64_simd_gen_const_vector_dup (machine_mode, int); +rtx aarch64_simd_gen_const_vector_dup (machine_mode, HOST_WIDE_INT); bool aarch64_simd_mem_operand_p (rtx); rtx aarch64_simd_vect_par_cnst_half (machine_mode, bool); rtx aarch64_tls_get_addr (void); diff --git a/gcc/config/aarch64/aarch64-simd.md b/gcc/config/aarch64/aarch64-simd.md index a12e2268ef9..b61f79a0946 100644 --- a/gcc/config/aarch64/aarch64-simd.md +++ b/gcc/config/aarch64/aarch64-simd.md @@ -338,6 +338,24 @@ } ) +(define_expand "copysign3" + [(match_operand:VHSDF 0 "register_operand") + (match_operand:VHSDF 1 "register_operand") + (match_operand:VHSDF 2 "register_operand")] + "TARGET_FLOAT && TARGET_SIMD" +{ + rtx v_bitmask = gen_reg_rtx (mode); + int bits = GET_MODE_UNIT_BITSIZE (mode) - 1; + + emit_move_insn (v_bitmask, + aarch64_simd_gen_const_vector_dup (mode, + HOST_WIDE_INT_M1U << bits)); + emit_insn (gen_aarch64_simd_bsl (operands[0], v_bitmask, + operands[2], operands[1])); + DONE; +} +) + (define_insn "*aarch64_mul3_elt" [(set (match_operand:VMUL 0 "register_operand" "=w") (mult:VMUL diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 39a58804ab6..4432cae6b8d 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -11237,14 +11237,16 @@ aarch64_mov_operand_p (rtx x, machine_mode mode) /* Return a const_int vector of VAL. */ rtx -aarch64_simd_gen_const_vector_dup (machine_mode mode, int val) +aarch64_simd_gen_const_vector_dup (machine_mode mode, HOST_WIDE_INT val) { int nunits = GET_MODE_NUNITS (mode); rtvec v = rtvec_alloc (nunits); int i; + rtx cache = GEN_INT (val); + for (i=0; i < nunits; i++) - RTVEC_ELT (v, i) = GEN_INT (val); + RTVEC_ELT (v, i) = cache; return gen_rtx_CONST_VECTOR (mode, v); } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 662fbc548dc..1a3a521187e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-01-19 Tamar Christina + + * gcc/testsuite/lib/target-supports.exp + (check_effective_target_vect_call_copysignf): Enable for AArch64. + 2017-01-19 Rainer Orth PR testsuite/79051 diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index b88d13c13f2..12dbf475e31 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -6158,7 +6158,8 @@ proc check_effective_target_vect_call_copysignf { } { } else { set et_vect_call_copysignf_saved($et_index) 0 if { [istarget i?86-*-*] || [istarget x86_64-*-*] - || [istarget powerpc*-*-*] } { + || [istarget powerpc*-*-*] + || [istarget aarch64*-*-*] } { set et_vect_call_copysignf_saved($et_index) 1 } } -- 2.30.2