public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Jeff Law <law@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/vendors/riscv/heads/gcc-13-with-riscv-opts)] RISC-V: Refine run test cases of math autovec Date: Mon, 16 Oct 2023 18:38:51 +0000 (GMT) [thread overview] Message-ID: <20231016183851.05B3C38582BD@sourceware.org> (raw) https://gcc.gnu.org/g:b5227dedac1d0529832c3d551e0c4f61a0c12cc3 commit b5227dedac1d0529832c3d551e0c4f61a0c12cc3 Author: Pan Li <pan2.li@intel.com> Date: Wed Oct 11 20:08:52 2023 +0800 RISC-V: Refine run test cases of math autovec For the run test cases of math autovec, we need a reference value to check if the return value is expected or not. The previous patch leverage hardcode for the reference value but we can leverage the scalar math function instead. For example ceil after autovec. ASSERT (CEIL (Vector {1.2,...}) == Vector {2.0, ...}); But we can leverage the scalar math function to avoid potential mistakes. ASSERT (CEIL (Vector {1.2,...}) == Vector {ceil (1.2), ...}); This patch remove some fflags check as it covered by check-body already. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/autovec/unop/math-ceil-run-1.c: Use scalar func as reference instead of hardcode. * gcc.target/riscv/rvv/autovec/unop/math-ceil-run-2.c: Ditto. * gcc.target/riscv/rvv/autovec/unop/math-floor-run-1.c: Ditto. * gcc.target/riscv/rvv/autovec/unop/math-floor-run-2.c: Ditto. * gcc.target/riscv/rvv/autovec/unop/math-nearbyint-run-1.c: Ditto. * gcc.target/riscv/rvv/autovec/unop/math-nearbyint-run-2.c: Ditto. * gcc.target/riscv/rvv/autovec/unop/math-rint-run-1.c: Ditto. * gcc.target/riscv/rvv/autovec/unop/math-rint-run-2.c: Ditto. * gcc.target/riscv/rvv/autovec/unop/math-round-run-1.c: Ditto. * gcc.target/riscv/rvv/autovec/unop/math-round-run-2.c: Ditto. * gcc.target/riscv/rvv/autovec/unop/math-trunc-run-1.c: Ditto. * gcc.target/riscv/rvv/autovec/unop/math-trunc-run-2.c: Ditto. Signed-off-by: Pan Li <pan2.li@intel.com> (cherry picked from commit 9a82cca91dee190d845ee1681440bc69a07c6d49) Diff: --- .../riscv/rvv/autovec/unop/math-ceil-run-1.c | 18 ++++++------ .../riscv/rvv/autovec/unop/math-ceil-run-2.c | 18 ++++++------ .../riscv/rvv/autovec/unop/math-floor-run-1.c | 18 ++++++------ .../riscv/rvv/autovec/unop/math-floor-run-2.c | 18 ++++++------ .../riscv/rvv/autovec/unop/math-nearbyint-run-1.c | 33 +++++++++++----------- .../riscv/rvv/autovec/unop/math-nearbyint-run-2.c | 33 +++++++++++----------- .../riscv/rvv/autovec/unop/math-rint-run-1.c | 33 +++++++++++----------- .../riscv/rvv/autovec/unop/math-rint-run-2.c | 33 +++++++++++----------- .../riscv/rvv/autovec/unop/math-round-run-1.c | 18 ++++++------ .../riscv/rvv/autovec/unop/math-round-run-2.c | 18 ++++++------ .../riscv/rvv/autovec/unop/math-trunc-run-1.c | 18 ++++++------ .../riscv/rvv/autovec/unop/math-trunc-run-2.c | 18 ++++++------ 12 files changed, 140 insertions(+), 136 deletions(-) diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-ceil-run-1.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-ceil-run-1.c index 88611e8268e9..419a3def4dfb 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-ceil-run-1.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-ceil-run-1.c @@ -12,15 +12,15 @@ float ref[ARRAY_SIZE]; TEST_UNARY_CALL (float, __builtin_ceilf) TEST_ASSERT (float) -TEST_INIT (float, 1.2, 2.0, 1) -TEST_INIT (float, -1.2, -1.0, 2) -TEST_INIT (float, 3.0, 3.0, 3) -TEST_INIT (float, 8388607.5, 8388608.0, 4) -TEST_INIT (float, 8388609.0, 8388609.0, 5) -TEST_INIT (float, 0.0, 0.0, 6) -TEST_INIT (float, -0.0, -0.0, 7) -TEST_INIT (float, -8388607.5, -8388607.0, 8) -TEST_INIT (float, -8388608.0, -8388608.0, 9) +TEST_INIT (float, 1.2, __builtin_ceilf (1.2), 1) +TEST_INIT (float, -1.2, __builtin_ceilf (-1.2), 2) +TEST_INIT (float, 3.0, __builtin_ceilf (3.0), 3) +TEST_INIT (float, 8388607.5, __builtin_ceilf (8388607.5), 4) +TEST_INIT (float, 8388609.0, __builtin_ceilf (8388609.0), 5) +TEST_INIT (float, 0.0, __builtin_ceilf (0.0), 6) +TEST_INIT (float, -0.0,__builtin_ceilf (-0.0), 7) +TEST_INIT (float, -8388607.5, __builtin_ceilf (-8388607.5), 8) +TEST_INIT (float, -8388608.0, __builtin_ceilf (-8388608.0), 9) int main () diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-ceil-run-2.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-ceil-run-2.c index bb4c86c3d122..2b29c8e4414d 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-ceil-run-2.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-ceil-run-2.c @@ -12,15 +12,15 @@ double ref[ARRAY_SIZE]; TEST_UNARY_CALL (double, __builtin_ceil) TEST_ASSERT (double) -TEST_INIT (double, 1.2, 2.0, 1) -TEST_INIT (double, -1.2, -1.0, 2) -TEST_INIT (double, 3.0, 3.0, 3) -TEST_INIT (double, 4503599627370495.5, 4503599627370496.0, 4) -TEST_INIT (double, 4503599627370497.0, 4503599627370497.0, 5) -TEST_INIT (double, 0.0, 0.0, 6) -TEST_INIT (double, -0.0, -0.0, 7) -TEST_INIT (double, -4503599627370495.5, -4503599627370495.0, 8) -TEST_INIT (double, -4503599627370496.0, -4503599627370496.0, 9) +TEST_INIT (double, 1.2, __builtin_ceil (1.2), 1) +TEST_INIT (double, -1.2, __builtin_ceil (-1.2), 2) +TEST_INIT (double, 3.0, __builtin_ceil (3.0), 3) +TEST_INIT (double, 4503599627370495.5, __builtin_ceil (4503599627370495.5), 4) +TEST_INIT (double, 4503599627370497.0, __builtin_ceil (4503599627370497.0), 5) +TEST_INIT (double, 0.0, __builtin_ceil (0.0), 6) +TEST_INIT (double, -0.0, __builtin_ceil (-0.0), 7) +TEST_INIT (double, -4503599627370495.5, __builtin_ceil (-4503599627370495.5), 8) +TEST_INIT (double, -4503599627370496.0, __builtin_ceil (-4503599627370496.0), 9) int main () diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-floor-run-1.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-floor-run-1.c index 4af60c9270ea..07b61cd28f68 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-floor-run-1.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-floor-run-1.c @@ -12,15 +12,15 @@ float ref[ARRAY_SIZE]; TEST_UNARY_CALL (float, __builtin_floorf) TEST_ASSERT (float) -TEST_INIT (float, 1.2, 1.0, 1) -TEST_INIT (float, -1.2, -2.0, 2) -TEST_INIT (float, 3.0, 3.0, 3) -TEST_INIT (float, 8388607.5, 8388607.0, 4) -TEST_INIT (float, 8388609.0, 8388609.0, 5) -TEST_INIT (float, 0.0, 0.0, 6) -TEST_INIT (float, -0.0, -0.0, 7) -TEST_INIT (float, -8388607.5, -8388608.0, 8) -TEST_INIT (float, -8388608.0, -8388608.0, 9) +TEST_INIT (float, 1.2, __builtin_floorf (1.2), 1) +TEST_INIT (float, -1.2, __builtin_floorf (-1.2), 2) +TEST_INIT (float, 3.0, __builtin_floorf (3.0), 3) +TEST_INIT (float, 8388607.5, __builtin_floorf (8388607.5), 4) +TEST_INIT (float, 8388609.0, __builtin_floorf (8388609.0), 5) +TEST_INIT (float, 0.0, __builtin_floorf (0.0), 6) +TEST_INIT (float, -0.0, __builtin_floorf (-0.0), 7) +TEST_INIT (float, -8388607.5, __builtin_floorf (-8388607.5), 8) +TEST_INIT (float, -8388608.0, __builtin_floorf (-8388608.0), 9) int main () diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-floor-run-2.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-floor-run-2.c index ad3735c2eeca..7201ac1cd7be 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-floor-run-2.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-floor-run-2.c @@ -12,15 +12,15 @@ double ref[ARRAY_SIZE]; TEST_UNARY_CALL (double, __builtin_floor) TEST_ASSERT (double) -TEST_INIT (double, 1.2, 1.0, 1) -TEST_INIT (double, -1.2, -2.0, 2) -TEST_INIT (double, 3.0, 3.0, 3) -TEST_INIT (double, 4503599627370495.5, 4503599627370495.0, 4) -TEST_INIT (double, 4503599627370497.0, 4503599627370497.0, 5) -TEST_INIT (double, 0.0, 0.0, 6) -TEST_INIT (double, -0.0, -0.0, 7) -TEST_INIT (double, -4503599627370495.5, -4503599627370496.0, 8) -TEST_INIT (double, -4503599627370496.0, -4503599627370496.0, 9) +TEST_INIT (double, 1.2, __builtin_floor (1.2), 1) +TEST_INIT (double, -1.2, __builtin_floor (-1.2), 2) +TEST_INIT (double, 3.0, __builtin_floor (3.0), 3) +TEST_INIT (double, 4503599627370495.5, __builtin_floor (4503599627370495.5), 4) +TEST_INIT (double, 4503599627370497.0, __builtin_floor (4503599627370497.0), 5) +TEST_INIT (double, 0.0, __builtin_floor (0.0), 6) +TEST_INIT (double, -0.0, __builtin_floor (-0.0), 7) +TEST_INIT (double, -4503599627370495.5, __builtin_floor (-4503599627370496.0), 8) +TEST_INIT (double, -4503599627370496.0, __builtin_floor (-4503599627370496.0), 9) int main () diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-nearbyint-run-1.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-nearbyint-run-1.c index 6786e54d0ece..b0209eecf90a 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-nearbyint-run-1.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-nearbyint-run-1.c @@ -9,24 +9,30 @@ float in[ARRAY_SIZE]; float out[ARRAY_SIZE]; float ref[ARRAY_SIZE]; +static float +get_ref_nearbyintf (float val) +{ + set_rm (FRM_RTZ); + + return __builtin_nearbyintf (val); +} + TEST_UNARY_CALL (float, __builtin_nearbyintf) TEST_ASSERT (float) -TEST_INIT (float, 1.2, 1.0, 1) -TEST_INIT (float, -1.2, -1.0, 2) -TEST_INIT (float, 3.0, 3.0, 3) -TEST_INIT (float, 8388607.5, 8388607.0, 4) -TEST_INIT (float, 8388609.0, 8388609.0, 5) -TEST_INIT (float, 0.0, 0.0, 6) -TEST_INIT (float, -0.0, -0.0, 7) -TEST_INIT (float, -8388607.5, -8388607.0, 8) -TEST_INIT (float, -8388608.0, -8388608.0, 9) +TEST_INIT (float, 1.2, get_ref_nearbyintf (1.2), 1) +TEST_INIT (float, -1.2, get_ref_nearbyintf (-1.2), 2) +TEST_INIT (float, 3.0, get_ref_nearbyintf (3.0), 3) +TEST_INIT (float, 8388607.5, get_ref_nearbyintf (8388607.5), 4) +TEST_INIT (float, 8388609.0, get_ref_nearbyintf (8388609.0), 5) +TEST_INIT (float, 0.0, get_ref_nearbyintf (0.0), 6) +TEST_INIT (float, -0.0, get_ref_nearbyintf (-0.0), 7) +TEST_INIT (float, -8388607.5, get_ref_nearbyintf (-8388607.5), 8) +TEST_INIT (float, -8388608.0, get_ref_nearbyintf (-8388608.0), 9) int main () { - unsigned fflags_before = get_fflags (); - set_rm (FRM_RTZ); RUN_TEST (float, 1, __builtin_nearbyintf, in, out, ref, ARRAY_SIZE); @@ -39,10 +45,5 @@ main () RUN_TEST (float, 8, __builtin_nearbyintf, in, out, ref, ARRAY_SIZE); RUN_TEST (float, 9, __builtin_nearbyintf, in, out, ref, ARRAY_SIZE); - unsigned fflags_after = get_fflags (); - - if (fflags_before != fflags_after) - __builtin_abort (); - return 0; } diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-nearbyint-run-2.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-nearbyint-run-2.c index 9d3a3a68ee8a..2329a515390e 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-nearbyint-run-2.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-nearbyint-run-2.c @@ -9,24 +9,30 @@ double in[ARRAY_SIZE]; double out[ARRAY_SIZE]; double ref[ARRAY_SIZE]; +static double +get_ref_nearbyint (double val) +{ + set_rm (FRM_RNE); + + return __builtin_nearbyint (val); +} + TEST_UNARY_CALL (double, __builtin_nearbyint) TEST_ASSERT (double) -TEST_INIT (double, 1.2, 1.0, 1) -TEST_INIT (double, -1.8, -2.0, 2) -TEST_INIT (double, 3.0, 3.0, 3) -TEST_INIT (double, 4503599627370495.5, 4503599627370496.0, 4) -TEST_INIT (double, 4503599627370497.0, 4503599627370497.0, 5) -TEST_INIT (double, 0.0, 0.0, 6) -TEST_INIT (double, -0.0, -0.0, 7) -TEST_INIT (double, -4503599627370495.5, -4503599627370496.0, 8) -TEST_INIT (double, -4503599627370496.0, -4503599627370496.0, 9) +TEST_INIT (double, 1.2, get_ref_nearbyint (1.2), 1) +TEST_INIT (double, -1.8, get_ref_nearbyint (-1.8), 2) +TEST_INIT (double, 3.0, get_ref_nearbyint (3.0), 3) +TEST_INIT (double, 4503599627370495.5, get_ref_nearbyint (4503599627370495.5), 4) +TEST_INIT (double, 4503599627370497.0, get_ref_nearbyint (4503599627370497.0), 5) +TEST_INIT (double, 0.0, get_ref_nearbyint (0.0), 6) +TEST_INIT (double, -0.0, get_ref_nearbyint (-0.0), 7) +TEST_INIT (double, -4503599627370495.5, get_ref_nearbyint (-4503599627370495.5), 8) +TEST_INIT (double, -4503599627370496.0, get_ref_nearbyint (-4503599627370496.0), 9) int main () { - unsigned fflags_before = get_fflags (); - set_rm (FRM_RNE); RUN_TEST (double, 1, __builtin_nearbyint, in, out, ref, ARRAY_SIZE); @@ -39,10 +45,5 @@ main () RUN_TEST (double, 8, __builtin_nearbyint, in, out, ref, ARRAY_SIZE); RUN_TEST (double, 9, __builtin_nearbyint, in, out, ref, ARRAY_SIZE); - unsigned fflags_after = get_fflags (); - - if (fflags_before != fflags_after) - __builtin_abort (); - return 0; } diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-rint-run-1.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-rint-run-1.c index 080f1d9a2e49..9590d4465e3a 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-rint-run-1.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-rint-run-1.c @@ -9,24 +9,30 @@ float in[ARRAY_SIZE]; float out[ARRAY_SIZE]; float ref[ARRAY_SIZE]; +static float +get_ref_rintf (float val) +{ + set_rm (FRM_RTZ); + + return __builtin_rintf (val); +} + TEST_UNARY_CALL (float, __builtin_rintf) TEST_ASSERT (float) -TEST_INIT (float, 1.2, 1.0, 1) -TEST_INIT (float, -1.2, -1.0, 2) -TEST_INIT (float, 3.0, 3.0, 3) -TEST_INIT (float, 8388607.5, 8388607.0, 4) -TEST_INIT (float, 8388609.0, 8388609.0, 5) -TEST_INIT (float, 0.0, 0.0, 6) -TEST_INIT (float, -0.0, -0.0, 7) -TEST_INIT (float, -8388607.5, -8388607.0, 8) -TEST_INIT (float, -8388608.0, -8388608.0, 9) +TEST_INIT (float, 1.2, get_ref_rintf (1.2), 1) +TEST_INIT (float, -1.2, get_ref_rintf (-1.2), 2) +TEST_INIT (float, 3.0, get_ref_rintf (3.0), 3) +TEST_INIT (float, 8388607.5, get_ref_rintf (8388607.5), 4) +TEST_INIT (float, 8388609.0, get_ref_rintf (8388609.0), 5) +TEST_INIT (float, 0.0, get_ref_rintf (0.0), 6) +TEST_INIT (float, -0.0, get_ref_rintf (-0.0), 7) +TEST_INIT (float, -8388607.5, get_ref_rintf (-8388607.5), 8) +TEST_INIT (float, -8388608.0, get_ref_rintf (-8388608.0), 9) int main () { - unsigned fflags_before = get_fflags (); - set_rm (FRM_RTZ); RUN_TEST (float, 1, __builtin_rintf, in, out, ref, ARRAY_SIZE); @@ -39,10 +45,5 @@ main () RUN_TEST (float, 8, __builtin_rintf, in, out, ref, ARRAY_SIZE); RUN_TEST (float, 9, __builtin_rintf, in, out, ref, ARRAY_SIZE); - unsigned fflags_after = get_fflags (); - - if (fflags_before == fflags_after) - __builtin_abort (); - return 0; } diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-rint-run-2.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-rint-run-2.c index 6d03118e8259..fe5864924710 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-rint-run-2.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-rint-run-2.c @@ -9,24 +9,30 @@ double in[ARRAY_SIZE]; double out[ARRAY_SIZE]; double ref[ARRAY_SIZE]; +static double +get_ref_rint (double val) +{ + set_rm (FRM_RNE); + + return __builtin_rint (val); +} + TEST_UNARY_CALL (double, __builtin_rint) TEST_ASSERT (double) -TEST_INIT (double, 1.2, 1.0, 1) -TEST_INIT (double, -1.8, -2.0, 2) -TEST_INIT (double, 3.0, 3.0, 3) -TEST_INIT (double, 4503599627370495.5, 4503599627370496.0, 4) -TEST_INIT (double, 4503599627370497.0, 4503599627370497.0, 5) -TEST_INIT (double, 0.0, 0.0, 6) -TEST_INIT (double, -0.0, -0.0, 7) -TEST_INIT (double, -4503599627370495.5, -4503599627370496.0, 8) -TEST_INIT (double, -4503599627370496.0, -4503599627370496.0, 9) +TEST_INIT (double, 1.2, get_ref_rint (1.2), 1) +TEST_INIT (double, -1.8, get_ref_rint (-1.8), 2) +TEST_INIT (double, 3.0, get_ref_rint (3.0), 3) +TEST_INIT (double, 4503599627370495.5, get_ref_rint (4503599627370495.5), 4) +TEST_INIT (double, 4503599627370497.0, get_ref_rint (4503599627370497.0), 5) +TEST_INIT (double, 0.0, get_ref_rint (0.0), 6) +TEST_INIT (double, -0.0, get_ref_rint (-0.0), 7) +TEST_INIT (double, -4503599627370495.5, get_ref_rint (-4503599627370495.5), 8) +TEST_INIT (double, -4503599627370496.0, get_ref_rint (-4503599627370496.0), 9) int main () { - unsigned fflags_before = get_fflags (); - set_rm (FRM_RNE); RUN_TEST (double, 1, __builtin_rint, in, out, ref, ARRAY_SIZE); @@ -39,10 +45,5 @@ main () RUN_TEST (double, 8, __builtin_rint, in, out, ref, ARRAY_SIZE); RUN_TEST (double, 9, __builtin_rint, in, out, ref, ARRAY_SIZE); - unsigned fflags_after = get_fflags (); - - if (fflags_before == fflags_after) - __builtin_abort (); - return 0; } diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-round-run-1.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-round-run-1.c index fc8686fa0439..27e04d710b0d 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-round-run-1.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-round-run-1.c @@ -12,15 +12,15 @@ float ref[ARRAY_SIZE]; TEST_UNARY_CALL (float, __builtin_roundf) TEST_ASSERT (float) -TEST_INIT (float, 1.2, 1.0, 1) -TEST_INIT (float, -1.6, -2.0, 2) -TEST_INIT (float, 3.0, 3.0, 3) -TEST_INIT (float, 8388607.5, 8388608.0, 4) -TEST_INIT (float, 8388609.0, 8388609.0, 5) -TEST_INIT (float, 0.0, 0.0, 6) -TEST_INIT (float, -0.0, -0.0, 7) -TEST_INIT (float, -8388607.5, -8388608.0, 8) -TEST_INIT (float, -8388608.0, -8388608.0, 9) +TEST_INIT (float, 1.2, __builtin_roundf (1.2), 1) +TEST_INIT (float, -1.6, __builtin_roundf (-1.6), 2) +TEST_INIT (float, 3.0, __builtin_roundf (3.0), 3) +TEST_INIT (float, 8388607.5, __builtin_roundf (8388607.5), 4) +TEST_INIT (float, 8388609.0, __builtin_roundf (8388609.0), 5) +TEST_INIT (float, 0.0, __builtin_roundf (0.0), 6) +TEST_INIT (float, -0.0, __builtin_roundf (-0.0), 7) +TEST_INIT (float, -8388607.5, __builtin_roundf (-8388607.5), 8) +TEST_INIT (float, -8388608.0, __builtin_roundf (-8388608.0), 9) int main () diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-round-run-2.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-round-run-2.c index 14ddf6c9f368..cef280ce5571 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-round-run-2.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-round-run-2.c @@ -12,15 +12,15 @@ double ref[ARRAY_SIZE]; TEST_UNARY_CALL (double, __builtin_round) TEST_ASSERT (double) -TEST_INIT (double, 1.2, 1.0, 1) -TEST_INIT (double, -1.8, -2.0, 2) -TEST_INIT (double, 3.0, 3.0, 3) -TEST_INIT (double, 4503599627370495.5, 4503599627370496.0, 4) -TEST_INIT (double, 4503599627370497.0, 4503599627370497.0, 5) -TEST_INIT (double, 0.0, 0.0, 6) -TEST_INIT (double, -0.0, -0.0, 7) -TEST_INIT (double, -4503599627370495.5, -4503599627370496.0, 8) -TEST_INIT (double, -4503599627370496.0, -4503599627370496.0, 9) +TEST_INIT (double, 1.2, __builtin_round (1.2), 1) +TEST_INIT (double, -1.8, __builtin_round (-1.8), 2) +TEST_INIT (double, 3.0, __builtin_round (3.0), 3) +TEST_INIT (double, 4503599627370495.5, __builtin_round (4503599627370495.5), 4) +TEST_INIT (double, 4503599627370497.0, __builtin_round (4503599627370497.0), 5) +TEST_INIT (double, 0.0, __builtin_round (0.0), 6) +TEST_INIT (double, -0.0, __builtin_round (-0.0), 7) +TEST_INIT (double, -4503599627370495.5, __builtin_round (-4503599627370495.5), 8) +TEST_INIT (double, -4503599627370496.0, __builtin_round (-4503599627370496.0), 9) int main () diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-trunc-run-1.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-trunc-run-1.c index 8b9f6d2a6cad..910031d6e205 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-trunc-run-1.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-trunc-run-1.c @@ -12,15 +12,15 @@ float ref[ARRAY_SIZE]; TEST_UNARY_CALL (float, __builtin_truncf) TEST_ASSERT (float) -TEST_INIT (float, 1.2, 1.0, 1) -TEST_INIT (float, -1.2, -1.0, 2) -TEST_INIT (float, 3.0, 3.0, 3) -TEST_INIT (float, 8388607.5, 8388607.0, 4) -TEST_INIT (float, 8388609.0, 8388609.0, 5) -TEST_INIT (float, 0.0, 0.0, 6) -TEST_INIT (float, -0.0, -0.0, 7) -TEST_INIT (float, -8388607.5, -8388607.0, 8) -TEST_INIT (float, -8388608.0, -8388608.0, 9) +TEST_INIT (float, 1.2, __builtin_truncf (1.2), 1) +TEST_INIT (float, -1.2,__builtin_truncf (-1.2), 2) +TEST_INIT (float, 3.0, __builtin_truncf (3.0), 3) +TEST_INIT (float, 8388607.5, __builtin_truncf (8388607.5), 4) +TEST_INIT (float, 8388609.0, __builtin_truncf (8388609.0), 5) +TEST_INIT (float, 0.0, __builtin_truncf (0.0), 6) +TEST_INIT (float, -0.0, __builtin_truncf (-0.0), 7) +TEST_INIT (float, -8388607.5, __builtin_truncf (-8388607.5), 8) +TEST_INIT (float, -8388608.0, __builtin_truncf (-8388608.0), 9) int main () diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-trunc-run-2.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-trunc-run-2.c index 2ae354f31e60..20d91f0654e0 100644 --- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-trunc-run-2.c +++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-trunc-run-2.c @@ -12,15 +12,15 @@ double ref[ARRAY_SIZE]; TEST_UNARY_CALL (double, __builtin_trunc) TEST_ASSERT (double) -TEST_INIT (double, 1.2, 1.0, 1) -TEST_INIT (double, -1.2, -1.0, 2) -TEST_INIT (double, 3.0, 3.0, 3) -TEST_INIT (double, 4503599627370495.5, 4503599627370495.0, 4) -TEST_INIT (double, 4503599627370497.0, 4503599627370497.0, 5) -TEST_INIT (double, 0.0, 0.0, 6) -TEST_INIT (double, -0.0, -0.0, 7) -TEST_INIT (double, -4503599627370495.5, -4503599627370495.0, 8) -TEST_INIT (double, -4503599627370496.0, -4503599627370496.0, 9) +TEST_INIT (double, 1.2, __builtin_trunc (1.2), 1) +TEST_INIT (double, -1.2, __builtin_trunc (-1.2), 2) +TEST_INIT (double, 3.0, __builtin_trunc (3.0), 3) +TEST_INIT (double, 4503599627370495.5, __builtin_trunc (4503599627370495.5), 4) +TEST_INIT (double, 4503599627370497.0, __builtin_trunc (4503599627370497.0), 5) +TEST_INIT (double, 0.0, __builtin_trunc (0.0), 6) +TEST_INIT (double, -0.0, __builtin_trunc (-0.0), 7) +TEST_INIT (double, -4503599627370495.5, __builtin_trunc (-4503599627370495.5), 8) +TEST_INIT (double, -4503599627370496.0, __builtin_trunc (-4503599627370496.0), 9) int main ()
reply other threads:[~2023-10-16 18:38 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20231016183851.05B3C38582BD@sourceware.org \ --to=law@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).