• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; Show that we know how to translate rbit.
2
3; NOTE: We use -O2 to get rid of memory stores.
4
5; REQUIRES: allow_dump
6
7; Compile using standalone assembler.
8; RUN: %p2i --filetype=asm -i %s --target=arm32 --args -O2 \
9; RUN:   | FileCheck %s --check-prefix=ASM
10
11; Show bytes in assembled standalone code.
12; RUN: %p2i --filetype=asm -i %s --target=arm32 --assemble --disassemble \
13; RUN:   --args -O2 | FileCheck %s --check-prefix=DIS
14
15; Compile using integrated assembler.
16; RUN: %p2i --filetype=iasm -i %s --target=arm32 --args -O2 \
17; RUN:   | FileCheck %s --check-prefix=IASM
18
19; Show bytes in assembled integrated code.
20; RUN: %p2i --filetype=iasm -i %s --target=arm32 --assemble --disassemble \
21; RUN:   --args -O2 | FileCheck %s --check-prefix=DIS
22
23declare i32 @llvm.cttz.i32(i32, i1)
24
25define internal i32 @testRbit(i32 %a) {
26; ASM-LABEL: testRbit:
27; DIS-LABEL: 00000000 <testRbit>:
28; IASM-LABEL: testRbit:
29
30entry:
31; ASM-NEXT: .LtestRbit$entry:
32; IASM-NEXT: .LtestRbit$entry:
33
34  %x = call i32 @llvm.cttz.i32(i32 %a, i1 0)
35
36; ASM-NEXT:     rbit    r0, r0
37; DIS-NEXT:    0:       e6ff0f30
38; IASM-NEXT:    .byte 0x30
39; IASM-NEXT:    .byte 0xf
40; IASM-NEXT:    .byte 0xff
41; IASM-NEXT:    .byte 0xe6
42
43  ret i32 %x
44}
45