diff options
author | Pan Li <pan2.li@intel.com> | 2023-09-22 09:09:34 +0800 |
---|---|---|
committer | Pan Li <pan2.li@intel.com> | 2023-09-22 09:26:29 +0800 |
commit | dba79ce1681828d05f6ed73ad56d8c3f3d53411a (patch) | |
tree | bccad506e14c6f789193839d73e7c8f09cc0bcc4 | |
parent | 8bf5636e4fca947527a302813fdf08e1bbc82fa3 (diff) | |
download | gcc-dba79ce1681828d05f6ed73ad56d8c3f3d53411a.zip gcc-dba79ce1681828d05f6ed73ad56d8c3f3d53411a.tar.gz gcc-dba79ce1681828d05f6ed73ad56d8c3f3d53411a.tar.bz2 |
RISC-V: Leverage __builtin_xx instead of math.h for test
The math.h may have problems in some environment, take __builtin__xx
instead for testing.
gcc/testsuite/ChangeLog:
* gcc.target/riscv/rvv/autovec/vls/floating-point-max-5.c:
Remove reference to math.h.
* gcc.target/riscv/rvv/autovec/vls/floating-point-min-5.c: Ditto.
* gcc.target/riscv/rvv/autovec/vls/floating-point-sgnjx-2.c: Ditto.
Signed-off-by: Pan Li <pan2.li@intel.com>
3 files changed, 63 insertions, 66 deletions
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vls/floating-point-max-5.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vls/floating-point-max-5.c index 775ddb1..dd16368 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vls/floating-point-max-5.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vls/floating-point-max-5.c @@ -2,30 +2,29 @@ /* { dg-options "-march=rv64gcv_zvfh_zvl4096b -mabi=lp64d -O3 -fno-schedule-insns -fno-schedule-insns2 --param=riscv-autovec-lmul=m8 -ffast-math" } */ #include "def.h" -#include "math.h" -DEF_CALL_VV (max, 1, float, fmaxf) -DEF_CALL_VV (max, 2, float, fmaxf) -DEF_CALL_VV (max, 4, float, fmaxf) -DEF_CALL_VV (max, 8, float, fmaxf) -DEF_CALL_VV (max, 16, float, fmaxf) -DEF_CALL_VV (max, 32, float, fmaxf) -DEF_CALL_VV (max, 64, float, fmaxf) -DEF_CALL_VV (max, 128, float, fmaxf) -DEF_CALL_VV (max, 256, float, fmaxf) -DEF_CALL_VV (max, 512, float, fmaxf) -DEF_CALL_VV (max, 1024, float, fmaxf) +DEF_CALL_VV (max, 1, float, __builtin_fmaxf) +DEF_CALL_VV (max, 2, float, __builtin_fmaxf) +DEF_CALL_VV (max, 4, float, __builtin_fmaxf) +DEF_CALL_VV (max, 8, float, __builtin_fmaxf) +DEF_CALL_VV (max, 16, float, __builtin_fmaxf) +DEF_CALL_VV (max, 32, float, __builtin_fmaxf) +DEF_CALL_VV (max, 64, float, __builtin_fmaxf) +DEF_CALL_VV (max, 128, float, __builtin_fmaxf) +DEF_CALL_VV (max, 256, float, __builtin_fmaxf) +DEF_CALL_VV (max, 512, float, __builtin_fmaxf) +DEF_CALL_VV (max, 1024, float, __builtin_fmaxf) -DEF_CALL_VV (max, 1, double, fmax) -DEF_CALL_VV (max, 2, double, fmax) -DEF_CALL_VV (max, 4, double, fmax) -DEF_CALL_VV (max, 8, double, fmax) -DEF_CALL_VV (max, 16, double, fmax) -DEF_CALL_VV (max, 32, double, fmax) -DEF_CALL_VV (max, 64, double, fmax) -DEF_CALL_VV (max, 128, double, fmax) -DEF_CALL_VV (max, 256, double, fmax) -DEF_CALL_VV (max, 512, double, fmax) +DEF_CALL_VV (max, 1, double, __builtin_fmax) +DEF_CALL_VV (max, 2, double, __builtin_fmax) +DEF_CALL_VV (max, 4, double, __builtin_fmax) +DEF_CALL_VV (max, 8, double, __builtin_fmax) +DEF_CALL_VV (max, 16, double, __builtin_fmax) +DEF_CALL_VV (max, 32, double, __builtin_fmax) +DEF_CALL_VV (max, 64, double, __builtin_fmax) +DEF_CALL_VV (max, 128, double, __builtin_fmax) +DEF_CALL_VV (max, 256, double, __builtin_fmax) +DEF_CALL_VV (max, 512, double, __builtin_fmax) /* { dg-final { scan-assembler-times {vfmax\.vv\s+v[0-9]+,\s*v[0-9]+,\s*v[0-9]+} 19 } } */ /* { dg-final { scan-assembler-not {csrr} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vls/floating-point-min-5.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vls/floating-point-min-5.c index 1e9ff7d..0e3cbf2 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vls/floating-point-min-5.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vls/floating-point-min-5.c @@ -2,30 +2,29 @@ /* { dg-options "-march=rv64gcv_zvfh_zvl4096b -mabi=lp64d -O3 -fno-schedule-insns -fno-schedule-insns2 --param=riscv-autovec-lmul=m8 -ffast-math" } */ #include "def.h" -#include "math.h" -DEF_CALL_VV (min, 1, float, fminf) -DEF_CALL_VV (min, 2, float, fminf) -DEF_CALL_VV (min, 4, float, fminf) -DEF_CALL_VV (min, 8, float, fminf) -DEF_CALL_VV (min, 16, float, fminf) -DEF_CALL_VV (min, 32, float, fminf) -DEF_CALL_VV (min, 64, float, fminf) -DEF_CALL_VV (min, 128, float, fminf) -DEF_CALL_VV (min, 256, float, fminf) -DEF_CALL_VV (min, 512, float, fminf) -DEF_CALL_VV (min, 1024, float, fminf) +DEF_CALL_VV (min, 1, float, __builtin_fminf) +DEF_CALL_VV (min, 2, float, __builtin_fminf) +DEF_CALL_VV (min, 4, float, __builtin_fminf) +DEF_CALL_VV (min, 8, float, __builtin_fminf) +DEF_CALL_VV (min, 16, float, __builtin_fminf) +DEF_CALL_VV (min, 32, float, __builtin_fminf) +DEF_CALL_VV (min, 64, float, __builtin_fminf) +DEF_CALL_VV (min, 128, float, __builtin_fminf) +DEF_CALL_VV (min, 256, float, __builtin_fminf) +DEF_CALL_VV (min, 512, float, __builtin_fminf) +DEF_CALL_VV (min, 1024, float, __builtin_fminf) -DEF_CALL_VV (min, 1, double, fmin) -DEF_CALL_VV (min, 2, double, fmin) -DEF_CALL_VV (min, 4, double, fmin) -DEF_CALL_VV (min, 8, double, fmin) -DEF_CALL_VV (min, 16, double, fmin) -DEF_CALL_VV (min, 32, double, fmin) -DEF_CALL_VV (min, 64, double, fmin) -DEF_CALL_VV (min, 128, double, fmin) -DEF_CALL_VV (min, 256, double, fmin) -DEF_CALL_VV (min, 512, double, fmin) +DEF_CALL_VV (min, 1, double, __builtin_fmin) +DEF_CALL_VV (min, 2, double, __builtin_fmin) +DEF_CALL_VV (min, 4, double, __builtin_fmin) +DEF_CALL_VV (min, 8, double, __builtin_fmin) +DEF_CALL_VV (min, 16, double, __builtin_fmin) +DEF_CALL_VV (min, 32, double, __builtin_fmin) +DEF_CALL_VV (min, 64, double, __builtin_fmin) +DEF_CALL_VV (min, 128, double, __builtin_fmin) +DEF_CALL_VV (min, 256, double, __builtin_fmin) +DEF_CALL_VV (min, 512, double, __builtin_fmin) /* { dg-final { scan-assembler-times {vfmin\.vv\s+v[0-9]+,\s*v[0-9]+,\s*v[0-9]+} 19 } } */ /* { dg-final { scan-assembler-not {csrr} } } */ diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vls/floating-point-sgnjx-2.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vls/floating-point-sgnjx-2.c index 7e017de..ec9001f 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/vls/floating-point-sgnjx-2.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/vls/floating-point-sgnjx-2.c @@ -2,30 +2,29 @@ /* { dg-options "-march=rv64gcv_zvfh_zvl4096b -mabi=lp64d -O3 -fno-schedule-insns -fno-schedule-insns2 --param=riscv-autovec-lmul=m8 -ffast-math" } */ #include "def.h" -#include <math.h> -DEF_SGNJX_VV (sgnj, 1, float, copysignf) -DEF_SGNJX_VV (sgnj, 2, float, copysignf) -DEF_SGNJX_VV (sgnj, 4, float, copysignf) -DEF_SGNJX_VV (sgnj, 8, float, copysignf) -DEF_SGNJX_VV (sgnj, 16, float, copysignf) -DEF_SGNJX_VV (sgnj, 32, float, copysignf) -DEF_SGNJX_VV (sgnj, 64, float, copysignf) -DEF_SGNJX_VV (sgnj, 128, float, copysignf) -DEF_SGNJX_VV (sgnj, 256, float, copysignf) -DEF_SGNJX_VV (sgnj, 512, float, copysignf) -DEF_SGNJX_VV (sgnj, 1024, float, copysignf) +DEF_SGNJX_VV (sgnj, 1, float, __builtin_copysignf) +DEF_SGNJX_VV (sgnj, 2, float, __builtin_copysignf) +DEF_SGNJX_VV (sgnj, 4, float, __builtin_copysignf) +DEF_SGNJX_VV (sgnj, 8, float, __builtin_copysignf) +DEF_SGNJX_VV (sgnj, 16, float, __builtin_copysignf) +DEF_SGNJX_VV (sgnj, 32, float, __builtin_copysignf) +DEF_SGNJX_VV (sgnj, 64, float, __builtin_copysignf) +DEF_SGNJX_VV (sgnj, 128, float, __builtin_copysignf) +DEF_SGNJX_VV (sgnj, 256, float, __builtin_copysignf) +DEF_SGNJX_VV (sgnj, 512, float, __builtin_copysignf) +DEF_SGNJX_VV (sgnj, 1024, float, __builtin_copysignf) -DEF_SGNJX_VV (sgnj, 1, double, copysign) -DEF_SGNJX_VV (sgnj, 2, double, copysign) -DEF_SGNJX_VV (sgnj, 4, double, copysign) -DEF_SGNJX_VV (sgnj, 8, double, copysign) -DEF_SGNJX_VV (sgnj, 16, double, copysign) -DEF_SGNJX_VV (sgnj, 32, double, copysign) -DEF_SGNJX_VV (sgnj, 64, double, copysign) -DEF_SGNJX_VV (sgnj, 128, double, copysign) -DEF_SGNJX_VV (sgnj, 256, double, copysign) -DEF_SGNJX_VV (sgnj, 512, double, copysign) +DEF_SGNJX_VV (sgnj, 1, double, __builtin_copysign) +DEF_SGNJX_VV (sgnj, 2, double, __builtin_copysign) +DEF_SGNJX_VV (sgnj, 4, double, __builtin_copysign) +DEF_SGNJX_VV (sgnj, 8, double, __builtin_copysign) +DEF_SGNJX_VV (sgnj, 16, double, __builtin_copysign) +DEF_SGNJX_VV (sgnj, 32, double, __builtin_copysign) +DEF_SGNJX_VV (sgnj, 64, double, __builtin_copysign) +DEF_SGNJX_VV (sgnj, 128, double, __builtin_copysign) +DEF_SGNJX_VV (sgnj, 256, double, __builtin_copysign) +DEF_SGNJX_VV (sgnj, 512, double, __builtin_copysign) /* { dg-final { scan-assembler-times {vfsgnjx\.vv\s+v[0-9]+,\s*v[0-9]+,\s*v[0-9]+} 19 } } */ /* { dg-final { scan-assembler-not {csrr} } } */ |