[AARCH64] Fix support for vectorization over sqrt (), sqrtf ().

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
This commit is contained in:
James Greenhalgh 2013-01-08 14:49:01 +00:00 committed by James Greenhalgh
parent 4267a4a6ce
commit 4dcd1054bf
5 changed files with 28 additions and 4 deletions

View 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

View 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 \

View 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

View 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)

View 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