2011-05-31 22:47:36 +08:00
|
|
|
; RUN: llc < %s -march=xcore | FileCheck %s
|
2011-06-01 00:24:49 +08:00
|
|
|
%0 = type { i32, i32 }
|
|
|
|
|
2011-05-31 22:47:36 +08:00
|
|
|
declare i32 @llvm.xcore.bitrev(i32)
|
|
|
|
declare i32 @llvm.xcore.crc32(i32, i32, i32)
|
2011-06-01 00:24:49 +08:00
|
|
|
declare %0 @llvm.xcore.crc8(i32, i32, i32)
|
2011-07-19 21:28:50 +08:00
|
|
|
declare i32 @llvm.xcore.zext(i32, i32)
|
|
|
|
declare i32 @llvm.xcore.sext(i32, i32)
|
2011-08-18 21:00:48 +08:00
|
|
|
declare i32 @llvm.xcore.geted()
|
|
|
|
declare i32 @llvm.xcore.getet()
|
2011-05-31 22:47:36 +08:00
|
|
|
|
|
|
|
define i32 @bitrev(i32 %val) {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: bitrev:
|
2011-05-31 22:47:36 +08:00
|
|
|
; CHECK: bitrev r0, r0
|
|
|
|
%result = call i32 @llvm.xcore.bitrev(i32 %val)
|
|
|
|
ret i32 %result
|
|
|
|
}
|
|
|
|
|
|
|
|
define i32 @crc32(i32 %crc, i32 %data, i32 %poly) {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: crc32:
|
2011-05-31 22:47:36 +08:00
|
|
|
; CHECK: crc32 r0, r1, r2
|
|
|
|
%result = call i32 @llvm.xcore.crc32(i32 %crc, i32 %data, i32 %poly)
|
|
|
|
ret i32 %result
|
|
|
|
}
|
2011-06-01 00:24:49 +08:00
|
|
|
|
|
|
|
define %0 @crc8(i32 %crc, i32 %data, i32 %poly) {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: crc8:
|
2011-06-01 00:24:49 +08:00
|
|
|
; CHECK: crc8 r0, r1, r1, r2
|
|
|
|
%result = call %0 @llvm.xcore.crc8(i32 %crc, i32 %data, i32 %poly)
|
|
|
|
ret %0 %result
|
|
|
|
}
|
2011-07-19 21:28:50 +08:00
|
|
|
|
|
|
|
define i32 @zext(i32 %a, i32 %b) {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: zext:
|
2011-07-19 21:28:50 +08:00
|
|
|
; CHECK: zext r0, r1
|
|
|
|
%result = call i32 @llvm.xcore.zext(i32 %a, i32 %b)
|
|
|
|
ret i32 %result
|
|
|
|
}
|
|
|
|
|
|
|
|
define i32 @zexti(i32 %a) {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: zexti:
|
2011-07-19 21:28:50 +08:00
|
|
|
; CHECK: zext r0, 4
|
|
|
|
%result = call i32 @llvm.xcore.zext(i32 %a, i32 4)
|
|
|
|
ret i32 %result
|
|
|
|
}
|
|
|
|
|
|
|
|
define i32 @sext(i32 %a, i32 %b) {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: sext:
|
2011-07-19 21:28:50 +08:00
|
|
|
; CHECK: sext r0, r1
|
|
|
|
%result = call i32 @llvm.xcore.sext(i32 %a, i32 %b)
|
|
|
|
ret i32 %result
|
|
|
|
}
|
|
|
|
|
|
|
|
define i32 @sexti(i32 %a) {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: sexti:
|
2011-07-19 21:28:50 +08:00
|
|
|
; CHECK: sext r0, 4
|
|
|
|
%result = call i32 @llvm.xcore.sext(i32 %a, i32 4)
|
|
|
|
ret i32 %result
|
|
|
|
}
|
2011-08-18 21:00:48 +08:00
|
|
|
|
|
|
|
define i32 @geted() {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: geted:
|
2011-08-18 21:00:48 +08:00
|
|
|
; CHECK: get r11, ed
|
|
|
|
; CHECK-NEXT: mov r0, r11
|
|
|
|
%result = call i32 @llvm.xcore.geted()
|
|
|
|
ret i32 %result
|
|
|
|
}
|
|
|
|
|
|
|
|
define i32 @getet() {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: getet:
|
2011-08-18 21:00:48 +08:00
|
|
|
; CHECK: get r11, et
|
|
|
|
; CHECK-NEXT: mov r0, r11
|
|
|
|
%result = call i32 @llvm.xcore.getet()
|
|
|
|
ret i32 %result
|
|
|
|
}
|