• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; Show that we know how to translate converting float to unsigned integer.
2
3; REQUIRES: allow_dump
4
5; Compile using standalone assembler.
6; RUN: %p2i --filetype=asm -i %s --target=arm32 --args -Om1 \
7; RUN:   --reg-use=s20 | FileCheck %s --check-prefix=ASM
8
9; Show bytes in assembled standalone code.
10; RUN: %p2i --filetype=asm -i %s --target=arm32 --assemble --disassemble \
11; RUN:   --args -Om1 --reg-use=s20  | FileCheck %s --check-prefix=DIS
12
13; Compile using integrated assembler.
14; RUN: %p2i --filetype=iasm -i %s --target=arm32 --args -Om1 \
15; RUN:   --reg-use=s20 \
16; RUN:   | FileCheck %s --check-prefix=IASM
17
18; Show bytes in assembled integrated code.
19; RUN: %p2i --filetype=iasm -i %s --target=arm32 --assemble --disassemble \
20; RUN:   --args -Om1 --reg-use=s20 | FileCheck %s --check-prefix=DIS
21
22define internal i32 @FloatToUnsignedInt() {
23; ASM-LABEL: FloatToUnsignedInt:
24; DIS-LABEL: 00000000 <FloatToUnsignedInt>:
25; IASM-LABEL: FloatToUnsignedInt:
26
27entry:
28; ASM-NEXT: .LFloatToUnsignedInt$entry:
29; IASM-NEXT: .LFloatToUnsignedInt$entry:
30
31  %v = fptoui float 0.0 to i32
32; ASM:  vcvt.u32.f32    s20, s20
33; DIS:   14:    eebcaaca
34; IASM-NOT: vcvt
35
36  ret i32 %v
37}
38
39define internal <4 x i32> @FloatVecToUIntVec(<4 x float> %a) {
40; ASM-LABEL: FloatVecToUIntVec:
41; DIS-LABEL: 00000030 <FloatVecToUIntVec>:
42; IASM-LABEL: FloatVecToUIntVec:
43
44  %v = fptoui <4 x float> %a to <4 x i32>
45
46; ASM:         vcvt.u32.f32    q0, q0
47; DIS:     40: f3bb07c0
48; IASM-NOT:    vcvt
49
50  ret <4 x i32> %v
51}
52