diff options
author | Andreas Krebbel <krebbel@linux.ibm.com> | 2018-08-08 12:38:51 +0000 |
---|---|---|
committer | Andreas Krebbel <krebbel@gcc.gnu.org> | 2018-08-08 12:38:51 +0000 |
commit | 9f3c21d62131d5b7224de862061d133d3dba6514 (patch) | |
tree | acddc9ebb4cc5b18dc10d72164d224f43e1a2b59 | |
parent | 0ff3dcd61a70884eb39c2ee9fb107e8ea14849c8 (diff) | |
download | gcc-9f3c21d62131d5b7224de862061d133d3dba6514.zip gcc-9f3c21d62131d5b7224de862061d133d3dba6514.tar.gz gcc-9f3c21d62131d5b7224de862061d133d3dba6514.tar.bz2 |
S/390: Fix PR85295
gcc/ChangeLog:
2018-08-08 Andreas Krebbel <krebbel@linux.ibm.com>
PR target/85295
* config/s390/constraints.md ("NxHD0", "NxSD0"): New constraint
definitions.
* config/s390/s390.md ("movti"): Add more alternatives for
constant to GPR copies.
gcc/testsuite/ChangeLog:
2018-08-08 Andreas Krebbel <krebbel@linux.ibm.com>
PR target/85295
* gcc.target/s390/TI-constants-lra.c: New testcase.
* gcc.target/s390/TI-constants-nolra.c: New testcase.
From-SVN: r263396
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/config/s390/constraints.md | 16 | ||||
-rw-r--r-- | gcc/config/s390/s390.md | 14 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/s390/TI-constants-lra.c | 47 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/s390/TI-constants-nolra.c | 47 |
6 files changed, 131 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1a1d0ee..4c653ea 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,13 @@ 2018-08-08 Andreas Krebbel <krebbel@linux.ibm.com> + PR target/85295 + * config/s390/constraints.md ("NxHD0", "NxSD0"): New constraint + definitions. + * config/s390/s390.md ("movti"): Add more alternatives for + constant to GPR copies. + +2018-08-08 Andreas Krebbel <krebbel@linux.ibm.com> + * config/s390/s390.c: Fix whitespace damage throughout the file. * config/s390/s390.h: Likewise. * config/s390/tpf.h: Likewise. diff --git a/gcc/config/s390/constraints.md b/gcc/config/s390/constraints.md index b18622d..b8ba851 100644 --- a/gcc/config/s390/constraints.md +++ b/gcc/config/s390/constraints.md @@ -51,7 +51,7 @@ ;; M -- Constant integer with a value of 0x7fffffff. ;; N -- Multiple letter constraint followed by 4 parameter letters. ;; 0..9,x: number of the part counting from most to least significant -;; H,Q: mode of the part +;; S,H,Q: mode of the part ;; D,S,H: mode of the containing operand ;; 0,F: value of the other parts (F - all bits set) ;; -- @@ -204,7 +204,7 @@ ;; N -- Multiple letter constraint followed by 4 parameter letters. ;; 0..9,x: number of the part counting from most to least significant -;; H,Q: mode of the part +;; S,H,Q: mode of the part ;; D,S,H: mode of the containing operand ;; 0,F: value of the other parts (F = all bits set) ;; @@ -226,6 +226,18 @@ (match_test "s390_N_constraint_str (\"xQS0\", ival)"))) +(define_constraint "NxHD0" + "@internal" + (and (match_code "const_int") + (match_test "s390_N_constraint_str (\"xHD0\", ival)"))) + + +(define_constraint "NxSD0" + "@internal" + (and (match_code "const_int") + (match_test "s390_N_constraint_str (\"xSD0\", ival)"))) + + (define_constraint "NxQD0" "@internal" (and (match_code "const_int") diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md index e735a17a..db260e4 100644 --- a/gcc/config/s390/s390.md +++ b/gcc/config/s390/s390.md @@ -1512,8 +1512,8 @@ ; FIXME: More constants are possible by enabling jxx, jyy constraints ; for TImode (use double-int for the calculations) (define_insn "movti" - [(set (match_operand:TI 0 "nonimmediate_operand" "=d,S,v, v, v,v,d,v,R, d,o") - (match_operand:TI 1 "general_operand" " S,d,v,j00,jm1,d,v,R,v,dT,d"))] + [(set (match_operand:TI 0 "nonimmediate_operand" "=d,S,v, v, v,v,d,v,R,d, d, d, d, d,o") + (match_operand:TI 1 "general_operand" " S,d,v,j00,jm1,d,v,R,v,K,NxHD0,Os,NxSD0,dT,d"))] "TARGET_ZARCH" "@ lmg\t%0,%N0,%S1 @@ -1526,10 +1526,14 @@ vl\t%v0,%1 vst\t%v1,%0 # + # + # + # + # #" - [(set_attr "op_type" "RSY,RSY,VRR,VRI,VRI,VRR,*,VRX,VRX,*,*") - (set_attr "type" "lm,stm,*,*,*,*,*,*,*,*,*") - (set_attr "cpu_facility" "*,*,vx,vx,vx,vx,vx,vx,vx,*,*")]) + [(set_attr "op_type" "RSY,RSY,VRR,VRI,VRI,VRR,*,VRX,VRX,*,*,*,*,*,*") + (set_attr "type" "lm,stm,*,*,*,*,*,*,*,*,*,*,*,*,*") + (set_attr "cpu_facility" "*,*,vx,vx,vx,vx,vx,vx,vx,*,*,*,extimm,*,*")]) (define_split [(set (match_operand:TI 0 "nonimmediate_operand" "") diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ccfd013..472e6a9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2018-08-08 Andreas Krebbel <krebbel@linux.ibm.com> + + PR target/85295 + * gcc.target/s390/TI-constants-lra.c: New testcase. + * gcc.target/s390/TI-constants-nolra.c: New testcase. + 2018-08-08 Ilya Leoshkevich <iii@linux.ibm.com> * gcc.target/s390/hotpatch-8.c: Remove. diff --git a/gcc/testsuite/gcc.target/s390/TI-constants-lra.c b/gcc/testsuite/gcc.target/s390/TI-constants-lra.c new file mode 100644 index 0000000..cc52a62 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/TI-constants-lra.c @@ -0,0 +1,47 @@ +/* { dg-do compile { target int128 } } */ +/* { dg-options "-O3" } */ + +/* 2x lghi */ +__int128 a() { + return 0; +} + +/* 2x lghi */ +__int128 b() { + return -1; +} + +/* 2x lghi */ +__int128 c() { + return -2; +} + +/* lghi + llilh */ +__int128 d() { + return 16000 << 16; +} + +/* lghi + llihf */ +__int128 e() { + return (unsigned long long)80000 << 32; +} + +/* lghi + llihf */ +__int128 f() { + return (unsigned __int128)80000 << 96; +} + +/* llihf + llihf - this is handled via movti_bigconst pattern */ +__int128 g() { + return ((unsigned __int128)80000 << 96) | ((unsigned __int128)80000 << 32); +} + +/* Literal pool */ +__int128 h() { + return ((unsigned __int128)80000 << 32) | 1; +} + +/* Literal pool */ +__int128 i() { + return (((unsigned __int128)80000 << 32) | 1) << 64; +} diff --git a/gcc/testsuite/gcc.target/s390/TI-constants-nolra.c b/gcc/testsuite/gcc.target/s390/TI-constants-nolra.c new file mode 100644 index 0000000..b9948fc --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/TI-constants-nolra.c @@ -0,0 +1,47 @@ +/* { dg-do compile { target int128 } } */ +/* { dg-options "-O3 -mno-lra" } */ + +/* 2x lghi */ +__int128 a() { + return 0; +} + +/* 2x lghi */ +__int128 b() { + return -1; +} + +/* 2x lghi */ +__int128 c() { + return -2; +} + +/* lghi + llilh */ +__int128 d() { + return 16000 << 16; +} + +/* lghi + llihf */ +__int128 e() { + return (unsigned long long)80000 << 32; +} + +/* lghi + llihf */ +__int128 f() { + return (unsigned __int128)80000 << 96; +} + +/* llihf + llihf - this is handled via movti_bigconst pattern */ +__int128 g() { + return ((unsigned __int128)80000 << 96) | ((unsigned __int128)80000 << 32); +} + +/* Literal pool */ +__int128 h() { + return ((unsigned __int128)80000 << 32) | 1; +} + +/* Literal pool */ +__int128 i() { + return (((unsigned __int128)80000 << 32) | 1) << 64; +} |