OLD | NEW |
1 ; Show that we know how to translate mul. | 1 ; Show that we know how to translate mul. |
2 | 2 |
3 ; NOTE: We use -O2 to get rid of memory stores. | 3 ; NOTE: We use -O2 to get rid of memory stores. |
4 | 4 |
5 ; REQUIRES: allow_dump | 5 ; REQUIRES: allow_dump |
6 | 6 |
7 ; Compile using standalone assembler. | 7 ; Compile using standalone assembler. |
8 ; RUN: %p2i --filetype=asm -i %s --target=arm32 --args -O2 \ | 8 ; RUN: %p2i --filetype=asm -i %s --target=arm32 --args -O2 \ |
9 ; RUN: | FileCheck %s --check-prefix=ASM | 9 ; RUN: | FileCheck %s --check-prefix=ASM |
10 | 10 |
11 ; Show bytes in assembled standalone code. | 11 ; Show bytes in assembled standalone code. |
12 ; RUN: %p2i --filetype=asm -i %s --target=arm32 --assemble --disassemble \ | 12 ; RUN: %p2i --filetype=asm -i %s --target=arm32 --assemble --disassemble \ |
13 ; RUN: --args -O2 | FileCheck %s --check-prefix=DIS | 13 ; RUN: --args -O2 | FileCheck %s --check-prefix=DIS |
14 | 14 |
15 ; Compile using integrated assembler. | 15 ; Compile using integrated assembler. |
16 ; RUN: %p2i --filetype=iasm -i %s --target=arm32 --args -O2 \ | 16 ; RUN: %p2i --filetype=iasm -i %s --target=arm32 --args -O2 \ |
17 ; RUN: | FileCheck %s --check-prefix=IASM | 17 ; RUN: | FileCheck %s --check-prefix=IASM |
18 | 18 |
19 ; Show bytes in assembled integrated code. | 19 ; Show bytes in assembled integrated code. |
20 ; RUN: %p2i --filetype=iasm -i %s --target=arm32 --assemble --disassemble \ | 20 ; RUN: %p2i --filetype=iasm -i %s --target=arm32 --assemble --disassemble \ |
21 ; RUN: --args -O2 | FileCheck %s --check-prefix=DIS | 21 ; RUN: --args -O2 | FileCheck %s --check-prefix=DIS |
22 | 22 |
23 define internal i32 @MulTwoRegs(i32 %a, i32 %b) { | 23 define internal i32 @MulTwoRegs(i32 %a, i32 %b) { |
24 %v = mul i32 %a, %b | 24 %v = mul i32 %a, %b |
25 ret i32 %v | 25 ret i32 %v |
26 } | 26 } |
27 | 27 |
28 ; ASM-LABEL:MulTwoRegs: | 28 ; ASM-LABEL:MulTwoRegs: |
29 ; ASM-NEXT:.LMulTwoRegs$__0: | 29 ; DIS-LABEL:<MulTwoRegs>: |
30 ; ASM-NEXT: mul r0, r0, r1 | 30 ; IASM-LABEL:MulTwoRegs: |
31 | 31 |
32 ; DIS-LABEL:00000000 <MulTwoRegs>: | 32 ; ASM: mul r0, r0, r1 |
33 ; DIS-NEXT: 0: e0000190 | 33 ; DIS: e0000190 |
34 | 34 ; IASM-NOT: mul |
35 ; IASM-LABEL:MulTwoRegs: | |
36 ; IASM-NEXT:.LMulTwoRegs$__0: | |
37 ; IASM-NEXT: .byte 0x90 | |
38 ; IASM-NEXT: .byte 0x1 | |
39 ; IASM-NEXT: .byte 0x0 | |
40 ; IASM-NEXT: .byte 0xe0 | |
41 | 35 |
42 define internal i64 @MulTwoI64Regs(i64 %a, i64 %b) { | 36 define internal i64 @MulTwoI64Regs(i64 %a, i64 %b) { |
43 %v = mul i64 %a, %b | 37 %v = mul i64 %a, %b |
44 ret i64 %v | 38 ret i64 %v |
45 } | 39 } |
46 | 40 |
47 ; ASM-LABEL:MulTwoI64Regs: | 41 ; ASM-LABEL:MulTwoI64Regs: |
48 ; ASM-NEXT:.LMulTwoI64Regs$__0: | 42 ; DIS-LABEL:<MulTwoI64Regs>: |
49 ; ASM-NEXT: mul r3, r0, r3 | 43 ; IASM-LABEL:MulTwoI64Regs: |
| 44 |
| 45 ; ASM: mul r3, r0, r3 |
50 ; ASM-NEXT: mla r1, r2, r1, r3 | 46 ; ASM-NEXT: mla r1, r2, r1, r3 |
51 ; ASM-NEXT: umull r0, r2, r0, r2 | 47 ; ASM-NEXT: umull r0, r2, r0, r2 |
52 ; ASM-NEXT: # r2 = def.pseudo r0 | 48 ; ASM-NEXT: # r2 = def.pseudo r0 |
| 49 ; ASM-NEXT: # r0 = def.pseudo r2 |
53 ; ASM-NEXT: add r2, r2, r1 | 50 ; ASM-NEXT: add r2, r2, r1 |
54 ; ASM-NEXT: mov r1, r2 | |
55 ; ASM-NEXT: bx lr | |
56 | 51 |
| 52 ; DIS: e0030390 |
| 53 ; DIS-NEXT: e0213192 |
| 54 ; DIS-NEXT: e0820290 |
| 55 ; DIS-NEXT: e0822001 |
57 | 56 |
58 ; DIS-LABEL:00000010 <MulTwoI64Regs>: | 57 ; IASM-NOT: mul |
59 ; DIS-NEXT: 10: e0030390 | 58 ; IASM-NOT: mla |
60 ; DIS-NEXT: 14: e0213192 | 59 ; IASM-NOT: umull |
61 ; DIS-NEXT: 18: e0820290 | 60 ; IASM-NOT: add |
62 ; DIS-NEXT: 1c: e0822001 | |
63 ; DIS-NEXT: 20: e1a01002 | |
64 ; DIS-NEXT: 24: e12fff1e | |
65 | |
66 ; IASM-LABEL:MulTwoI64Regs: | |
67 ; IASM-NEXT:.LMulTwoI64Regs$__0: | |
68 ; IASM-NEXT: .byte 0x90 | |
69 ; IASM-NEXT: .byte 0x3 | |
70 ; IASM-NEXT: .byte 0x3 | |
71 ; IASM-NEXT: .byte 0xe0 | |
72 | |
73 ; IASM-NEXT: .byte 0x92 | |
74 ; IASM-NEXT: .byte 0x31 | |
75 ; IASM-NEXT: .byte 0x21 | |
76 ; IASM-NEXT: .byte 0xe0 | |
77 | |
78 ; IASM-NEXT: .byte 0x90 | |
79 ; IASM-NEXT: .byte 0x2 | |
80 ; IASM-NEXT: .byte 0x82 | |
81 ; IASM-NEXT: .byte 0xe0 | |
82 | |
83 ; IASM-NEXT: .byte 0x1 | |
84 ; IASM-NEXT: .byte 0x20 | |
85 ; IASM-NEXT: .byte 0x82 | |
86 ; IASM-NEXT: .byte 0xe0 | |
87 | |
88 ; IASM-NEXT: .byte 0x2 | |
89 ; IASM-NEXT: .byte 0x10 | |
90 ; IASM-NEXT: .byte 0xa0 | |
91 ; IASM-NEXT: .byte 0xe1 | |
92 | |
93 ; IASM-NEXT: .byte 0x1e | |
94 ; IASM-NEXT: .byte 0xff | |
95 ; IASM-NEXT: .byte 0x2f | |
96 ; IASM-NEXT: .byte 0xe1 | |
OLD | NEW |