[AARCH64] Fix support for vectorization over sqrt (), sqrtf ().
authorJames Greenhalgh <james.greenhalgh@arm.com>
Tue, 8 Jan 2013 14:49:01 +0000 (14:49 +0000)
committerJames Greenhalgh <jgreenhalgh@gcc.gnu.org>
Tue, 8 Jan 2013 14:49:01 +0000 (14:49 +0000)
gcc/
* config/aarch64/aarch64-builtins.c
(aarch64_builtin_vectorized_function): Handle sqrt, sqrtf.

gcc/testsuite/
* gcc.target/aarch64/vsqrt.c (test_square_root_v2sf): Use
endian-safe float pool loading.
(test_square_root_v4sf): Likewise.
(test_square_root_v2df): Likewise.
* lib/target-supports.exp
(check_effective_target_vect_call_sqrtf): Add AArch64.

From-SVN: r195017

gcc/ChangeLog
gcc/config/aarch64/aarch64-builtins.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/aarch64/vsqrt.c
gcc/testsuite/lib/target-supports.exp

index a4c8481..478b4ed 100644 (file)
@@ -1,3 +1,8 @@
+2013-01-08  James Greenhalgh  <james.greenhalgh@arm.com>
+
+       * config/aarch64/aarch64-builtins.c
+       (aarch64_builtin_vectorized_function): Handle sqrt, sqrtf.
+
 2013-01-08  Martin Jambor  <mjambor@suse.cz>
 
        PR debug/55579
index a683afd..f54e9f4 100644 (file)
@@ -1271,6 +1271,9 @@ aarch64_builtin_vectorized_function (tree fndecl, tree type_out, tree type_in)
        case BUILT_IN_NEARBYINT:
        case BUILT_IN_NEARBYINTF:
          return AARCH64_FIND_FRINT_VARIANT (frinti);
+       case BUILT_IN_SQRT:
+       case BUILT_IN_SQRTF:
+         return AARCH64_FIND_FRINT_VARIANT (sqrt);
 #undef AARCH64_CHECK_BUILTIN_MODE
 #define AARCH64_CHECK_BUILTIN_MODE(C, N) \
   (out_mode == N##Imode && out_n == C \
index 5d6acaf..a2ef1e8 100644 (file)
@@ -1,3 +1,12 @@
+2013-01-08  James Greenhalgh  <james.greenhalgh@arm.com>
+
+       * gcc.target/aarch64/vsqrt.c (test_square_root_v2sf): Use
+       endian-safe float pool loading.
+       (test_square_root_v4sf): Likewise.
+       (test_square_root_v2df): Likewise.
+       * lib/target-supports.exp
+       (check_effective_target_vect_call_sqrtf): Add AArch64.
+
 2013-01-08  Martin Jambor  <mjambor@suse.cz>
 
        PR debug/55579
index b59535a..5b777b2 100644 (file)
@@ -11,9 +11,11 @@ extern void abort (void);
 void
 test_square_root_v2sf ()
 {
-  float32x2_t val = {4.0f, 9.0f};
+  const float32_t pool[] = {4.0f, 9.0f};
+  float32x2_t val;
   float32x2_t res;
 
+  val = vld1_f32 (pool);
   res = vsqrt_f32 (val);
 
   if (vget_lane_f32 (res, 0) != 2.0f)
@@ -25,9 +27,11 @@ test_square_root_v2sf ()
 void
 test_square_root_v4sf ()
 {
-  float32x4_t val = {4.0f, 9.0f, 16.0f, 25.0f};
+  const float32_t pool[] = {4.0f, 9.0f, 16.0f, 25.0f};
+  float32x4_t val;
   float32x4_t res;
 
+  val = vld1q_f32 (pool);
   res = vsqrtq_f32 (val);
 
   if (vgetq_lane_f32 (res, 0) != 2.0f)
@@ -43,9 +47,11 @@ test_square_root_v4sf ()
 void
 test_square_root_v2df ()
 {
-  float64x2_t val = {4.0, 9.0};
+  const float64_t pool[] = {4.0, 9.0};
+  float64x2_t val;
   float64x2_t res;
 
+  val = vld1q_f64 (pool);
   res = vsqrtq_f64 (val);
 
   if (vgetq_lane_f64 (res, 0) != 2.0)
index a3828cb..a6d766e 100644 (file)
@@ -3952,7 +3952,8 @@ proc check_effective_target_vect_call_sqrtf { } {
        verbose "check_effective_target_vect_call_sqrtf: using cached result" 2
     } else {
        set et_vect_call_sqrtf_saved 0
-       if { [istarget i?86-*-*]
+       if { [istarget aarch64*-*-*]
+            || [istarget i?86-*-*]
             || [istarget x86_64-*-*]
             || ([istarget powerpc*-*-*] && [check_vsx_hw_available]) } {
            set et_vect_call_sqrtf_saved 1