• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc < %s -march=xcore | FileCheck %s
3
4declare i8 @llvm.bitreverse.i8(i8)
5declare i16 @llvm.bitreverse.i16(i16)
6declare i32 @llvm.bitreverse.i32(i32)
7declare i64 @llvm.bitreverse.i64(i64)
8
9define i8 @bitrev8(i8 %x) nounwind {
10; CHECK-LABEL: bitrev8:
11; CHECK:       # %bb.0: # %entry
12; CHECK-NEXT:    bitrev r0, r0
13; CHECK-NEXT:    shr r0, r0, 24
14; CHECK-NEXT:    retsp 0
15; CHECK-NEXT:    .cc_bottom bitrev8.function
16entry:
17  %0 = call i8 @llvm.bitreverse.i8(i8 %x)
18  ret i8 %0
19}
20
21define i16 @bitrev16(i16 %x) nounwind {
22; CHECK-LABEL: bitrev16:
23; CHECK:       # %bb.0: # %entry
24; CHECK-NEXT:    bitrev r0, r0
25; CHECK-NEXT:    shr r0, r0, 16
26; CHECK-NEXT:    retsp 0
27; CHECK-NEXT:    .cc_bottom bitrev16.function
28entry:
29  %0 = call i16 @llvm.bitreverse.i16(i16 %x)
30  ret i16 %0
31}
32
33define i32 @bitrev32(i32 %x) nounwind {
34; CHECK-LABEL: bitrev32:
35; CHECK:       # %bb.0: # %entry
36; CHECK-NEXT:    bitrev r0, r0
37; CHECK-NEXT:    retsp 0
38; CHECK-NEXT:    .cc_bottom bitrev32.function
39entry:
40  %0 = call i32 @llvm.bitreverse.i32(i32 %x)
41  ret i32 %0
42}
43
44define i64 @bitrev64(i64 %x) nounwind {
45; CHECK-LABEL: bitrev64:
46; CHECK:       # %bb.0: # %entry
47; CHECK-NEXT:    bitrev r2, r1
48; CHECK-NEXT:    bitrev r1, r0
49; CHECK-NEXT:    mov r0, r2
50; CHECK-NEXT:    retsp 0
51; CHECK-NEXT:    .cc_bottom bitrev64.function
52entry:
53  %0 = call i64 @llvm.bitreverse.i64(i64 %x)
54  ret i64 %0
55}
56