This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
altivec: memory to gpr copies
- From: Aldy Hernandez <aldyh at redhat dot com>
- To: dje at watson dot ibm dot com, gcc-patches at gcc dot gnu dot org
- Date: Mon, 22 Apr 2002 17:02:25 +1000
- Subject: altivec: memory to gpr copies
interestingly enough, gcc chokes on this when "-g -maltivec -O0" is
used but -mabi=altivec is *not* used:
void f(vector int a, vector int b) { }
we are matching movv4si_internal and trying to do
"m = r" (memory <== gpr), so we match:
stw%U0 %1,%0\;stw %L1,%L0\;stw %Y1,%Y0\;stw %Z1,%Z0
while trying to do the %L option in print_operand we try to convert:
(mem/f:V4SI (plus:SI (reg/f:SI 31 r31)
(reg:SI 0 r0 [116])) [0 b+0 S16 A128])
into an invalid address of:
(mem/f:SI (plus:SI (plus:SI (reg/f:SI 31 r31)
(reg:SI 0 r0 [116]))
(const_int 4 [0x4])) [0 b+4 S4 A32])
then it all goes down hill.
reload has already finished, so we can't really add an offset this late
in the game. so we end up with an invalid address we can't fix.
david has suggested i change my memory constraint to 'o'ffsetable.
ok for branch and trunk?
2002-04-22 Aldy Hernandez <aldyh@redhat.com>
* config/rs6000/rs6000.md ("*movv4si_internal"): Change 'm'
constraint to 'o' for m=r and r=m alternatives.
("*movv8hi_internal1"): Same.
("*movv16qi_internal1"): Same.
("*movv4sf_internal1"): Same.
Index: config/rs6000/rs6000.md
===================================================================
RCS file: /cvs/uberbaum/gcc/config/rs6000/rs6000.md,v
retrieving revision 1.179
diff -c -p -r1.179 rs6000.md
*** config/rs6000/rs6000.md 12 Apr 2002 16:57:47 -0000 1.179
--- config/rs6000/rs6000.md 22 Apr 2002 06:45:06 -0000
***************
*** 13982,13989 ****
"{ rs6000_emit_move (operands[0], operands[1], V4SImode); DONE; }")
(define_insn "*movv4si_internal"
! [(set (match_operand:V4SI 0 "nonimmediate_operand" "=m,v,v,m,r,r")
! (match_operand:V4SI 1 "input_operand" "v,m,v,r,m,r"))]
"TARGET_ALTIVEC"
"@
stvx %1,%y0
--- 13982,13989 ----
"{ rs6000_emit_move (operands[0], operands[1], V4SImode); DONE; }")
(define_insn "*movv4si_internal"
! [(set (match_operand:V4SI 0 "nonimmediate_operand" "=m,v,v,o,r,r")
! (match_operand:V4SI 1 "input_operand" "v,m,v,r,o,r"))]
"TARGET_ALTIVEC"
"@
stvx %1,%y0
***************
*** 14002,14009 ****
"{ rs6000_emit_move (operands[0], operands[1], V8HImode); DONE; }")
(define_insn "*movv8hi_internal1"
! [(set (match_operand:V8HI 0 "nonimmediate_operand" "=m,v,v,m,r,r")
! (match_operand:V8HI 1 "input_operand" "v,m,v,r,m,r"))]
"TARGET_ALTIVEC"
"@
stvx %1,%y0
--- 14002,14009 ----
"{ rs6000_emit_move (operands[0], operands[1], V8HImode); DONE; }")
(define_insn "*movv8hi_internal1"
! [(set (match_operand:V8HI 0 "nonimmediate_operand" "=m,v,v,o,r,r")
! (match_operand:V8HI 1 "input_operand" "v,m,v,r,o,r"))]
"TARGET_ALTIVEC"
"@
stvx %1,%y0
***************
*** 14022,14029 ****
"{ rs6000_emit_move (operands[0], operands[1], V16QImode); DONE; }")
(define_insn "*movv16qi_internal1"
! [(set (match_operand:V16QI 0 "nonimmediate_operand" "=m,v,v,m,r,r")
! (match_operand:V16QI 1 "input_operand" "v,m,v,r,m,r"))]
"TARGET_ALTIVEC"
"@
stvx %1,%y0
--- 14022,14029 ----
"{ rs6000_emit_move (operands[0], operands[1], V16QImode); DONE; }")
(define_insn "*movv16qi_internal1"
! [(set (match_operand:V16QI 0 "nonimmediate_operand" "=m,v,v,o,r,r")
! (match_operand:V16QI 1 "input_operand" "v,m,v,r,o,r"))]
"TARGET_ALTIVEC"
"@
stvx %1,%y0
***************
*** 14042,14049 ****
"{ rs6000_emit_move (operands[0], operands[1], V4SFmode); DONE; }")
(define_insn "*movv4sf_internal1"
! [(set (match_operand:V4SF 0 "nonimmediate_operand" "=m,v,v,m,r,r")
! (match_operand:V4SF 1 "input_operand" "v,m,v,r,m,r"))]
"TARGET_ALTIVEC"
"@
stvx %1,%y0
--- 14042,14049 ----
"{ rs6000_emit_move (operands[0], operands[1], V4SFmode); DONE; }")
(define_insn "*movv4sf_internal1"
! [(set (match_operand:V4SF 0 "nonimmediate_operand" "=m,v,v,o,r,r")
! (match_operand:V4SF 1 "input_operand" "v,m,v,r,o,r"))]
"TARGET_ALTIVEC"
"@
stvx %1,%y0