forked from gcc-mirror/gcc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AArch64] Implement TARGET_GIMPLE_FOLD_BUILTIN for aarch64 backend.
gcc/ * config/aarch64/aarch64-builtins.c (aarch64_gimple_fold_builtin): New. * config/aarch64/aarch64-protos.h (aarch64_gimple_fold_builtin): New. * config/aarch64/aarch64-simd-builtins.def (addv): New. * config/aarch64/aarch64-simd.md (addpv4sf): New. (addvv4sf): Update. * config/aarch64/aarch64.c (TARGET_GIMPLE_FOLD_BUILTIN): Define. gcc/testsuite/ * gcc.target/aarch64/vaddv-intrinsic.c: New. * gcc.target/aarch64/vaddv-intrinsic-compile.c: Likewise. * gcc.target/aarch64/vaddv-intrinsic.x: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@198304 138bc75d-0d04-0410-961f-82ee72b054a4
- Loading branch information
jgreenhalgh
committed
Apr 25, 2013
1 parent
c7262ba
commit 58aab7c
Showing
11 changed files
with
176 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
gcc/testsuite/gcc.target/aarch64/vaddv-intrinsic-compile.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
/* { dg-do compile } */ | ||
/* { dg-options "-O3" } */ | ||
|
||
#include "arm_neon.h" | ||
|
||
#include "vaddv-intrinsic.x" | ||
|
||
/* { dg-final { scan-assembler "faddp\\ts\[0-9\]+"} } */ | ||
/* { dg-final { scan-assembler-times "faddp\\tv\[0-9\]+\.4s" 2} } */ | ||
/* { dg-final { scan-assembler "faddp\\td\[0-9\]+"} } */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
|
||
/* { dg-do run } */ | ||
/* { dg-options "-O3" } */ | ||
|
||
#include "arm_neon.h" | ||
|
||
extern void abort (void); | ||
|
||
#include "vaddv-intrinsic.x" | ||
|
||
int | ||
main (void) | ||
{ | ||
const float32_t pool_v2sf[] = {4.0f, 9.0f}; | ||
const float32_t pool_v4sf[] = {4.0f, 9.0f, 16.0f, 25.0f}; | ||
const float64_t pool_v2df[] = {4.0, 9.0}; | ||
|
||
if (test_vaddv_v2sf (pool_v2sf) != 13.0f) | ||
abort (); | ||
|
||
if (test_vaddv_v4sf (pool_v4sf) != 54.0f) | ||
abort (); | ||
|
||
if (test_vaddv_v2df (pool_v2df) != 13.0) | ||
abort (); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
|
||
float32_t | ||
test_vaddv_v2sf (const float32_t *pool) | ||
{ | ||
float32x2_t val; | ||
|
||
val = vld1_f32 (pool); | ||
return vaddv_f32 (val); | ||
} | ||
|
||
float32_t | ||
test_vaddv_v4sf (const float32_t *pool) | ||
{ | ||
float32x4_t val; | ||
|
||
val = vld1q_f32 (pool); | ||
return vaddvq_f32 (val); | ||
} | ||
|
||
float64_t | ||
test_vaddv_v2df (const float64_t *pool) | ||
{ | ||
float64x2_t val; | ||
|
||
val = vld1q_f64 (pool); | ||
return vaddvq_f64 (val); | ||
} |