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

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

Issue 1657193003: Add FABS intrinsic to the integrated ARM assembler. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Format. 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/vabs.ll
diff --git a/tests_lit/assembler/arm32/vabs.ll b/tests_lit/assembler/arm32/vabs.ll
new file mode 100644
index 0000000000000000000000000000000000000000..695e3567745ec0286ebe09f2bedb7431bdc56634
--- /dev/null
+++ b/tests_lit/assembler/arm32/vabs.ll
@@ -0,0 +1,58 @@
+; Show that we translate intrinsics for fabs on float and double.
+
+; REQUIRES: allow_dump
+
+; Compile using standalone assembler.
+; RUN: %p2i --filetype=asm -i %s --target=arm32 --args -Om1 \
+; RUN: -reg-use s20,d22 \
+; RUN: | FileCheck %s --check-prefix=ASM
+
+; Show bytes in assembled standalone code.
+; RUN: %p2i --filetype=asm -i %s --target=arm32 --assemble --disassemble \
+; RUN: --args -Om1 \
+; RUN: -reg-use s20,d22 \
+; RUN: | FileCheck %s --check-prefix=DIS
+
+; Compile using integrated assembler.
+; RUN: %p2i --filetype=iasm -i %s --target=arm32 --args -Om1 \
+; RUN: -reg-use s20,d22 \
+; 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 \
+; RUN: -reg-use s20,d22 \
+; RUN: | FileCheck %s --check-prefix=DIS
+
+declare float @llvm.fabs.f32(float)
+declare double @llvm.fabs.f64(double)
+
+define internal float @test_fabs_float(float %x) {
+; ASM-LABEL: test_fabs_float:
+; DIS-LABEL: 00000000 <test_fabs_float>:
+; IASM-LABEL: test_fabs_float:
+
+entry:
+ %r = call float @llvm.fabs.f32(float %x)
+
+; ASM: vabs.f32 s20, s20
+; DIS: 10: eeb0aaca
+; IASM-NOT: vabs.f32
+
+ ret float %r
+}
+
+define internal double @test_fabs_double(double %x) {
+; ASM-LABEL: test_fabs_double:
+; DIS-LABEL: 00000030 <test_fabs_double>:
+; IASM-LABEL: test_fabs_double:
+
+entry:
+ %r = call double @llvm.fabs.f64(double %x)
+
+; ASM: vabs.f64 d22, d22
+; DIS: 3c: eef06be6
+; IASM-NOT: vabs.64
+
+ ret double %r
+}
« 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