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

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
« no previous file with comments | « tests_lit/assembler/arm32/add.ll ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
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 ; REQUIRES: allow_dump 5 ; REQUIRES: allow_dump
7 6
8 ; RUN: %p2i --filetype=asm -i %s --target=arm32 --args -O2 \ 7 ; RUN: %p2i --filetype=asm -i %s --target=arm32 --args -O2 \
9 ; RUN: | FileCheck %s --check-prefix=ASM 8 ; RUN: | FileCheck %s --check-prefix=ASM
10 ; RUN: %p2i --filetype=iasm -i %s --target=arm32 --args -O2 \ 9 ; RUN: %p2i --filetype=iasm -i %s --target=arm32 --args -O2 \
11 ; RUN: | FileCheck %s --check-prefix=IASM 10 ; RUN: | FileCheck %s --check-prefix=IASM
12 11
13 define internal i32 @sub1FromR0(i32 %p) { 12 define internal i32 @sub1FromR0(i32 %p) {
14 %v = sub i32 %p, 1 13 %v = sub i32 %p, 1
15 ret i32 %v 14 ret i32 %v
16 } 15 }
17 16
18 ; ASM-LABEL: sub1FromR0: 17 ; ASM-LABEL: sub1FromR0:
19 ; ASM: sub r0, r0, #1 18 ; ASM: sub r0, r0, #1
20 ; ASM: bx lr 19 ; ASM: bx lr
21 20
22 ; IASM-LABEL: sub1FromR0: 21 ; IASM-LABEL: sub1FromR0:
23 ; IASM: .byte 0x1 22 ; IASM: .byte 0x1
24 ; IASM-NEXT: .byte 0x0 23 ; IASM-NEXT: .byte 0x0
25 ; IASM-NEXT: .byte 0x40 24 ; IASM-NEXT: .byte 0x40
26 ; IASM-NEXT: .byte 0xe2 25 ; IASM-NEXT: .byte 0xe2
27 26
27
28 define internal i32 @Sub2Regs(i32 %p1, i32 %p2) {
29 %v = sub i32 %p1, %p2
30 ret i32 %v
31 }
32
33 ; ASM-LABEL: Sub2Regs:
34 ; ASM: sub r0, r0, r1
35 ; ASM-NEXT: bx lr
36
37 ; IASM-LABEL: Sub2Regs:
38
39 ; IASM: .byte 0x1
40 ; IASM-NEXT: .byte 0x0
41 ; IASM-NEXT: .byte 0x40
42 ; IASM-NEXT: .byte 0xe0
43
OLDNEW
« no previous file with comments | « tests_lit/assembler/arm32/add.ll ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698