mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
[SystemZ] Postpone NI->RISBG conversion to convertToThreeAddress()
r186399 aggressively used the RISBG instruction for immediate ANDs, both because it can handle some values that AND IMMEDIATE can't, and because it allows the destination register to be different from the source. I realized later while implementing the distinct-ops support that it would be better to leave the choice up to convertToThreeAddress() instead. The AND IMMEDIATE form is shorter and is less likely to be cracked. This is a problem for 32-bit ANDs because we assume that all 32-bit operations will leave the high word untouched, whereas RISBG used in this way will either clear the high word or copy it from the source register. The patch uses the z196 instruction RISBLG for this instead. This means that z10 will be restricted to NILL, NILH and NILF for 32-bit ANDs, but I think that should be OK for now. Although we're using z10 as the base architecture, the optimization work is going to be focused more on z196 and zEC12. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187492 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -12,16 +12,16 @@
|
||||
; which shift %r3 left so that %b is at the high end of the word).
|
||||
define i16 @f1(i16 %dummy, i16 *%src, i16 %cmp, i16 %swap) {
|
||||
; CHECK-MAIN-LABEL: f1:
|
||||
; CHECK-MAIN-DAG: sllg [[SHIFT:%r[1-9]+]], %r3, 3
|
||||
; CHECK-MAIN-DAG: risbg [[BASE:%r[1-9]+]], %r3, 0, 189, 0
|
||||
; CHECK-MAIN: l [[OLD:%r[0-9]+]], 0([[BASE]])
|
||||
; CHECK-MAIN: sllg [[SHIFT:%r[1-9]+]], %r3, 3
|
||||
; CHECK-MAIN: nill %r3, 65532
|
||||
; CHECK-MAIN: l [[OLD:%r[0-9]+]], 0(%r3)
|
||||
; CHECK-MAIN: [[LOOP:\.[^ ]*]]:
|
||||
; CHECK-MAIN: rll %r2, [[OLD]], 16([[SHIFT]])
|
||||
; CHECK-MAIN: risbg %r4, %r2, 32, 47, 0
|
||||
; CHECK-MAIN: crjlh %r2, %r4, [[EXIT:\.[^ ]*]]
|
||||
; CHECK-MAIN: risbg %r5, %r2, 32, 47, 0
|
||||
; CHECK-MAIN: rll [[NEW:%r[0-9]+]], %r5, -16({{%r[1-9]+}})
|
||||
; CHECK-MAIN: cs [[OLD]], [[NEW]], 0([[BASE]])
|
||||
; CHECK-MAIN: cs [[OLD]], [[NEW]], 0(%r3)
|
||||
; CHECK-MAIN: jlh [[LOOP]]
|
||||
; CHECK-MAIN: [[EXIT]]:
|
||||
; CHECK-MAIN-NOT: %r2
|
||||
|
Reference in New Issue
Block a user