1 ; RUN: llc < %s -march=xcore | FileCheck %s 2 %0 = type { i32, i32 } 3 4 declare i32 @llvm.xcore.bitrev(i32) 5 declare i32 @llvm.xcore.crc32(i32, i32, i32) 6 declare %0 @llvm.xcore.crc8(i32, i32, i32) 7 declare i32 @llvm.xcore.zext(i32, i32) 8 declare i32 @llvm.xcore.sext(i32, i32) 9 declare i32 @llvm.xcore.geted() 10 declare i32 @llvm.xcore.getet() 11 12 define i32 @bitrev(i32 %val) { 13 ; CHECK: bitrev: 14 ; CHECK: bitrev r0, r0 15 %result = call i32 @llvm.xcore.bitrev(i32 %val) 16 ret i32 %result 17 } 18 19 define i32 @crc32(i32 %crc, i32 %data, i32 %poly) { 20 ; CHECK: crc32: 21 ; CHECK: crc32 r0, r1, r2 22 %result = call i32 @llvm.xcore.crc32(i32 %crc, i32 %data, i32 %poly) 23 ret i32 %result 24 } 25 26 define %0 @crc8(i32 %crc, i32 %data, i32 %poly) { 27 ; CHECK: crc8: 28 ; CHECK: crc8 r0, r1, r1, r2 29 %result = call %0 @llvm.xcore.crc8(i32 %crc, i32 %data, i32 %poly) 30 ret %0 %result 31 } 32 33 define i32 @zext(i32 %a, i32 %b) { 34 ; CHECK: zext: 35 ; CHECK: zext r0, r1 36 %result = call i32 @llvm.xcore.zext(i32 %a, i32 %b) 37 ret i32 %result 38 } 39 40 define i32 @zexti(i32 %a) { 41 ; CHECK: zexti: 42 ; CHECK: zext r0, 4 43 %result = call i32 @llvm.xcore.zext(i32 %a, i32 4) 44 ret i32 %result 45 } 46 47 define i32 @sext(i32 %a, i32 %b) { 48 ; CHECK: sext: 49 ; CHECK: sext r0, r1 50 %result = call i32 @llvm.xcore.sext(i32 %a, i32 %b) 51 ret i32 %result 52 } 53 54 define i32 @sexti(i32 %a) { 55 ; CHECK: sexti: 56 ; CHECK: sext r0, 4 57 %result = call i32 @llvm.xcore.sext(i32 %a, i32 4) 58 ret i32 %result 59 } 60 61 define i32 @geted() { 62 ; CHECK: geted: 63 ; CHECK: get r11, ed 64 ; CHECK-NEXT: mov r0, r11 65 %result = call i32 @llvm.xcore.geted() 66 ret i32 %result 67 } 68 69 define i32 @getet() { 70 ; CHECK: getet: 71 ; CHECK: get r11, et 72 ; CHECK-NEXT: mov r0, r11 73 %result = call i32 @llvm.xcore.getet() 74 ret i32 %result 75 } 76