mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +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
160 lines
3.6 KiB
LLVM
160 lines
3.6 KiB
LLVM
; Test all condition-code masks that are relevant for CGRJ.
|
|
;
|
|
; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
|
|
|
|
declare i64 @foo()
|
|
|
|
; Test EQ.
|
|
define void @f1(i64 %target) {
|
|
; CHECK-LABEL: f1:
|
|
; CHECK: .cfi_def_cfa_offset
|
|
; CHECK: .L[[LABEL:.*]]:
|
|
; CHECK: cgrje %r2, {{%r[0-9]+}}, .L[[LABEL]]
|
|
br label %loop
|
|
loop:
|
|
%val = call i64 @foo()
|
|
%cond = icmp eq i64 %val, %target
|
|
br i1 %cond, label %loop, label %exit
|
|
exit:
|
|
ret void
|
|
}
|
|
|
|
; Test NE.
|
|
define void @f2(i64 %target) {
|
|
; CHECK-LABEL: f2:
|
|
; CHECK: .cfi_def_cfa_offset
|
|
; CHECK: .L[[LABEL:.*]]:
|
|
; CHECK: cgrjlh %r2, {{%r[0-9]+}}, .L[[LABEL]]
|
|
br label %loop
|
|
loop:
|
|
%val = call i64 @foo()
|
|
%cond = icmp ne i64 %val, %target
|
|
br i1 %cond, label %loop, label %exit
|
|
exit:
|
|
ret void
|
|
}
|
|
|
|
; Test SLE.
|
|
define void @f3(i64 %target) {
|
|
; CHECK-LABEL: f3:
|
|
; CHECK: .cfi_def_cfa_offset
|
|
; CHECK: .L[[LABEL:.*]]:
|
|
; CHECK: cgrjle %r2, {{%r[0-9]+}}, .L[[LABEL]]
|
|
br label %loop
|
|
loop:
|
|
%val = call i64 @foo()
|
|
%cond = icmp sle i64 %val, %target
|
|
br i1 %cond, label %loop, label %exit
|
|
exit:
|
|
ret void
|
|
}
|
|
|
|
; Test SLT.
|
|
define void @f4(i64 %target) {
|
|
; CHECK-LABEL: f4:
|
|
; CHECK: .cfi_def_cfa_offset
|
|
; CHECK: .L[[LABEL:.*]]:
|
|
; CHECK: cgrjl %r2, {{%r[0-9]+}}, .L[[LABEL]]
|
|
br label %loop
|
|
loop:
|
|
%val = call i64 @foo()
|
|
%cond = icmp slt i64 %val, %target
|
|
br i1 %cond, label %loop, label %exit
|
|
exit:
|
|
ret void
|
|
}
|
|
|
|
; Test SGT.
|
|
define void @f5(i64 %target) {
|
|
; CHECK-LABEL: f5:
|
|
; CHECK: .cfi_def_cfa_offset
|
|
; CHECK: .L[[LABEL:.*]]:
|
|
; CHECK: cgrjh %r2, {{%r[0-9]+}}, .L[[LABEL]]
|
|
br label %loop
|
|
loop:
|
|
%val = call i64 @foo()
|
|
%cond = icmp sgt i64 %val, %target
|
|
br i1 %cond, label %loop, label %exit
|
|
exit:
|
|
ret void
|
|
}
|
|
|
|
; Test SGE.
|
|
define void @f6(i64 %target) {
|
|
; CHECK-LABEL: f6:
|
|
; CHECK: .cfi_def_cfa_offset
|
|
; CHECK: .L[[LABEL:.*]]:
|
|
; CHECK: cgrjhe %r2, {{%r[0-9]+}}, .L[[LABEL]]
|
|
br label %loop
|
|
loop:
|
|
%val = call i64 @foo()
|
|
%cond = icmp sge i64 %val, %target
|
|
br i1 %cond, label %loop, label %exit
|
|
exit:
|
|
ret void
|
|
}
|
|
|
|
; Test a vector of 0/-1 results for i32 EQ.
|
|
define i64 @f7(i64 %a, i64 %b) {
|
|
; CHECK-LABEL: f7:
|
|
; CHECK: lhi [[REG:%r[0-5]]], -1
|
|
; CHECK: crje {{%r[0-5]}}
|
|
; CHECK: lhi [[REG]], 0
|
|
; CHECK-NOT: sra
|
|
; CHECK: br %r14
|
|
%avec = bitcast i64 %a to <2 x i32>
|
|
%bvec = bitcast i64 %b to <2 x i32>
|
|
%cmp = icmp eq <2 x i32> %avec, %bvec
|
|
%ext = sext <2 x i1> %cmp to <2 x i32>
|
|
%ret = bitcast <2 x i32> %ext to i64
|
|
ret i64 %ret
|
|
}
|
|
|
|
; Test a vector of 0/-1 results for i32 NE.
|
|
define i64 @f8(i64 %a, i64 %b) {
|
|
; CHECK-LABEL: f8:
|
|
; CHECK: lhi [[REG:%r[0-5]]], -1
|
|
; CHECK: crjlh {{%r[0-5]}}
|
|
; CHECK: lhi [[REG]], 0
|
|
; CHECK-NOT: sra
|
|
; CHECK: br %r14
|
|
%avec = bitcast i64 %a to <2 x i32>
|
|
%bvec = bitcast i64 %b to <2 x i32>
|
|
%cmp = icmp ne <2 x i32> %avec, %bvec
|
|
%ext = sext <2 x i1> %cmp to <2 x i32>
|
|
%ret = bitcast <2 x i32> %ext to i64
|
|
ret i64 %ret
|
|
}
|
|
|
|
; Test a vector of 0/-1 results for i64 EQ.
|
|
define void @f9(i64 %a, i64 %b, <2 x i64> *%dest) {
|
|
; CHECK-LABEL: f9:
|
|
; CHECK: lghi [[REG:%r[0-5]]], -1
|
|
; CHECK: crje {{%r[0-5]}}
|
|
; CHECK: lghi [[REG]], 0
|
|
; CHECK-NOT: sra
|
|
; CHECK: br %r14
|
|
%avec = bitcast i64 %a to <2 x i32>
|
|
%bvec = bitcast i64 %b to <2 x i32>
|
|
%cmp = icmp eq <2 x i32> %avec, %bvec
|
|
%ext = sext <2 x i1> %cmp to <2 x i64>
|
|
store <2 x i64> %ext, <2 x i64> *%dest
|
|
ret void
|
|
}
|
|
|
|
; Test a vector of 0/-1 results for i64 NE.
|
|
define void @f10(i64 %a, i64 %b, <2 x i64> *%dest) {
|
|
; CHECK-LABEL: f10:
|
|
; CHECK: lghi [[REG:%r[0-5]]], -1
|
|
; CHECK: crjlh {{%r[0-5]}}
|
|
; CHECK: lghi [[REG]], 0
|
|
; CHECK-NOT: sra
|
|
; CHECK: br %r14
|
|
%avec = bitcast i64 %a to <2 x i32>
|
|
%bvec = bitcast i64 %b to <2 x i32>
|
|
%cmp = icmp ne <2 x i32> %avec, %bvec
|
|
%ext = sext <2 x i1> %cmp to <2 x i64>
|
|
store <2 x i64> %ext, <2 x i64> *%dest
|
|
ret void
|
|
}
|