diff options
author | Haochen Gui <guihaoc@gcc.gnu.org> | 2023-05-11 10:07:01 +0800 |
---|---|---|
committer | Haochen Gui <guihaoc@gcc.gnu.org> | 2023-05-12 09:46:59 +0800 |
commit | e25dc59d051a79b7059d85ea294b0c01f28af2f7 (patch) | |
tree | e8ee8b4901403150e82b459fab84956ca59c4d57 /gcc | |
parent | 1ebe8c20c1bf668d2433db93c178b7d6daa41811 (diff) | |
download | gcc-e25dc59d051a79b7059d85ea294b0c01f28af2f7.zip gcc-e25dc59d051a79b7059d85ea294b0c01f28af2f7.tar.gz gcc-e25dc59d051a79b7059d85ea294b0c01f28af2f7.tar.bz2 |
rs6000: Change mode and insn condition for scalar extract exp instruction
gcc/
* config/rs6000/rs6000-builtins.def
(__builtin_vsx_scalar_extract_exp): Set return type to const signed
int and set its bif-pattern to xsxexpdp_si, move it from power9-64
to power9 catalog.
* config/rs6000/vsx.md (xsxexpdp): Rename to ...
(xsxexpdp_<mode>): ..., set mode of operand 0 to GPR and remove
TARGET_64BIT check.
* doc/extend.texi (scalar_extract_exp): Remove 64-bit environment
requirement when it has a 64-bit argument.
gcc/testsuite/
* gcc.target/powerpc/bfp/scalar-extract-exp-0.c: Remove lp64 check.
* gcc.target/powerpc/bfp/scalar-extract-exp-1.c: Likewise.
* gcc.target/powerpc/bfp/scalar-extract-exp-2.c: Delete as the case
is invalid now.
* gcc.target/powerpc/bfp/scalar-extract-exp-6.c: Remove lp64 check.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/config/rs6000/rs6000-builtins.def | 5 | ||||
-rw-r--r-- | gcc/config/rs6000/vsx.md | 8 | ||||
-rw-r--r-- | gcc/doc/extend.texi | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-0.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-1.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-2.c | 20 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-6.c | 2 |
7 files changed, 10 insertions, 34 deletions
diff --git a/gcc/config/rs6000/rs6000-builtins.def b/gcc/config/rs6000/rs6000-builtins.def index 638d0bc..6240a6a 100644 --- a/gcc/config/rs6000/rs6000-builtins.def +++ b/gcc/config/rs6000/rs6000-builtins.def @@ -2846,6 +2846,8 @@ const signed int __builtin_dtstsfi_ov_td (const int<6>, _Decimal128); TSTSFI_OV_TD dfptstsfi_unordered_td {} + const signed int __builtin_vsx_scalar_extract_exp (double); + VSEEDP xsxexpdp_si {} [power9-64] void __builtin_altivec_xst_len_r (vsc, void *, long); @@ -2860,9 +2862,6 @@ pure vsc __builtin_vsx_lxvl (const void *, signed long); LXVL lxvl {} - const signed long __builtin_vsx_scalar_extract_exp (double); - VSEEDP xsxexpdp {} - const signed long __builtin_vsx_scalar_extract_sig (double); VSESDP xsxsigdp {} diff --git a/gcc/config/rs6000/vsx.md b/gcc/config/rs6000/vsx.md index 7d845df..3f3f76e 100644 --- a/gcc/config/rs6000/vsx.md +++ b/gcc/config/rs6000/vsx.md @@ -5017,11 +5017,11 @@ [(set_attr "type" "vecmove")]) ;; VSX Scalar Extract Exponent Double-Precision -(define_insn "xsxexpdp" - [(set (match_operand:DI 0 "register_operand" "=r") - (unspec:DI [(match_operand:DF 1 "vsx_register_operand" "wa")] +(define_insn "xsxexpdp_<mode>" + [(set (match_operand:GPR 0 "register_operand" "=r") + (unspec:GPR [(match_operand:DF 1 "vsx_register_operand" "wa")] UNSPEC_VSX_SXEXPDP))] - "TARGET_P9_VECTOR && TARGET_64BIT" + "TARGET_P9_VECTOR" "xsxexpdp %0,%x1" [(set_attr "type" "integer")]) diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index e426a2e..69b21a7 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -19739,7 +19739,10 @@ bool scalar_test_neg (double source); bool scalar_test_neg (__ieee128 source); @end smallexample -The @code{scalar_extract_exp} and @code{scalar_extract_sig} +The @code{scalar_extract_exp} with a 64-bit source argument +function requires an environment supporting ISA 3.0 or later. +The @code{scalar_extract_exp} with a 128-bit source argument +and @code{scalar_extract_sig} functions require a 64-bit environment supporting ISA 3.0 or later. The @code{scalar_extract_exp} and @code{scalar_extract_sig} built-in functions return the significand and the biased exponent value diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-0.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-0.c index 35bf1b2..d971833 100644 --- a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-0.c +++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-0.c @@ -1,9 +1,7 @@ /* { dg-do compile { target { powerpc*-*-* } } } */ -/* { dg-require-effective-target lp64 } */ /* { dg-require-effective-target powerpc_p9vector_ok } */ /* { dg-options "-mdejagnu-cpu=power9" } */ -/* This test should succeed only on 64-bit configurations. */ #include <altivec.h> unsigned int diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-1.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-1.c index 9737762..1cb438f 100644 --- a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-1.c +++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-1.c @@ -1,9 +1,7 @@ /* { dg-do compile { target { powerpc*-*-* } } } */ -/* { dg-require-effective-target lp64 } */ /* { dg-require-effective-target powerpc_p9vector_ok } */ /* { dg-options "-mdejagnu-cpu=power8" } */ -/* This test should succeed only on 64-bit configurations. */ #include <altivec.h> unsigned int diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-2.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-2.c deleted file mode 100644 index 53b67c9..0000000 --- a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-2.c +++ /dev/null @@ -1,20 +0,0 @@ -/* { dg-do compile { target { powerpc*-*-* } } } */ -/* { dg-require-effective-target ilp32 } */ -/* { dg-require-effective-target powerpc_p9vector_ok } */ -/* { dg-options "-mdejagnu-cpu=power9" } */ - -/* This test only runs on 32-bit configurations, where a compiler error - should be issued because this builtin is not available on - 32-bit configurations. */ - -#include <altivec.h> - -unsigned int -get_exponent (double *p) -{ - double source = *p; - - return scalar_extract_exp (source); /* { dg-error "'__builtin_vsx_scalar_extract_exp' requires the" } */ -} - - diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-6.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-6.c index b9dd7d6..e0581cd 100644 --- a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-6.c +++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-6.c @@ -1,9 +1,7 @@ /* { dg-do run { target { powerpc*-*-* } } } */ -/* { dg-require-effective-target lp64 } */ /* { dg-require-effective-target p9vector_hw } */ /* { dg-options "-mdejagnu-cpu=power9" } */ -/* This test should succeed only on 64-bit configurations. */ #include <altivec.h> #include <stdlib.h> |