• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; Show that we know how to translate (floating point) vldr.
2
3; REQUIRES: allow_dump
4
5; Compile using standalone assembler.
6; RUN: %p2i --filetype=asm -i %s --target=arm32 --args -O2 \
7; RUN:   -reg-use r5,s20,d20 \
8; RUN:   | FileCheck %s --check-prefix=ASM
9
10; Show bytes in assembled standalone code.
11; RUN: %p2i --filetype=asm -i %s --target=arm32 --assemble --disassemble \
12; RUN:   --args -O2 \
13; RUN:   -reg-use r5,s20,d20 \
14; RUN:   | FileCheck %s --check-prefix=DIS
15
16; Compile using integrated assembler.
17; RUN: %p2i --filetype=iasm -i %s --target=arm32 --args -O2 \
18; RUN:   -reg-use r5,s20,d20 \
19; RUN:   | FileCheck %s --check-prefix=IASM
20
21; Show bytes in assembled integrated code.
22; RUN: %p2i --filetype=iasm -i %s --target=arm32 --assemble --disassemble \
23; RUN:   --args -O2 \
24; RUN:   -reg-use r5,s20,d20 \
25; RUN:   | FileCheck %s --check-prefix=DIS
26
27define internal float @testFloat() {
28; ASM-LABEL: testFloat:
29; DIS-LABEL: 00000000 <testFloat>:
30
31entry:
32; ASM: .LtestFloat$entry:
33
34  %vaddr = inttoptr i32 0 to float*
35  %v = load float, float* %vaddr, align 1
36
37; ASM:  vldr    s20, [r5]
38; DIS:   c:    ed95aa00
39; IASM-NOT: vldr
40
41  ret float %v
42}
43
44define internal double @testDouble() {
45; ASM-LABEL: testDouble:
46; DIS-LABEL: 00000020 <testDouble>:
47
48entry:
49; ASM: .LtestDouble$entry:
50
51;  %vaddr = bitcast [8 x i8]* @doubleVal to double*
52  %vaddr = inttoptr i32 0 to double*
53  %v = load double, double* %vaddr, align 1
54
55; ASM:  vldr    d20, [r5]
56; DIS:   28:    edd54b00
57; IASM-NOT: vldr
58
59  ret double %v
60}
61