mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
[SystemZ] Try to fold shifts into TMxx
E.g. "SRL %r2, 2; TMLL %r2, 1" => "TMLL %r2, 4". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190672 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -191,3 +191,43 @@ store:
|
||||
exit:
|
||||
ret void
|
||||
}
|
||||
|
||||
; Check that we can fold an SHL into a TMxx mask.
|
||||
define void @f11(i64 %a) {
|
||||
; CHECK-LABEL: f11:
|
||||
; CHECK: tmhl %r2, 32768
|
||||
; CHECK: jne {{\.L.*}}
|
||||
; CHECK: br %r14
|
||||
entry:
|
||||
%shl = shl i64 %a, 1
|
||||
%and = and i64 %shl, 281474976710656
|
||||
%cmp = icmp ne i64 %and, 0
|
||||
br i1 %cmp, label %exit, label %store
|
||||
|
||||
store:
|
||||
store i32 1, i32 *@g
|
||||
br label %exit
|
||||
|
||||
exit:
|
||||
ret void
|
||||
}
|
||||
|
||||
; Check that we can fold an SHR into a TMxx mask.
|
||||
define void @f12(i64 %a) {
|
||||
; CHECK-LABEL: f12:
|
||||
; CHECK: tmhh %r2, 256
|
||||
; CHECK: jne {{\.L.*}}
|
||||
; CHECK: br %r14
|
||||
entry:
|
||||
%shr = lshr i64 %a, 56
|
||||
%and = and i64 %shr, 1
|
||||
%cmp = icmp ne i64 %and, 0
|
||||
br i1 %cmp, label %exit, label %store
|
||||
|
||||
store:
|
||||
store i32 1, i32 *@g
|
||||
br label %exit
|
||||
|
||||
exit:
|
||||
ret void
|
||||
}
|
||||
|
Reference in New Issue
Block a user