Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 ; RUN: opt -nacl-rewrite-atomics -S < %s | FileCheck %s | |
| 2 | |
| 3 ; Check rewriting nand, max, min, umax, umin atomicrmw operations. | |
| 4 | |
| 5 target datalayout = "p:32:32:32" | |
| 6 | |
| 7 ; We test nand with all types, but for brevity's sake we don't do so for the | |
| 8 ; other operations. | |
| 9 define i8 @test_nand_i8(i8* %ptr, i8 %value) { | |
| 10 %res = atomicrmw nand i8* %ptr, i8 %value seq_cst | |
| 11 ret i8 %res | |
| 12 } | |
| 13 ; CHECK-LABEL: @test_nand_i8 | |
| 14 ; CHECK: @llvm.nacl.atomic.cmpxchg | |
|
JF
2015/08/04 17:10:30
Can you keep one of them expanded, so we can check
| |
| 15 | |
| 16 | |
| 17 define i16 @test_nand_i16(i16* %ptr, i16 %value) { | |
| 18 %res = atomicrmw nand i16* %ptr, i16 %value seq_cst | |
| 19 ret i16 %res | |
| 20 } | |
| 21 ; CHECK-LABEL: @test_nand_i16 | |
| 22 ; CHECK: @llvm.nacl.atomic.cmpxchg | |
| 23 | |
| 24 define i32 @test_nand_i32(i32* %ptr, i32 %value) { | |
| 25 %res = atomicrmw nand i32* %ptr, i32 %value seq_cst | |
| 26 ret i32 %res | |
| 27 } | |
| 28 ; CHECK-LABEL: @test_nand_i32 | |
| 29 ; CHECK: @llvm.nacl.atomic.cmpxchg | |
| 30 | |
| 31 define i64 @test_nand_i64(i64* %ptr, i64 %value) { | |
| 32 %res = atomicrmw nand i64* %ptr, i64 %value seq_cst | |
| 33 ret i64 %res | |
| 34 } | |
| 35 ; CHECK-LABEL: @test_nand_i64 | |
| 36 ; CHECK: @llvm.nacl.atomic.cmpxchg | |
| 37 | |
| 38 | |
| 39 define i32 @test_max(i32* %ptr, i32 %value) { | |
| 40 %res = atomicrmw max i32* %ptr, i32 %value seq_cst | |
| 41 ret i32 %res | |
| 42 } | |
| 43 ; CHECK-LABEL: @test_max | |
| 44 ; CHECK: @llvm.nacl.atomic.cmpxchg | |
| 45 | |
| 46 define i32 @test_min(i32* %ptr, i32 %value) { | |
| 47 %res = atomicrmw min i32* %ptr, i32 %value seq_cst | |
| 48 ret i32 %res | |
| 49 } | |
| 50 ; CHECK-LABEL: @test_min | |
| 51 ; CHECK: @llvm.nacl.atomic.cmpxchg | |
| 52 | |
| 53 define i32 @test_umax(i32* %ptr, i32 %value) { | |
| 54 %res = atomicrmw umax i32* %ptr, i32 %value seq_cst | |
| 55 ret i32 %res | |
| 56 } | |
| 57 ; CHECK-LABEL: @test_umax | |
| 58 ; CHECK: @llvm.nacl.atomic.cmpxchg | |
| 59 | |
| 60 define i32 @test_umin(i32* %ptr, i32 %value) { | |
| 61 %res = atomicrmw umin i32* %ptr, i32 %value seq_cst | |
| 62 ret i32 %res | |
| 63 } | |
| 64 ; CHECK-LABEL: @test_umin | |
| 65 ; CHECK: @llvm.nacl.atomic.cmpxchg | |
| OLD | NEW |