OLD | NEW |
(Empty) | |
| 1 ; Show that we know how to encode the dmb instruction. |
| 2 |
| 3 ; REQUIRES: allow_dump |
| 4 |
| 5 ; Compile using standalone assembler. |
| 6 ; RUN: %p2i --filetype=asm -i %s --target=arm32 --args -Om1 \ |
| 7 ; RUN: | FileCheck %s --check-prefix=ASM |
| 8 |
| 9 ; Show bytes in assembled standalone code. |
| 10 ; RUN: %p2i --filetype=asm -i %s --target=arm32 --assemble --disassemble \ |
| 11 ; RUN: --args -Om1 | FileCheck %s --check-prefix=DIS |
| 12 |
| 13 ; Compile using integrated assembler. |
| 14 ; RUN: %p2i --filetype=iasm -i %s --target=arm32 --args -Om1 \ |
| 15 ; RUN: | FileCheck %s --check-prefix=IASM |
| 16 |
| 17 ; Show bytes in assembled integrated code. |
| 18 ; RUN: %p2i --filetype=iasm -i %s --target=arm32 --assemble --disassemble \ |
| 19 ; RUN: --args -Om1 | FileCheck %s --check-prefix=DIS |
| 20 |
| 21 declare i8 @llvm.nacl.atomic.load.i8(i8*, i32) |
| 22 |
| 23 define internal i32 @test_atomic_load_8(i32 %iptr) { |
| 24 ; ASM-LABEL:test_atomic_load_8: |
| 25 ; DIS-LABEL:00000000 <test_atomic_load_8>: |
| 26 ; IASM-LABEL:test_atomic_load_8: |
| 27 |
| 28 entry: |
| 29 ; ASM-NEXT:.Ltest_atomic_load_8$entry: |
| 30 ; IASM-NEXT:.Ltest_atomic_load_8$entry: |
| 31 |
| 32 ; ASM-NEXT: sub sp, sp, #12 |
| 33 ; DIS-NEXT: 0: e24dd00c |
| 34 ; IASM-NEXT: .byte 0xc |
| 35 ; IASM-NEXT: .byte 0xd0 |
| 36 ; IASM-NEXT: .byte 0x4d |
| 37 ; IASM-NEXT: .byte 0xe2 |
| 38 |
| 39 ; ASM-NEXT: str r0, [sp, #8] |
| 40 ; ASM-NEXT: # [sp, #8] = def.pseudo |
| 41 ; DIS-NEXT: 4: e58d0008 |
| 42 ; IASM-NEXT: .byte 0x8 |
| 43 ; IASM-NEXT: .byte 0x0 |
| 44 ; IASM-NEXT: .byte 0x8d |
| 45 ; IASM-NEXT: .byte 0xe5 |
| 46 |
| 47 %ptr = inttoptr i32 %iptr to i8* |
| 48 ; parameter value "6" is for the sequential consistency memory order. |
| 49 %i = call i8 @llvm.nacl.atomic.load.i8(i8* %ptr, i32 6) |
| 50 |
| 51 ; ASM-NEXT: ldr r0, [sp, #8] |
| 52 ; DIS-NEXT: 8: e59d0008 |
| 53 ; IASM-NEXT: .byte 0x8 |
| 54 ; IASM-NEXT: .byte 0x0 |
| 55 ; IASM-NEXT: .byte 0x9d |
| 56 ; IASM-NEXT: .byte 0xe5 |
| 57 |
| 58 ; ASM-NEXT: ldrb r0, [r0] |
| 59 ; DIS-NEXT: c: e5d00000 |
| 60 ; IASM-NEXT: .byte 0x0 |
| 61 ; IASM-NEXT: .byte 0x0 |
| 62 ; IASM-NEXT: .byte 0xd0 |
| 63 ; IASM-NEXT: .byte 0xe5 |
| 64 |
| 65 ; ASM-NEXT: dmb sy |
| 66 ; DIS-NEXT: 10: f57ff05f |
| 67 ; IASM-NEXT: .byte 0x5f |
| 68 ; IASM-NEXT: .byte 0xf0 |
| 69 ; IASM-NEXT: .byte 0x7f |
| 70 ; IASM-NEXT: .byte 0xf5 |
| 71 |
| 72 %r = zext i8 %i to i32 |
| 73 ret i32 %r |
| 74 } |
OLD | NEW |