This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
S/390: Make more efficient use of Q constraint
- From: "Ulrich Weigand" <Ulrich dot Weigand at de dot ibm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 3 Sep 2002 20:40:24 +0200
- Subject: S/390: Make more efficient use of Q constraint
- Sensitivity:
Hello,
this patch uses the new properties of the Q constraint due to
the new EXTRA_MEMORY_CONSTRAINT feature to make better use of
the Q->Q type memory move instruction (MVC).
Bootstrapped/regtested on s390-ibm-linux and s390x-ibm-linux.
Committed to CVS head.
Bye,
Ulrich
ChangeLog:
* config/s390/s390.md ("movti"): Add Q->Q alternative.
("*movdi_64", "*movdi_31", "*movsi", "movhi", "movqi_64",
"movqi", "*movdf_64", "*movdf_31", "*movsf"): Likewise.
("*movti_ss", "*movdi_ss", "*movsi_ss", "*movdf_ss",
"*movsf_ss"): Remove.
Index: s390.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/s390/s390.md,v
retrieving revision 1.25
diff -c -p -r1.25 s390.md
*** s390.md 26 Aug 2002 18:18:19 -0000 1.25
--- s390.md 3 Sep 2002 16:06:15 -0000
***************
*** 779,802 ****
; movti instruction pattern(s).
;
- (define_insn "*movti_ss"
- [(set (match_operand:TI 0 "s_operand" "=Q")
- (match_operand:TI 1 "s_imm_operand" "Q"))]
- ""
- "mvc\\t%O0(16,%R0),%1"
- [(set_attr "op_type" "SS")
- (set_attr "atype" "mem")])
-
(define_insn "movti"
! [(set (match_operand:TI 0 "nonimmediate_operand" "=d,Q,d,m")
! (match_operand:TI 1 "general_operand" "Q,d,dKm,d"))]
"TARGET_64BIT"
"@
lmg\\t%0,%N0,%1
stmg\\t%1,%N1,%0
#
! #"
! [(set_attr "op_type" "RSE,RSE,NN,NN")
(set_attr "atype" "mem")])
(define_split
--- 779,795 ----
; movti instruction pattern(s).
;
(define_insn "movti"
! [(set (match_operand:TI 0 "nonimmediate_operand" "=d,Q,d,m,Q")
! (match_operand:TI 1 "general_operand" "Q,d,dKm,d,Q"))]
"TARGET_64BIT"
"@
lmg\\t%0,%N0,%1
stmg\\t%1,%N1,%0
#
! #
! mvc\\t%O0(16,%R0),%1"
! [(set_attr "op_type" "RSE,RSE,NN,NN,SS")
(set_attr "atype" "mem")])
(define_split
***************
*** 913,929 ****
(set_attr "atype" "reg")
(set_attr "type" "la")])
- (define_insn "*movdi_ss"
- [(set (match_operand:DI 0 "s_operand" "=Q")
- (match_operand:DI 1 "s_imm_operand" "Q"))]
- ""
- "mvc\\t%O0(8,%R0),%1"
- [(set_attr "op_type" "SS")
- (set_attr "atype" "mem")])
-
(define_insn "*movdi_64"
! [(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,m,!*f,!*f,!m")
! (match_operand:DI 1 "general_operand" "d,m,d,*f,m,*f"))]
"TARGET_64BIT"
"@
lgr\\t%0,%1
--- 906,914 ----
(set_attr "atype" "reg")
(set_attr "type" "la")])
(define_insn "*movdi_64"
! [(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,m,!*f,!*f,!m,Q")
! (match_operand:DI 1 "general_operand" "d,m,d,*f,m,*f,Q"))]
"TARGET_64BIT"
"@
lgr\\t%0,%1
***************
*** 931,943 ****
stg\\t%1,%0
ldr\\t%0,%1
ld\\t%0,%1
! std\\t%1,%0"
! [(set_attr "op_type" "RR,RXE,RXE,RR,RX,RX")
! (set_attr "atype" "reg,mem,mem,reg,mem,mem")])
(define_insn "*movdi_31"
! [(set (match_operand:DI 0 "nonimmediate_operand" "=d,Q,d,m,!*f,!*f,!m")
! (match_operand:DI 1 "general_operand" "Q,d,dKm,d,*f,m,*f"))]
"!TARGET_64BIT"
"@
lm\\t%0,%N0,%1
--- 916,929 ----
stg\\t%1,%0
ldr\\t%0,%1
ld\\t%0,%1
! std\\t%1,%0
! mvc\\t%O0(8,%R0),%1"
! [(set_attr "op_type" "RR,RXE,RXE,RR,RX,RX,SS")
! (set_attr "atype" "reg,mem,mem,reg,mem,mem,mem")])
(define_insn "*movdi_31"
! [(set (match_operand:DI 0 "nonimmediate_operand" "=d,Q,d,m,!*f,!*f,!m,Q")
! (match_operand:DI 1 "general_operand" "Q,d,dKm,d,*f,m,*f,Q"))]
"!TARGET_64BIT"
"@
lm\\t%0,%N0,%1
***************
*** 946,954 ****
#
ldr\\t%0,%1
ld\\t%0,%1
! std\\t%1,%0"
! [(set_attr "op_type" "RS,RS,NN,NN,RR,RX,RX")
! (set_attr "atype" "mem,mem,*,*,reg,mem,mem")])
(define_split
[(set (match_operand:DI 0 "nonimmediate_operand" "")
--- 932,941 ----
#
ldr\\t%0,%1
ld\\t%0,%1
! std\\t%1,%0
! mvc\\t%O0(8,%R0),%1"
! [(set_attr "op_type" "RS,RS,NN,NN,RR,RX,RX,SS")
! (set_attr "atype" "mem,mem,*,*,reg,mem,mem,mem")])
(define_split
[(set (match_operand:DI 0 "nonimmediate_operand" "")
***************
*** 1066,1082 ****
}"
[(set_attr "op_type" "RI")])
- (define_insn "*movsi_ss"
- [(set (match_operand:SI 0 "s_operand" "=Q")
- (match_operand:SI 1 "s_imm_operand" "Q"))]
- ""
- "mvc\\t%O0(4,%R0),%1"
- [(set_attr "op_type" "SS")
- (set_attr "atype" "mem")])
-
(define_insn "*movsi"
! [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,m,!*f,!*f,!m")
! (match_operand:SI 1 "general_operand" "d,m,d,*f,m,*f"))]
""
"@
lr\\t%0,%1
--- 1053,1061 ----
}"
[(set_attr "op_type" "RI")])
(define_insn "*movsi"
! [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,m,!*f,!*f,!m,Q")
! (match_operand:SI 1 "general_operand" "d,m,d,*f,m,*f,Q"))]
""
"@
lr\\t%0,%1
***************
*** 1084,1092 ****
st\\t%1,%0
ler\\t%0,%1
le\\t%0,%1
! ste\\t%1,%0"
! [(set_attr "op_type" "RR,RX,RX,RR,RX,RX")
! (set_attr "atype" "reg,mem,mem,reg,mem,mem")])
;
--- 1063,1072 ----
st\\t%1,%0
ler\\t%0,%1
le\\t%0,%1
! ste\\t%1,%0
! mvc\\t%O0(4,%R0),%1"
! [(set_attr "op_type" "RR,RX,RX,RR,RX,RX,SS")
! (set_attr "atype" "reg,mem,mem,reg,mem,mem,mem")])
;
***************
*** 1094,1109 ****
;
(define_insn "movhi"
! [(set (match_operand:HI 0 "nonimmediate_operand" "=d,d,d,m")
! (match_operand:HI 1 "general_operand" "d,n,m,d"))]
""
"@
lr\\t%0,%1
lhi\\t%0,%h1
lh\\t%0,%1
! sth\\t%1,%0"
! [(set_attr "op_type" "RR,RI,RX,RX")
! (set_attr "atype" "reg,reg,mem,mem")])
;
--- 1074,1090 ----
;
(define_insn "movhi"
! [(set (match_operand:HI 0 "nonimmediate_operand" "=d,d,d,m,Q")
! (match_operand:HI 1 "general_operand" "d,n,m,d,Q"))]
""
"@
lr\\t%0,%1
lhi\\t%0,%h1
lh\\t%0,%1
! sth\\t%1,%0
! mvc\\t%O0(2,%R0),%1"
! [(set_attr "op_type" "RR,RI,RX,RX,SS")
! (set_attr "atype" "reg,reg,mem,mem,mem")])
;
***************
*** 1111,1141 ****
;
(define_insn "movqi_64"
! [(set (match_operand:QI 0 "nonimmediate_operand" "=d,d,d,m,Q")
! (match_operand:QI 1 "general_operand" "d,n,m,d,n"))]
"TARGET_64BIT"
"@
lr\\t%0,%1
lhi\\t%0,%b1
llgc\\t%0,%1
stc\\t%1,%0
! mvi\\t%0,%b1"
! [(set_attr "op_type" "RR,RI,RXE,RX,SI")
! (set_attr "atype" "reg,reg,mem,mem,mem")])
(define_insn "movqi"
! [(set (match_operand:QI 0 "nonimmediate_operand" "=d,d,d,m,Q")
! (match_operand:QI 1 "general_operand" "d,n,m,d,n"))]
""
"@
lr\\t%0,%1
lhi\\t%0,%b1
ic\\t%0,%1
stc\\t%1,%0
! mvi\\t%0,%b1"
! [(set_attr "op_type" "RR,RI,RX,RX,SI")
! (set_attr "atype" "reg,reg,mem,mem,mem")])
;
--- 1092,1124 ----
;
(define_insn "movqi_64"
! [(set (match_operand:QI 0 "nonimmediate_operand" "=d,d,d,m,Q,Q")
! (match_operand:QI 1 "general_operand" "d,n,m,d,n,Q"))]
"TARGET_64BIT"
"@
lr\\t%0,%1
lhi\\t%0,%b1
llgc\\t%0,%1
stc\\t%1,%0
! mvi\\t%0,%b1
! mvc\\t%O0(1,%R0),%1"
! [(set_attr "op_type" "RR,RI,RXE,RX,SI,SS")
! (set_attr "atype" "reg,reg,mem,mem,mem,mem")])
(define_insn "movqi"
! [(set (match_operand:QI 0 "nonimmediate_operand" "=d,d,d,m,Q,Q")
! (match_operand:QI 1 "general_operand" "d,n,m,d,n,Q"))]
""
"@
lr\\t%0,%1
lhi\\t%0,%b1
ic\\t%0,%1
stc\\t%1,%0
! mvi\\t%0,%b1
! mvc\\t%O0(1,%R0),%1"
! [(set_attr "op_type" "RR,RI,RX,RX,SI,SS")
! (set_attr "atype" "reg,reg,mem,mem,mem,mem")])
;
***************
*** 1196,1212 ****
operands[1] = force_const_mem (DFmode, operands[1]);
}")
- (define_insn "*movdf_ss"
- [(set (match_operand:DF 0 "s_operand" "=Q")
- (match_operand:DF 1 "s_imm_operand" "Q"))]
- ""
- "mvc\\t%O0(8,%R0),%1"
- [(set_attr "op_type" "SS")
- (set_attr "atype" "mem")])
-
(define_insn "*movdf_64"
! [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f,m,d,d,m")
! (match_operand:DF 1 "general_operand" "f,m,f,d,m,d"))]
"TARGET_64BIT"
"@
ldr\\t%0,%1
--- 1179,1187 ----
operands[1] = force_const_mem (DFmode, operands[1]);
}")
(define_insn "*movdf_64"
! [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f,m,d,d,m,Q")
! (match_operand:DF 1 "general_operand" "f,m,f,d,m,d,Q"))]
"TARGET_64BIT"
"@
ldr\\t%0,%1
***************
*** 1214,1226 ****
std\\t%1,%0
lgr\\t%0,%1
lg\\t%0,%1
! stg\\t%1,%0"
! [(set_attr "op_type" "RR,RX,RX,RR,RXE,RXE")
! (set_attr "atype" "reg,mem,mem,reg,mem,mem")])
(define_insn "*movdf_31"
! [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f,m,d,Q,d,m")
! (match_operand:DF 1 "general_operand" "f,m,f,Q,d,dKm,d"))]
"!TARGET_64BIT"
"@
ldr\\t%0,%1
--- 1189,1202 ----
std\\t%1,%0
lgr\\t%0,%1
lg\\t%0,%1
! stg\\t%1,%0
! mvc\\t%O0(8,%R0),%1"
! [(set_attr "op_type" "RR,RX,RX,RR,RXE,RXE,SS")
! (set_attr "atype" "reg,mem,mem,reg,mem,mem,mem")])
(define_insn "*movdf_31"
! [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f,m,d,Q,d,m,Q")
! (match_operand:DF 1 "general_operand" "f,m,f,Q,d,dKm,d,Q"))]
"!TARGET_64BIT"
"@
ldr\\t%0,%1
***************
*** 1229,1237 ****
lm\\t%0,%N0,%1
stm\\t%1,%N1,%0
#
! #"
! [(set_attr "op_type" "RR,RX,RX,RS,RS,NN,NN")
! (set_attr "atype" "reg,mem,mem,mem,mem,*,*")])
(define_split
[(set (match_operand:DF 0 "nonimmediate_operand" "")
--- 1205,1214 ----
lm\\t%0,%N0,%1
stm\\t%1,%N1,%0
#
! #
! mvc\\t%O0(8,%R0),%1"
! [(set_attr "op_type" "RR,RX,RX,RS,RS,NN,NN,SS")
! (set_attr "atype" "reg,mem,mem,mem,mem,*,*,mem")])
(define_split
[(set (match_operand:DF 0 "nonimmediate_operand" "")
***************
*** 1299,1315 ****
operands[1] = force_const_mem (SFmode, operands[1]);
}")
- (define_insn "*movsf_ss"
- [(set (match_operand:SF 0 "s_operand" "=Q")
- (match_operand:SF 1 "s_imm_operand" "Q"))]
- ""
- "mvc\\t%O0(4,%R0),%1"
- [(set_attr "op_type" "SS")
- (set_attr "atype" "mem")])
-
(define_insn "*movsf"
! [(set (match_operand:SF 0 "nonimmediate_operand" "=f,f,m,d,d,m")
! (match_operand:SF 1 "general_operand" "f,m,f,d,m,d"))]
""
"@
ler\\t%0,%1
--- 1276,1284 ----
operands[1] = force_const_mem (SFmode, operands[1]);
}")
(define_insn "*movsf"
! [(set (match_operand:SF 0 "nonimmediate_operand" "=f,f,m,d,d,m,Q")
! (match_operand:SF 1 "general_operand" "f,m,f,d,m,d,Q"))]
""
"@
ler\\t%0,%1
***************
*** 1317,1325 ****
ste\\t%1,%0
lr\\t%0,%1
l\\t%0,%1
! st\\t%1,%0"
! [(set_attr "op_type" "RR,RX,RX,RR,RX,RX")
! (set_attr "atype" "reg,mem,mem,reg,mem,mem")])
;
; load_multiple pattern(s).
--- 1286,1295 ----
ste\\t%1,%0
lr\\t%0,%1
l\\t%0,%1
! st\\t%1,%0
! mvc\\t%O0(4,%R0),%1"
! [(set_attr "op_type" "RR,RX,RX,RR,RX,RX,SS")
! (set_attr "atype" "reg,mem,mem,reg,mem,mem,mem")])
;
; load_multiple pattern(s).
Mit freundlichen Gruessen / Best Regards
Ulrich Weigand
--
Dr. Ulrich Weigand
Linux for S/390 Design & Development
IBM Deutschland Entwicklung GmbH, Schoenaicher Str. 220, 71032 Boeblingen
Phone: +49-7031/16-3727 --- Email: Ulrich.Weigand@de.ibm.com