diff options
author | Vidya Praveen <vidyapraveen@arm.com> | 2013-05-03 11:17:57 +0100 |
---|---|---|
committer | Marcus Shawcroft <mshawcroft@gcc.gnu.org> | 2013-05-03 10:17:57 +0000 |
commit | 1d0c8e5cc36c164c065a1b8655d1b51085a5b6ad (patch) | |
tree | de7528c2051e58482a8635004245705e04eb5072 | |
parent | eacb22bf7330f5d8164e0742d4b0dda956865d44 (diff) | |
download | gcc-1d0c8e5cc36c164c065a1b8655d1b51085a5b6ad.zip gcc-1d0c8e5cc36c164c065a1b8655d1b51085a5b6ad.tar.gz gcc-1d0c8e5cc36c164c065a1b8655d1b51085a5b6ad.tar.bz2 |
[AArch64] Support scalar FABD
gcc/ChangeLog
2013-05-02 Vidya Praveen <vidyapraveen@arm.com>
* config/aarch64/aarch64-simd.md (*fabd_scalar<mode>3): Support
scalar form of FABD instruction.
gcc/testsuite/ChangeLog
2013-05-02 Vidya Praveen <vidyapraveen@arm.com>
* gcc.target/aarch64/fabd.c: New file.
From-SVN: r198574
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/config/aarch64/aarch64-simd.md | 11 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/aarch64/fabd.c | 38 |
4 files changed, 58 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b94a74b..4c70ab4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2013-05-03 Vidya Praveen <vidyapraveen@arm.com> + + * config/aarch64/aarch64-simd.md (*fabd_scalar<mode>3): Support + scalar form of FABD instruction. + 2013-05-02 Vladimir Makarov <vmakarov@redhat.com> * lra-constraints.c (process_alt_operands): Add checking alt diff --git a/gcc/config/aarch64/aarch64-simd.md b/gcc/config/aarch64/aarch64-simd.md index 13384aa..548600d 100644 --- a/gcc/config/aarch64/aarch64-simd.md +++ b/gcc/config/aarch64/aarch64-simd.md @@ -556,6 +556,17 @@ (set_attr "simd_mode" "<MODE>")] ) +(define_insn "*fabd_scalar<mode>3" + [(set (match_operand:GPF 0 "register_operand" "=w") + (abs:GPF (minus:GPF + (match_operand:GPF 1 "register_operand" "w") + (match_operand:GPF 2 "register_operand" "w"))))] + "TARGET_SIMD" + "fabd\t%<s>0, %<s>1, %<s>2" + [(set_attr "simd_type" "simd_fabd") + (set_attr "mode" "<MODE>")] +) + (define_insn "and<mode>3" [(set (match_operand:VDQ 0 "register_operand" "=w") (and:VDQ (match_operand:VDQ 1 "register_operand" "w") diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b716353..937d634 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2013-05-03 Vidya Praveen <vidyapraveen@arm.com> + + * gcc.target/aarch64/fabd.c: New file. + 2013-05-03 Paolo Carlini <paolo.carlini@oracle.com> PR c++/54318 diff --git a/gcc/testsuite/gcc.target/aarch64/fabd.c b/gcc/testsuite/gcc.target/aarch64/fabd.c new file mode 100644 index 0000000..7206d5e --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/fabd.c @@ -0,0 +1,38 @@ +/* { dg-do run } */ +/* { dg-options "-O1 -fno-inline --save-temps" } */ + +extern double fabs (double); +extern float fabsf (float); +extern void abort (); +extern void exit (int); + +void +fabd_d (double x, double y, double d) +{ + if ((fabs (x - y) - d) > 0.00001) + abort (); +} + +/* { dg-final { scan-assembler "fabd\td\[0-9\]+" } } */ + +void +fabd_f (float x, float y, float d) +{ + if ((fabsf (x - y) - d) > 0.00001) + abort (); +} + +/* { dg-final { scan-assembler "fabd\ts\[0-9\]+" } } */ + +int +main () +{ + fabd_d (10.0, 5.0, 5.0); + fabd_d (5.0, 10.0, 5.0); + fabd_f (10.0, 5.0, 5.0); + fabd_f (5.0, 10.0, 5.0); + + return 0; +} + +/* { dg-final { cleanup-saved-temps } } */ |