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

Side by Side Diff: tests_lit/assembler/arm32/sub.ll

Issue 1411873002: emit add/sub registers instructions in integrated ARM assembler. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix nits. Created 5 years, 2 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 unified diff | Download patch
OLDNEW
1 ; Show that we know how to translate instruction sub. 1 ; Show that we know how to translate instruction sub.
2 ; TODO(kschimpf) Currently only know how to test subtract 1 from R0.
3 2
Jim Stichnoth 2015/10/16 21:30:09 ; REQUIRES: allow_dump
Karl 2015/10/17 20:00:41 Done.
4 ; NOTE: We use -O2 to get rid of memory stores. 3 ; NOTE: We use -O2 to get rid of memory stores.
5 4
6 ; RUN: %p2i --filetype=asm -i %s --target=arm32 --args -O2 \ 5 ; RUN: %p2i --filetype=asm -i %s --target=arm32 --args -O2 \
7 ; RUN: | FileCheck %s --check-prefix=ASM 6 ; RUN: | FileCheck %s --check-prefix=ASM
8 ; RUN: %p2i --filetype=iasm -i %s --target=arm32 --args -O2 \ 7 ; RUN: %p2i --filetype=iasm -i %s --target=arm32 --args -O2 \
9 ; RUN: | FileCheck %s --check-prefix=IASM 8 ; RUN: | FileCheck %s --check-prefix=IASM
10 9
11 define internal i32 @sub1FromR0(i32 %p) { 10 define internal i32 @sub1FromR0(i32 %p) {
12 %v = sub i32 %p, 1 11 %v = sub i32 %p, 1
13 ret i32 %v 12 ret i32 %v
14 } 13 }
15 14
16 ; ASM-LABEL: sub1FromR0: 15 ; ASM-LABEL: sub1FromR0:
17 ; ASM: sub r0, r0, #1 16 ; ASM: sub r0, r0, #1
18 ; ASM: bx lr 17 ; ASM: bx lr
19 18
20 ; IASM-LABEL: sub1FromR0: 19 ; IASM-LABEL: sub1FromR0:
21 ; IASM: .byte 0x1 20 ; IASM: .byte 0x1
22 ; IASM-NEXT: .byte 0x0 21 ; IASM-NEXT: .byte 0x0
23 ; IASM-NEXT: .byte 0x40 22 ; IASM-NEXT: .byte 0x40
24 ; IASM-NEXT: .byte 0xe2 23 ; IASM-NEXT: .byte 0xe2
25 24
25
26 define internal i32 @Sub2Regs(i32 %p1, i32 %p2) {
27 %v = sub i32 %p1, %p2
28 ret i32 %v
29 }
30
31 ; ASM-LABEL: Sub2Regs:
32 ; ASM: sub r0, r0, r1
33 ; ASM-NEXT: bx lr
34
35 ; IASM-LABEL: Sub2Regs:
36
37 ; IASM: .byte 0x1
38 ; IASM-NEXT: .byte 0x0
39 ; IASM-NEXT: .byte 0x40
40 ; IASM-NEXT: .byte 0xe0
41
OLDNEW
« tests_lit/assembler/arm32/add.ll ('K') | « tests_lit/assembler/arm32/add.ll ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698