mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-22 07:32:48 +00:00
8b2b8a1835
This update was done with the following bash script: find test/CodeGen -name "*.ll" | \ while read NAME; do echo "$NAME" if ! grep -q "^; *RUN: *llc.*debug" $NAME; then TEMP=`mktemp -t temp` cp $NAME $TEMP sed -n "s/^define [^@]*@\([A-Za-z0-9_]*\)(.*$/\1/p" < $NAME | \ while read FUNC; do sed -i '' "s/;\(.*\)\([A-Za-z0-9_-]*\):\( *\)$FUNC: *\$/;\1\2-LABEL:\3$FUNC:/g" $TEMP done sed -i '' "s/;\(.*\)-LABEL-LABEL:/;\1-LABEL:/" $TEMP sed -i '' "s/;\(.*\)-NEXT-LABEL:/;\1-NEXT:/" $TEMP sed -i '' "s/;\(.*\)-NOT-LABEL:/;\1-NOT:/" $TEMP sed -i '' "s/;\(.*\)-DAG-LABEL:/;\1-DAG:/" $TEMP mv $TEMP $NAME fi done git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186280 91177308-0d34-0410-b5e6-96231b3b80d8
59 lines
1.1 KiB
LLVM
59 lines
1.1 KiB
LLVM
; Test indirect jumps.
|
|
;
|
|
; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
|
|
|
|
define i32 @f1(i32 %x, i32 %y, i32 %op) {
|
|
; CHECK-LABEL: f1:
|
|
; CHECK: ahi %r4, -1
|
|
; CHECK: clfi %r4, 5
|
|
; CHECK-NEXT: jh
|
|
; CHECK: llgfr [[OP64:%r[0-5]]], %r4
|
|
; CHECK: sllg [[INDEX:%r[1-5]]], [[OP64]], 3
|
|
; CHECK: larl [[BASE:%r[1-5]]]
|
|
; CHECK: lg [[TARGET:%r[1-5]]], 0([[BASE]],[[INDEX]])
|
|
; CHECK: br [[TARGET]]
|
|
entry:
|
|
switch i32 %op, label %exit [
|
|
i32 1, label %b.add
|
|
i32 2, label %b.sub
|
|
i32 3, label %b.and
|
|
i32 4, label %b.or
|
|
i32 5, label %b.xor
|
|
i32 6, label %b.mul
|
|
]
|
|
|
|
b.add:
|
|
%add = add i32 %x, %y
|
|
br label %exit
|
|
|
|
b.sub:
|
|
%sub = sub i32 %x, %y
|
|
br label %exit
|
|
|
|
b.and:
|
|
%and = and i32 %x, %y
|
|
br label %exit
|
|
|
|
b.or:
|
|
%or = or i32 %x, %y
|
|
br label %exit
|
|
|
|
b.xor:
|
|
%xor = xor i32 %x, %y
|
|
br label %exit
|
|
|
|
b.mul:
|
|
%mul = mul i32 %x, %y
|
|
br label %exit
|
|
|
|
exit:
|
|
%res = phi i32 [ %x, %entry ],
|
|
[ %add, %b.add ],
|
|
[ %sub, %b.sub ],
|
|
[ %and, %b.and ],
|
|
[ %or, %b.or ],
|
|
[ %xor, %b.xor ],
|
|
[ %mul, %b.mul ]
|
|
ret i32 %res
|
|
}
|