Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(679)

Unified Diff: tests_lit/assembler/arm32/vmov-f2i.ll

Issue 1647683002: Add vmov between integers and floats in ARM assembler. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix nits. Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceInstARM32.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests_lit/assembler/arm32/vmov-f2i.ll
diff --git a/tests_lit/assembler/arm32/vmov-f2i.ll b/tests_lit/assembler/arm32/vmov-f2i.ll
new file mode 100644
index 0000000000000000000000000000000000000000..c8b8504595898916a595fb381b0c3d0602048345
--- /dev/null
+++ b/tests_lit/assembler/arm32/vmov-f2i.ll
@@ -0,0 +1,124 @@
+; Show that we can move between float (S) and integer (GPR) registers.
+
+; REQUIRES: allow_dump
+
+; Compile using standalone assembler.
+; RUN: %p2i --filetype=asm -i %s --target=arm32 --args -Om1 \
+; RUN: --reg-use=s20,r5,r6 | FileCheck %s --check-prefix=ASM
+
+; Show bytes in assembled standalone code.
+; RUN: %p2i --filetype=asm -i %s --target=arm32 --assemble --disassemble \
+; RUN: --args -Om1 --reg-use=s20,r5,r6 | FileCheck %s --check-prefix=DIS
+
+; Compile using integrated assembler.
+; RUN: %p2i --filetype=iasm -i %s --target=arm32 --args -Om1 \
+; RUN: --reg-use=s20,r5,r6 \
+; RUN: | FileCheck %s --check-prefix=IASM
+
+; Show bytes in assembled integrated code.
+; RUN: %p2i --filetype=iasm -i %s --target=arm32 --assemble --disassemble \
+; RUN: --args -Om1 --reg-use=s20,r5,r6 | FileCheck %s --check-prefix=DIS
+
+define internal void @FloatToI1() {
+; ASM-LABEL: FloatToI1:
+; DIS-LABEL: {{.+}} <FloatToI1>:
+
+ %v = fptoui float 0.0 to i1
+
+; ASM: vmov r5, s20
+; DIS: {{.+}}: ee1a5a10
+; IASM-NOT: vmov
+
+ ret void
+}
+
+define internal void @FloatToI8() {
+; ASM-LABEL: FloatToI8:
+; DIS-LABEL: {{.+}} <FloatToI8>:
+
+ %v = fptoui float 0.0 to i8
+
+; ASM: vmov r5, s20
+; DIS: {{.+}}: ee1a5a10
+; IASM-NOT: vmov
+
+ ret void
+}
+
+define internal void @FloatToI16() {
+; ASM-LABEL: FloatToI16:
+; DIS-LABEL: {{.+}} <FloatToI16>:
+
+ %v = fptoui float 0.0 to i16
+
+; ASM: vmov r5, s20
+; DIS: {{.+}}: ee1a5a10
+; IASM-NOT: vmov
+
+ ret void
+}
+
+define internal void @FloatToI32() {
+; ASM-LABEL: FloatToI32:
+; DIS-LABEL: {{.+}} <FloatToI32>:
+
+ %v = fptoui float 0.0 to i32
+
+; ASM: vmov r5, s20
+; DIS: {{.+}}: ee1a5a10
+; IASM-NOT: vmov
+
+ ret void
+}
+
+define internal float @I1ToFloat() {
+; ASM-LABEL: I1ToFloat:
+; DIS-LABEL: {{.+}} <I1ToFloat>:
+
+ %v = uitofp i1 1 to float
+
+; ASM: vmov s20, r5
+; DIS: {{.+}}: ee0a5a10
+; IASM-NOT: vmov
+
+ ret float %v
+}
+
+define internal float @I8ToFloat() {
+; ASM-LABEL: I8ToFloat:
+; DIS-LABEL: {{.+}} <I8ToFloat>:
+
+ %v = uitofp i8 1 to float
+
+; ASM: vmov s20, r5
+; DIS: {{.+}}: ee0a5a10
+; IASM-NOT: vmov
+
+ ret float %v
+}
+
+define internal float @I16ToFloat() {
+; ASM-LABEL: I16ToFloat:
+; DIS-LABEL: {{.+}} <I16ToFloat>:
+
+ %v = uitofp i16 1 to float
+
+; ASM: vmov s20, r5
+; DIS: {{.+}}: ee0a5a10
+; IASM-NOT: vmov
+
+ ret float %v
+}
+
+define internal float @I32ToFloat() {
+; ASM-LABEL: I32ToFloat:
+; DIS-LABEL: {{.+}} <I32ToFloat>:
+
+ %v = uitofp i32 17 to float
+
+; ASM: vmov s20, r5
+; DIS: {{.+}}: ee0a5a10
+; IASM-NOT: vmov
+
+ ret float %v
+}
« no previous file with comments | « src/IceInstARM32.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698