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

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

Issue 1509243002: Add ASR instruction to the ARM integrated assembler. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 5 years 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/asr.ll
diff --git a/tests_lit/assembler/arm32/asr.ll b/tests_lit/assembler/arm32/asr.ll
new file mode 100644
index 0000000000000000000000000000000000000000..d728f438786259e60c7a040b80d0feef7bf25937
--- /dev/null
+++ b/tests_lit/assembler/arm32/asr.ll
@@ -0,0 +1,63 @@
+; Show that we know how to translate asr
+
+; 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 i32 @AshrAmt(i32 %a) {
+; ASM-LABEL:AshrAmt:
+; DIS-LABEL:00000000 <AshrAmt>:
+; IASM-LABEL:AshrAmt:
+
+entry:
+; ASM-NEXT:.LAshrAmt$entry:
+; IASM-NEXT:.LAshrAmt$entry:
+
+ %v = ashr i32 %a, 23
+
+; ASM-NEXT: asr r0, r0, #23
+; DIS-NEXT: 0: e1a00bc0
+; IASM-NEXT: .byte 0xc0
+; IASM-NEXT: .byte 0xb
+; IASM-NEXT: .byte 0xa0
+; IASM-NEXT: .byte 0xe1
+
+ ret i32 %v
+}
+
+define internal i32 @AshrReg(i32 %a, i32 %b) {
+; ASM-LABEL:AshrReg:
+; DIS-LABEL:00000010 <AshrReg>:
+; IASM-LABEL:AshrReg:
+
+entry:
+; ASM-NEXT:.LAshrReg$entry:
+; IASM-NEXT:.LAshrReg$entry:
+
+ %v = ashr i32 %a, %b
+
+; ASM-NEXT: asr r0, r0, r1
+; DIS-NEXT: 10: e1a00150
+; IASM-NEXT: .byte 0x50
+; IASM-NEXT: .byte 0x1
+; IASM-NEXT: .byte 0xa0
+; IASM-NEXT: .byte 0xe1
+
+ ret i32 %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