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: Leverage __builtin_xx instead of math.h for test
Date: Tue, 26 Sep 2023 15:11:49 +0000 (GMT)	[thread overview]
Message-ID: <20230926151149.06157385C6F2@sourceware.org> (raw)

https://gcc.gnu.org/g:63ffe44c75c15638811eca56d72836bad254fc9b

commit 63ffe44c75c15638811eca56d72836bad254fc9b
Author: Pan Li <pan2.li@intel.com>
Date:   Fri Sep 22 09:09:34 2023 +0800

    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>
    (cherry picked from commit dba79ce1681828d05f6ed73ad56d8c3f3d53411a)

Diff:
---
 .../riscv/rvv/autovec/vls/floating-point-max-5.c   | 43 +++++++++++-----------
 .../riscv/rvv/autovec/vls/floating-point-min-5.c   | 43 +++++++++++-----------
 .../riscv/rvv/autovec/vls/floating-point-sgnjx-2.c | 43 +++++++++++-----------
 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 775ddb1d25e..dd163682396 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 1e9ff7d5054..0e3cbf2acec 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 7e017de6a25..ec9001f8ee4 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} } } */

                 reply	other threads:[~2023-09-26 15:11 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=20230926151149.06157385C6F2@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: link
Be 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).