• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; Show that we know how to translate vdiv.
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
23define internal float @testVdivFloat(float %v1, float %v2) {
24; ASM-LABEL: testVdivFloat:
25; DIS-LABEL: 00000000 <testVdivFloat>:
26; IASM-LABEL: testVdivFloat:
27
28entry:
29; ASM-NEXT: .LtestVdivFloat$entry:
30; IASM-NEXT: .LtestVdivFloat$entry:
31
32  %res = fdiv float %v1, %v2
33
34; ASM-NEXT:     vdiv.f32        s0, s0, s1
35; DIS-NEXT:    0:       ee800a20
36; IASM-NEXT:    .byte 0x20
37; IASM-NEXT:    .byte 0xa
38; IASM-NEXT:    .byte 0x80
39; IASM-NEXT:    .byte 0xee
40
41  ret float %res
42}
43
44define internal double @testVdivDouble(double %v1, double %v2) {
45; ASM-LABEL: testVdivDouble:
46; DIS-LABEL: 00000010 <testVdivDouble>:
47; IASM-LABEL: testVdivDouble:
48
49entry:
50; ASM-NEXT: .LtestVdivDouble$entry:
51; IASM-NEXT: .LtestVdivDouble$entry:
52
53  %res = fdiv double %v1, %v2
54
55; ASM-NEXT:     vdiv.f64        d0, d0, d1
56; DIS-NEXT:   10:       ee800b01
57; IASM-NEXT:    .byte 0x1
58; IASM-NEXT:    .byte 0xb
59; IASM-NEXT:    .byte 0x80
60; IASM-NEXT:    .byte 0xee
61
62  ret double %res
63}
64