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

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

Issue 1647113003: Add VSQRT instruction to the integrated ARM assembler. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Update DART files. 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
« src/IceInstARM32.cpp ('K') | « 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/vsqrt.ll
diff --git a/tests_lit/assembler/arm32/vsqrt.ll b/tests_lit/assembler/arm32/vsqrt.ll
new file mode 100644
index 0000000000000000000000000000000000000000..a9408d2bfbe4a4df71bc77c124bc1c90ae8a86ff
--- /dev/null
+++ b/tests_lit/assembler/arm32/vsqrt.ll
@@ -0,0 +1,52 @@
+; Show that we can translate intrinsic vsqrt into a binary instruction.
+
+; REQUIRES: allow_dump
+
+; Compile using standalone assembler.
+; RUN: %p2i --filetype=asm -i %s --target=arm32 --args -Om1 -allow-extern \
+; RUN: -reg-use s20,d20 | FileCheck %s --check-prefix=ASM
+
+; Show bytes in assembled standalone code.
+; RUN: %p2i --filetype=asm -i %s --target=arm32 --assemble --disassemble \
+; RUN: --args -Om1 -allow-extern -reg-use s20,d20 \
+; RUN: | FileCheck %s --check-prefix=DIS
+
+; Compile using integrated assembler.
+; RUN: %p2i --filetype=iasm -i %s --target=arm32 --args -Om1 -allow-extern \
+; RUN: -reg-use s20,d20 | FileCheck %s --check-prefix=IASM
+
+; Show bytes in assembled integrated code.
+; RUN: %p2i --filetype=iasm -i %s --target=arm32 --assemble --disassemble \
+; RUN: --args -Om1 -allow-extern -reg-use s20,d20 \
+; RUN: | FileCheck %s --check-prefix=DIS
+
+declare float @llvm.sqrt.f32(float)
+declare double @llvm.sqrt.f64(double)
+
+define internal float @sqrtFloat() {
+; ASM-LABEL: sqrtFloat:
+; DIS-LABEL: 00000000 <sqrtFloat>:
+; IASM-LABEL: sqrtFloat:
+
+ %v = call float @llvm.sqrt.f32(float 0.5);
+
+; ASM: vsqrt.f32 s20, s20
+; DIS: c: eeb1aaca
+; IASM-NOT: vsqrt.f32
+
+ ret float %v
+}
+
+define internal double @sqrtDouble() {
+; ASM-LABEL: sqrtDouble:
+; DIS-LABEL: 00000030 <sqrtDouble>:
+; IASM-LABEL: sqrtDouble:
+
+ %v = call double @llvm.sqrt.f64(double 0.5);
+
+; ASM: vsqrt.f64 d20, d20
+; DIS: 38: eef14be4
+; IASM-NOT: vsqrt.f64
+
+ ret double %v
+}
« src/IceInstARM32.cpp ('K') | « src/IceInstARM32.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698