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
76 lines
1.7 KiB
LLVM
76 lines
1.7 KiB
LLVM
; RUN: llc < %s -march=xcore | FileCheck %s
|
|
%0 = type { i32, i32 }
|
|
|
|
declare i32 @llvm.xcore.bitrev(i32)
|
|
declare i32 @llvm.xcore.crc32(i32, i32, i32)
|
|
declare %0 @llvm.xcore.crc8(i32, i32, i32)
|
|
declare i32 @llvm.xcore.zext(i32, i32)
|
|
declare i32 @llvm.xcore.sext(i32, i32)
|
|
declare i32 @llvm.xcore.geted()
|
|
declare i32 @llvm.xcore.getet()
|
|
|
|
define i32 @bitrev(i32 %val) {
|
|
; CHECK-LABEL: bitrev:
|
|
; CHECK: bitrev r0, r0
|
|
%result = call i32 @llvm.xcore.bitrev(i32 %val)
|
|
ret i32 %result
|
|
}
|
|
|
|
define i32 @crc32(i32 %crc, i32 %data, i32 %poly) {
|
|
; CHECK-LABEL: crc32:
|
|
; CHECK: crc32 r0, r1, r2
|
|
%result = call i32 @llvm.xcore.crc32(i32 %crc, i32 %data, i32 %poly)
|
|
ret i32 %result
|
|
}
|
|
|
|
define %0 @crc8(i32 %crc, i32 %data, i32 %poly) {
|
|
; CHECK-LABEL: crc8:
|
|
; CHECK: crc8 r0, r1, r1, r2
|
|
%result = call %0 @llvm.xcore.crc8(i32 %crc, i32 %data, i32 %poly)
|
|
ret %0 %result
|
|
}
|
|
|
|
define i32 @zext(i32 %a, i32 %b) {
|
|
; CHECK-LABEL: zext:
|
|
; CHECK: zext r0, r1
|
|
%result = call i32 @llvm.xcore.zext(i32 %a, i32 %b)
|
|
ret i32 %result
|
|
}
|
|
|
|
define i32 @zexti(i32 %a) {
|
|
; CHECK-LABEL: zexti:
|
|
; CHECK: zext r0, 4
|
|
%result = call i32 @llvm.xcore.zext(i32 %a, i32 4)
|
|
ret i32 %result
|
|
}
|
|
|
|
define i32 @sext(i32 %a, i32 %b) {
|
|
; CHECK-LABEL: sext:
|
|
; CHECK: sext r0, r1
|
|
%result = call i32 @llvm.xcore.sext(i32 %a, i32 %b)
|
|
ret i32 %result
|
|
}
|
|
|
|
define i32 @sexti(i32 %a) {
|
|
; CHECK-LABEL: sexti:
|
|
; CHECK: sext r0, 4
|
|
%result = call i32 @llvm.xcore.sext(i32 %a, i32 4)
|
|
ret i32 %result
|
|
}
|
|
|
|
define i32 @geted() {
|
|
; CHECK-LABEL: geted:
|
|
; CHECK: get r11, ed
|
|
; CHECK-NEXT: mov r0, r11
|
|
%result = call i32 @llvm.xcore.geted()
|
|
ret i32 %result
|
|
}
|
|
|
|
define i32 @getet() {
|
|
; CHECK-LABEL: getet:
|
|
; CHECK: get r11, et
|
|
; CHECK-NEXT: mov r0, r11
|
|
%result = call i32 @llvm.xcore.getet()
|
|
ret i32 %result
|
|
}
|