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

Unified Diff: tests_lit/assembler/arm32/vcvt_f32_f64.ll

Issue 1567623008: Add vcvt<c>.f32.f64 and vcvt<c>.f64.32 to ARM. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix nit and merge conflicts. 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/vcvt_f32_f64.ll
diff --git a/tests_lit/assembler/arm32/vcvt_f32_f64.ll b/tests_lit/assembler/arm32/vcvt_f32_f64.ll
new file mode 100644
index 0000000000000000000000000000000000000000..e3205883e87168bc77557dcfbd86c4907bf3708a
--- /dev/null
+++ b/tests_lit/assembler/arm32/vcvt_f32_f64.ll
@@ -0,0 +1,62 @@
+; Show that we know how to translate vcvt between float and double.
+
+; NOTE: We use -O2 to get rid of memory stores.
+
+; REQUIRES: allow_dump
+
+; Compile using standalone assembler.
+; RUN: %p2i --filetype=asm -i %s --target=arm32 --args -O2 \
+; RUN: | FileCheck %s --check-prefix=ASM
+
+; Show bytes in assembled standalone code.
+; RUN: %p2i --filetype=asm -i %s --target=arm32 --assemble --disassemble \
+; RUN: --args -O2 | FileCheck %s --check-prefix=DIS
+
+; Compile using integrated assembler.
+; RUN: %p2i --filetype=iasm -i %s --target=arm32 --args -O2 \
+; RUN: | FileCheck %s --check-prefix=IASM
+
+; Show bytes in assembled integrated code.
+; RUN: %p2i --filetype=iasm -i %s --target=arm32 --assemble --disassemble \
+; RUN: --args -O2 | FileCheck %s --check-prefix=DIS
+
+define internal double @testVcvtFloatToDouble(float %v) {
+; ASM-LABEL: testVcvtFloatToDouble:
+; DIS-LABEL: 00000000 <testVcvtFloatToDouble>:
+; IASM-LABEL: testVcvtFloatToDouble:
+
+entry:
+; ASM-NEXT: .LtestVcvtFloatToDouble$entry:
+; IASM-NEXT: .LtestVcvtFloatToDouble$entry:
+
+ %res = fpext float %v to double
+
+; ASM-NEXT: vcvt.f64.f32 d0, s0
+; DIS-NEXT: 0: eeb70ac0
+; IASM-NEXT: .byte 0xc0
+; IASM-NEXT: .byte 0xa
+; IASM-NEXT: .byte 0xb7
+; IASM-NEXT: .byte 0xee
+
+ ret double %res
+}
+
+define internal float @testVcvtDoubleToFloat(double %v) {
+; ASM-LABEL: testVcvtDoubleToFloat:
+; DIS-LABEL: 00000010 <testVcvtDoubleToFloat>:
+; IASM-LABEL: testVcvtDoubleToFloat:
+
+entry:
+; ASM-NEXT: .LtestVcvtDoubleToFloat$entry:
+; IASM-NEXT: .LtestVcvtDoubleToFloat$entry:
+
+ %res = fptrunc double %v to float
+; ASM-NEXT: vcvt.f32.f64 s0, d0
+; DIS-NEXT: 10: eeb70bc0
+; IASM-NEXT: .byte 0xc0
+; IASM-NEXT: .byte 0xb
+; IASM-NEXT: .byte 0xb7
+; IASM-NEXT: .byte 0xee
+
+ ret float %res
+}
« 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