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

Unified Diff: tests_lit/assembler/arm32/mov-reg.ll

Issue 1516063002: Add some missing encodings in the ARM integrated assembler. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Clean up CL. 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
Index: tests_lit/assembler/arm32/mov-reg.ll
diff --git a/tests_lit/assembler/arm32/mov-reg.ll b/tests_lit/assembler/arm32/mov-reg.ll
new file mode 100644
index 0000000000000000000000000000000000000000..e0fc5d4797489a6f96a644d2c2719a828db8ddc9
--- /dev/null
+++ b/tests_lit/assembler/arm32/mov-reg.ll
@@ -0,0 +1,54 @@
+; Show that we know how to translate mov (shifted register), which
+; are pseudo instructions for ASR, LSR, ROR, and RRX.
+
+; 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 i64 @_Z4castIaxET0_T_(i32 %a) {
Jim Stichnoth 2015/12/11 16:53:45 Friendlier function name?
Karl 2015/12/11 17:42:16 Done.
+; ASM-LABEL:_Z4castIaxET0_T_:
+; DIS-LABEL:00000000 <_Z4castIaxET0_T_>:
+; IASM-LABEL:_Z4castIaxET0_T_:
+
+entry:
+; ASM-NEXT:.L_Z4castIaxET0_T_$entry:
+; IASM-NEXT:.L_Z4castIaxET0_T_$entry:
+
+ %a.arg_trunc = trunc i32 %a to i8
+ %conv = sext i8 %a.arg_trunc to i64
+ ret i64 %conv
+
+; ASM-NEXT: sxtb r0, r0
+; DIS-NEXT: 0: e6af0070
+; IASM-NEXT: .byte 0x70
+; IASM-NEXT: .byte 0x0
+; IASM-NEXT: .byte 0xaf
+; IASM-NEXT: .byte 0xe6
+
+; ***** Example of mov pseudo instruction.
+; ASM-NEXT: mov r1, r0, asr #31
+; DIS-NEXT: 4: e1a01fc0
+; IASM-NEXT: .byte 0xc0
+; IASM-NEXT: .byte 0x1f
+; IASM-NEXT: .byte 0xa0
+; IASM-NEXT: .byte 0xe1
+
+; ASM-NEXT: bx lr
+
+}

Powered by Google App Engine
This is Rietveld 408576698