| 1 |
// RUN: %clang_cc1 -fms-extensions -triple x86_64-windows-msvc %s -emit-llvm -o - | FileCheck %s --check-prefix=X64 |
| 2 |
// RUN: %clang_cc1 -fms-extensions -triple thumbv7-windows-msvc %s -emit-llvm -o - | FileCheck %s --check-prefix=ARM |
| 3 |
// RUN: %clang_cc1 -fms-extensions -triple aarch64-windows-msvc %s -emit-llvm -o - | FileCheck %s --check-prefix=ARM64 -check-prefix=ARM |
| 4 |
|
| 5 |
volatile unsigned char sink = 0; |
| 6 |
void test32(long *base, long idx) { |
| 7 |
sink = _bittest(base, idx); |
| 8 |
sink = _bittestandcomplement(base, idx); |
| 9 |
sink = _bittestandreset(base, idx); |
| 10 |
sink = _bittestandset(base, idx); |
| 11 |
sink = _interlockedbittestandreset(base, idx); |
| 12 |
sink = _interlockedbittestandset(base, idx); |
| 13 |
} |
| 14 |
|
| 15 |
void test64(__int64 *base, __int64 idx) { |
| 16 |
sink = _bittest64(base, idx); |
| 17 |
sink = _bittestandcomplement64(base, idx); |
| 18 |
sink = _bittestandreset64(base, idx); |
| 19 |
sink = _bittestandset64(base, idx); |
| 20 |
sink = _interlockedbittestandreset64(base, idx); |
| 21 |
sink = _interlockedbittestandset64(base, idx); |
| 22 |
} |
| 23 |
|
| 24 |
#if defined(_M_ARM) || defined(_M_ARM64) |
| 25 |
void test_arm(long *base, long idx) { |
| 26 |
sink = _interlockedbittestandreset_acq(base, idx); |
| 27 |
sink = _interlockedbittestandreset_rel(base, idx); |
| 28 |
sink = _interlockedbittestandreset_nf(base, idx); |
| 29 |
sink = _interlockedbittestandset_acq(base, idx); |
| 30 |
sink = _interlockedbittestandset_rel(base, idx); |
| 31 |
sink = _interlockedbittestandset_nf(base, idx); |
| 32 |
} |
| 33 |
#endif |
| 34 |
|
| 35 |
#if defined(_M_ARM64) |
| 36 |
void test_arm64(__int64 *base, __int64 idx) { |
| 37 |
sink = _interlockedbittestandreset64_acq(base, idx); |
| 38 |
sink = _interlockedbittestandreset64_rel(base, idx); |
| 39 |
sink = _interlockedbittestandreset64_nf(base, idx); |
| 40 |
sink = _interlockedbittestandset64_acq(base, idx); |
| 41 |
sink = _interlockedbittestandset64_rel(base, idx); |
| 42 |
sink = _interlockedbittestandset64_nf(base, idx); |
| 43 |
} |
| 44 |
#endif |
| 45 |
|
| 46 |
// X64-LABEL: define dso_local void @test32(ptr noundef %base, i32 noundef %idx) |
| 47 |
// X64: call i8 asm sideeffect "btl $2, ($1)", "={@ccc},r,r,~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(ptr %{{.*}}, i32 {{.*}}) |
| 48 |
// X64: call i8 asm sideeffect "btcl $2, ($1)", "={@ccc},r,r,~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(ptr %{{.*}}, i32 {{.*}}) |
| 49 |
// X64: call i8 asm sideeffect "btrl $2, ($1)", "={@ccc},r,r,~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(ptr %{{.*}}, i32 {{.*}}) |
| 50 |
// X64: call i8 asm sideeffect "btsl $2, ($1)", "={@ccc},r,r,~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(ptr %{{.*}}, i32 {{.*}}) |
| 51 |
// X64: call i8 asm sideeffect "lock btrl $2, ($1)", "={@ccc},r,r,~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(ptr %{{.*}}, i32 {{.*}}) |
| 52 |
// X64: call i8 asm sideeffect "lock btsl $2, ($1)", "={@ccc},r,r,~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(ptr %{{.*}}, i32 {{.*}}) |
| 53 |
|
| 54 |
// X64-LABEL: define dso_local void @test64(ptr noundef %base, i64 noundef %idx) |
| 55 |
// X64: call i8 asm sideeffect "btq $2, ($1)", "={@ccc},r,r,~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(ptr %{{.*}}, i64 {{.*}}) |
| 56 |
// X64: call i8 asm sideeffect "btcq $2, ($1)", "={@ccc},r,r,~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(ptr %{{.*}}, i64 {{.*}}) |
| 57 |
// X64: call i8 asm sideeffect "btrq $2, ($1)", "={@ccc},r,r,~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(ptr %{{.*}}, i64 {{.*}}) |
| 58 |
// X64: call i8 asm sideeffect "btsq $2, ($1)", "={@ccc},r,r,~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(ptr %{{.*}}, i64 {{.*}}) |
| 59 |
// X64: call i8 asm sideeffect "lock btrq $2, ($1)", "={@ccc},r,r,~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(ptr %{{.*}}, i64 {{.*}}) |
| 60 |
// X64: call i8 asm sideeffect "lock btsq $2, ($1)", "={@ccc},r,r,~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(ptr %{{.*}}, i64 {{.*}}) |
| 61 |
|
| 62 |
// ARM-LABEL: define dso_local {{.*}}void @test32(ptr noundef %base, i32 noundef %idx) |
| 63 |
// ARM: %[[IDXHI:[^ ]*]] = ashr i32 %{{.*}}, 3 |
| 64 |
// ARM: %[[BYTEADDR:[^ ]*]] = getelementptr inbounds i8, ptr %{{.*}}, i32 %[[IDXHI]] |
| 65 |
// ARM: %[[IDX8:[^ ]*]] = trunc i32 %{{.*}} to i8 |
| 66 |
// ARM: %[[IDXLO:[^ ]*]] = and i8 %[[IDX8]], 7 |
| 67 |
// ARM: %[[BYTE:[^ ]*]] = load i8, ptr %[[BYTEADDR]], align 1 |
| 68 |
// ARM: %[[BYTESHR:[^ ]*]] = lshr i8 %[[BYTE]], %[[IDXLO]] |
| 69 |
// ARM: %[[RES:[^ ]*]] = and i8 %[[BYTESHR]], 1 |
| 70 |
// ARM: store volatile i8 %[[RES]], ptr @sink, align 1 |
| 71 |
|
| 72 |
// ARM: %[[IDXHI:[^ ]*]] = ashr i32 %{{.*}}, 3 |
| 73 |
// ARM: %[[BYTEADDR:[^ ]*]] = getelementptr inbounds i8, ptr %{{.*}}, i32 %[[IDXHI]] |
| 74 |
// ARM: %[[IDX8:[^ ]*]] = trunc i32 %{{.*}} to i8 |
| 75 |
// ARM: %[[IDXLO:[^ ]*]] = and i8 %[[IDX8]], 7 |
| 76 |
// ARM: %[[MASK:[^ ]*]] = shl i8 1, %[[IDXLO]] |
| 77 |
// ARM: %[[BYTE:[^ ]*]] = load i8, ptr %[[BYTEADDR]], align 1 |
| 78 |
// ARM: %[[NEWBYTE:[^ ]*]] = xor i8 %[[BYTE]], %[[MASK]] |
| 79 |
// ARM: store i8 %[[NEWBYTE]], ptr %[[BYTEADDR]], align 1 |
| 80 |
// ARM: %[[BYTESHR:[^ ]*]] = lshr i8 %[[BYTE]], %[[IDXLO]] |
| 81 |
// ARM: %[[RES:[^ ]*]] = and i8 %[[BYTESHR]], 1 |
| 82 |
// ARM: store volatile i8 %[[RES]], ptr @sink, align 1 |
| 83 |
|
| 84 |
// ARM: %[[IDXHI:[^ ]*]] = ashr i32 %{{.*}}, 3 |
| 85 |
// ARM: %[[BYTEADDR:[^ ]*]] = getelementptr inbounds i8, ptr %{{.*}}, i32 %[[IDXHI]] |
| 86 |
// ARM: %[[IDX8:[^ ]*]] = trunc i32 %{{.*}} to i8 |
| 87 |
// ARM: %[[IDXLO:[^ ]*]] = and i8 %[[IDX8]], 7 |
| 88 |
// ARM: %[[MASK:[^ ]*]] = shl i8 1, %[[IDXLO]] |
| 89 |
// ARM: %[[BYTE:[^ ]*]] = load i8, ptr %[[BYTEADDR]], align 1 |
| 90 |
// ARM: %[[NOTMASK:[^ ]*]] = xor i8 %[[MASK]], -1 |
| 91 |
// ARM: %[[NEWBYTE:[^ ]*]] = and i8 %[[BYTE]], %[[NOTMASK]] |
| 92 |
// ARM: store i8 %[[NEWBYTE]], ptr %[[BYTEADDR]], align 1 |
| 93 |
// ARM: %[[BYTESHR:[^ ]*]] = lshr i8 %[[BYTE]], %[[IDXLO]] |
| 94 |
// ARM: %[[RES:[^ ]*]] = and i8 %[[BYTESHR]], 1 |
| 95 |
// ARM: store volatile i8 %[[RES]], ptr @sink, align 1 |
| 96 |
|
| 97 |
// ARM: %[[IDXHI:[^ ]*]] = ashr i32 %{{.*}}, 3 |
| 98 |
// ARM: %[[BYTEADDR:[^ ]*]] = getelementptr inbounds i8, ptr %{{.*}}, i32 %[[IDXHI]] |
| 99 |
// ARM: %[[IDX8:[^ ]*]] = trunc i32 %{{.*}} to i8 |
| 100 |
// ARM: %[[IDXLO:[^ ]*]] = and i8 %[[IDX8]], 7 |
| 101 |
// ARM: %[[MASK:[^ ]*]] = shl i8 1, %[[IDXLO]] |
| 102 |
// ARM: %[[BYTE:[^ ]*]] = load i8, ptr %[[BYTEADDR]], align 1 |
| 103 |
// ARM: %[[NEWBYTE:[^ ]*]] = or i8 %[[BYTE]], %[[MASK]] |
| 104 |
// ARM: store i8 %[[NEWBYTE]], ptr %[[BYTEADDR]], align 1 |
| 105 |
// ARM: %[[BYTESHR:[^ ]*]] = lshr i8 %[[BYTE]], %[[IDXLO]] |
| 106 |
// ARM: %[[RES:[^ ]*]] = and i8 %[[BYTESHR]], 1 |
| 107 |
// ARM: store volatile i8 %[[RES]], ptr @sink, align 1 |
| 108 |
|
| 109 |
// ARM: %[[IDXHI:[^ ]*]] = ashr i32 %{{.*}}, 3 |
| 110 |
// ARM: %[[BYTEADDR:[^ ]*]] = getelementptr inbounds i8, ptr %{{.*}}, i32 %[[IDXHI]] |
| 111 |
// ARM: %[[IDX8:[^ ]*]] = trunc i32 %{{.*}} to i8 |
| 112 |
// ARM: %[[IDXLO:[^ ]*]] = and i8 %[[IDX8]], 7 |
| 113 |
// ARM: %[[MASK:[^ ]*]] = shl i8 1, %[[IDXLO]] |
| 114 |
// ARM: %[[NOTMASK:[^ ]*]] = xor i8 %[[MASK]], -1 |
| 115 |
// ARM: %[[BYTE:[^ ]*]] = atomicrmw and ptr %[[BYTEADDR]], i8 %[[NOTMASK]] seq_cst, align 1 |
| 116 |
// ARM: %[[BYTESHR:[^ ]*]] = lshr i8 %[[BYTE]], %[[IDXLO]] |
| 117 |
// ARM: %[[RES:[^ ]*]] = and i8 %[[BYTESHR]], 1 |
| 118 |
// ARM: store volatile i8 %[[RES]], ptr @sink, align 1 |
| 119 |
|
| 120 |
// ARM: %[[IDXHI:[^ ]*]] = ashr i32 %{{.*}}, 3 |
| 121 |
// ARM: %[[BYTEADDR:[^ ]*]] = getelementptr inbounds i8, ptr %{{.*}}, i32 %[[IDXHI]] |
| 122 |
// ARM: %[[IDX8:[^ ]*]] = trunc i32 %{{.*}} to i8 |
| 123 |
// ARM: %[[IDXLO:[^ ]*]] = and i8 %[[IDX8]], 7 |
| 124 |
// ARM: %[[MASK:[^ ]*]] = shl i8 1, %[[IDXLO]] |
| 125 |
// ARM: %[[BYTE:[^ ]*]] = atomicrmw or ptr %[[BYTEADDR]], i8 %[[MASK]] seq_cst, align 1 |
| 126 |
// ARM: %[[BYTESHR:[^ ]*]] = lshr i8 %[[BYTE]], %[[IDXLO]] |
| 127 |
// ARM: %[[RES:[^ ]*]] = and i8 %[[BYTESHR]], 1 |
| 128 |
// ARM: store volatile i8 %[[RES]], ptr @sink, align 1 |
| 129 |
|
| 130 |
// ARM-LABEL: define dso_local {{.*}}void @test64(ptr noundef %base, i64 noundef %idx) |
| 131 |
// ARM: %[[IDXHI:[^ ]*]] = ashr i64 %{{.*}}, 3 |
| 132 |
// ARM: %[[BYTEADDR:[^ ]*]] = getelementptr inbounds i8, ptr %{{.*}}, i64 %[[IDXHI]] |
| 133 |
// ARM: %[[IDX8:[^ ]*]] = trunc i64 %{{.*}} to i8 |
| 134 |
// ARM: %[[IDXLO:[^ ]*]] = and i8 %[[IDX8]], 7 |
| 135 |
// ARM: %[[BYTE:[^ ]*]] = load i8, ptr %[[BYTEADDR]], align 1 |
| 136 |
// ARM: %[[BYTESHR:[^ ]*]] = lshr i8 %[[BYTE]], %[[IDXLO]] |
| 137 |
// ARM: %[[RES:[^ ]*]] = and i8 %[[BYTESHR]], 1 |
| 138 |
// ARM: store volatile i8 %[[RES]], ptr @sink, align 1 |
| 139 |
|
| 140 |
// ARM: %[[IDXHI:[^ ]*]] = ashr i64 %{{.*}}, 3 |
| 141 |
// ARM: %[[BYTEADDR:[^ ]*]] = getelementptr inbounds i8, ptr %{{.*}}, i64 %[[IDXHI]] |
| 142 |
// ARM: %[[IDX8:[^ ]*]] = trunc i64 %{{.*}} to i8 |
| 143 |
// ARM: %[[IDXLO:[^ ]*]] = and i8 %[[IDX8]], 7 |
| 144 |
// ARM: %[[MASK:[^ ]*]] = shl i8 1, %[[IDXLO]] |
| 145 |
// ARM: %[[BYTE:[^ ]*]] = load i8, ptr %[[BYTEADDR]], align 1 |
| 146 |
// ARM: %[[NEWBYTE:[^ ]*]] = xor i8 %[[BYTE]], %[[MASK]] |
| 147 |
// ARM: store i8 %[[NEWBYTE]], ptr %[[BYTEADDR]], align 1 |
| 148 |
// ARM: %[[BYTESHR:[^ ]*]] = lshr i8 %[[BYTE]], %[[IDXLO]] |
| 149 |
// ARM: %[[RES:[^ ]*]] = and i8 %[[BYTESHR]], 1 |
| 150 |
// ARM: store volatile i8 %[[RES]], ptr @sink, align 1 |
| 151 |
|
| 152 |
// ARM: %[[IDXHI:[^ ]*]] = ashr i64 %{{.*}}, 3 |
| 153 |
// ARM: %[[BYTEADDR:[^ ]*]] = getelementptr inbounds i8, ptr %{{.*}}, i64 %[[IDXHI]] |
| 154 |
// ARM: %[[IDX8:[^ ]*]] = trunc i64 %{{.*}} to i8 |
| 155 |
// ARM: %[[IDXLO:[^ ]*]] = and i8 %[[IDX8]], 7 |
| 156 |
// ARM: %[[MASK:[^ ]*]] = shl i8 1, %[[IDXLO]] |
| 157 |
// ARM: %[[BYTE:[^ ]*]] = load i8, ptr %[[BYTEADDR]], align 1 |
| 158 |
// ARM: %[[NOTMASK:[^ ]*]] = xor i8 %[[MASK]], -1 |
| 159 |
// ARM: %[[NEWBYTE:[^ ]*]] = and i8 %[[BYTE]], %[[NOTMASK]] |
| 160 |
// ARM: store i8 %[[NEWBYTE]], ptr %[[BYTEADDR]], align 1 |
| 161 |
// ARM: %[[BYTESHR:[^ ]*]] = lshr i8 %[[BYTE]], %[[IDXLO]] |
| 162 |
// ARM: %[[RES:[^ ]*]] = and i8 %[[BYTESHR]], 1 |
| 163 |
// ARM: store volatile i8 %[[RES]], ptr @sink, align 1 |
| 164 |
|
| 165 |
// ARM: %[[IDXHI:[^ ]*]] = ashr i64 %{{.*}}, 3 |
| 166 |
// ARM: %[[BYTEADDR:[^ ]*]] = getelementptr inbounds i8, ptr %{{.*}}, i64 %[[IDXHI]] |
| 167 |
// ARM: %[[IDX8:[^ ]*]] = trunc i64 %{{.*}} to i8 |
| 168 |
// ARM: %[[IDXLO:[^ ]*]] = and i8 %[[IDX8]], 7 |
| 169 |
// ARM: %[[MASK:[^ ]*]] = shl i8 1, %[[IDXLO]] |
| 170 |
// ARM: %[[BYTE:[^ ]*]] = load i8, ptr %[[BYTEADDR]], align 1 |
| 171 |
// ARM: %[[NEWBYTE:[^ ]*]] = or i8 %[[BYTE]], %[[MASK]] |
| 172 |
// ARM: store i8 %[[NEWBYTE]], ptr %[[BYTEADDR]], align 1 |
| 173 |
// ARM: %[[BYTESHR:[^ ]*]] = lshr i8 %[[BYTE]], %[[IDXLO]] |
| 174 |
// ARM: %[[RES:[^ ]*]] = and i8 %[[BYTESHR]], 1 |
| 175 |
// ARM: store volatile i8 %[[RES]], ptr @sink, align 1 |
| 176 |
|
| 177 |
// ARM: %[[IDXHI:[^ ]*]] = ashr i64 %{{.*}}, 3 |
| 178 |
// ARM: %[[BYTEADDR:[^ ]*]] = getelementptr inbounds i8, ptr %{{.*}}, i64 %[[IDXHI]] |
| 179 |
// ARM: %[[IDX8:[^ ]*]] = trunc i64 %{{.*}} to i8 |
| 180 |
// ARM: %[[IDXLO:[^ ]*]] = and i8 %[[IDX8]], 7 |
| 181 |
// ARM: %[[MASK:[^ ]*]] = shl i8 1, %[[IDXLO]] |
| 182 |
// ARM: %[[NOTMASK:[^ ]*]] = xor i8 %[[MASK]], -1 |
| 183 |
// ARM: %[[BYTE:[^ ]*]] = atomicrmw and ptr %[[BYTEADDR]], i8 %[[NOTMASK]] seq_cst, align 1 |
| 184 |
// ARM: %[[BYTESHR:[^ ]*]] = lshr i8 %[[BYTE]], %[[IDXLO]] |
| 185 |
// ARM: %[[RES:[^ ]*]] = and i8 %[[BYTESHR]], 1 |
| 186 |
// ARM: store volatile i8 %[[RES]], ptr @sink, align 1 |
| 187 |
|
| 188 |
// ARM: %[[IDXHI:[^ ]*]] = ashr i64 %{{.*}}, 3 |
| 189 |
// ARM: %[[BYTEADDR:[^ ]*]] = getelementptr inbounds i8, ptr %{{.*}}, i64 %[[IDXHI]] |
| 190 |
// ARM: %[[IDX8:[^ ]*]] = trunc i64 %{{.*}} to i8 |
| 191 |
// ARM: %[[IDXLO:[^ ]*]] = and i8 %[[IDX8]], 7 |
| 192 |
// ARM: %[[MASK:[^ ]*]] = shl i8 1, %[[IDXLO]] |
| 193 |
// ARM: %[[BYTE:[^ ]*]] = atomicrmw or ptr %[[BYTEADDR]], i8 %[[MASK]] seq_cst, align 1 |
| 194 |
// ARM: %[[BYTESHR:[^ ]*]] = lshr i8 %[[BYTE]], %[[IDXLO]] |
| 195 |
// ARM: %[[RES:[^ ]*]] = and i8 %[[BYTESHR]], 1 |
| 196 |
// ARM: store volatile i8 %[[RES]], ptr @sink, align 1 |
| 197 |
|
| 198 |
// ARM-LABEL: define dso_local {{.*}}void @test_arm(ptr noundef %base, i32 noundef %idx) |
| 199 |
// ARM: %[[IDXHI:[^ ]*]] = ashr i32 %{{.*}}, 3 |
| 200 |
// ARM: %[[BYTEADDR:[^ ]*]] = getelementptr inbounds i8, ptr %{{.*}}, i32 %[[IDXHI]] |
| 201 |
// ARM: %[[IDX8:[^ ]*]] = trunc i32 %{{.*}} to i8 |
| 202 |
// ARM: %[[IDXLO:[^ ]*]] = and i8 %[[IDX8]], 7 |
| 203 |
// ARM: %[[MASK:[^ ]*]] = shl i8 1, %[[IDXLO]] |
| 204 |
// ARM: %[[NOTMASK:[^ ]*]] = xor i8 %[[MASK]], -1 |
| 205 |
// ARM: %[[BYTE:[^ ]*]] = atomicrmw and ptr %[[BYTEADDR]], i8 %[[NOTMASK]] acquire, align 1 |
| 206 |
// ARM: %[[BYTESHR:[^ ]*]] = lshr i8 %[[BYTE]], %[[IDXLO]] |
| 207 |
// ARM: %[[RES:[^ ]*]] = and i8 %[[BYTESHR]], 1 |
| 208 |
// ARM: store volatile i8 %[[RES]], ptr @sink, align 1 |
| 209 |
// Just look for the atomicrmw instructions. |
| 210 |
// ARM: atomicrmw and ptr %{{.*}}, i8 {{.*}} release, align 1 |
| 211 |
// ARM: atomicrmw and ptr %{{.*}}, i8 {{.*}} monotonic, align 1 |
| 212 |
// ARM: %[[IDXHI:[^ ]*]] = ashr i32 %{{.*}}, 3 |
| 213 |
// ARM: %[[BYTEADDR:[^ ]*]] = getelementptr inbounds i8, ptr %{{.*}}, i32 %[[IDXHI]] |
| 214 |
// ARM: %[[IDX8:[^ ]*]] = trunc i32 %{{.*}} to i8 |
| 215 |
// ARM: %[[IDXLO:[^ ]*]] = and i8 %[[IDX8]], 7 |
| 216 |
// ARM: %[[MASK:[^ ]*]] = shl i8 1, %[[IDXLO]] |
| 217 |
// ARM: %[[BYTE:[^ ]*]] = atomicrmw or ptr %[[BYTEADDR]], i8 %[[MASK]] acquire, align 1 |
| 218 |
// ARM: %[[BYTESHR:[^ ]*]] = lshr i8 %[[BYTE]], %[[IDXLO]] |
| 219 |
// ARM: %[[RES:[^ ]*]] = and i8 %[[BYTESHR]], 1 |
| 220 |
// ARM: store volatile i8 %[[RES]], ptr @sink, align 1 |
| 221 |
// Just look for the atomicrmw instructions. |
| 222 |
// ARM: atomicrmw or ptr %{{.*}}, i8 {{.*}} release, align 1 |
| 223 |
// ARM: atomicrmw or ptr %{{.*}}, i8 {{.*}} monotonic, align 1 |
| 224 |
|
| 225 |
// ARM64-LABEL: define dso_local void @test_arm64(ptr noundef %base, i64 noundef %idx) |
| 226 |
// ARM64: %[[IDXHI:[^ ]*]] = ashr i64 %{{.*}}, 3 |
| 227 |
// ARM64: %[[BYTEADDR:[^ ]*]] = getelementptr inbounds i8, ptr %{{.*}}, i64 %[[IDXHI]] |
| 228 |
// ARM64: %[[IDX8:[^ ]*]] = trunc i64 %{{.*}} to i8 |
| 229 |
// ARM64: %[[IDXLO:[^ ]*]] = and i8 %[[IDX8]], 7 |
| 230 |
// ARM64: %[[MASK:[^ ]*]] = shl i8 1, %[[IDXLO]] |
| 231 |
// ARM64: %[[NOTMASK:[^ ]*]] = xor i8 %[[MASK]], -1 |
| 232 |
// ARM64: %[[BYTE:[^ ]*]] = atomicrmw and ptr %[[BYTEADDR]], i8 %[[NOTMASK]] acquire, align 1 |
| 233 |
// ARM64: %[[BYTESHR:[^ ]*]] = lshr i8 %[[BYTE]], %[[IDXLO]] |
| 234 |
// ARM64: %[[RES:[^ ]*]] = and i8 %[[BYTESHR]], 1 |
| 235 |
// ARM64: store volatile i8 %[[RES]], ptr @sink, align 1 |
| 236 |
// ARM64: atomicrmw and ptr %{{.*}}, i8 {{.*}} release, align 1 |
| 237 |
// ARM64: atomicrmw and ptr %{{.*}}, i8 {{.*}} monotonic, align 1 |
| 238 |
// ARM64: %[[IDXHI:[^ ]*]] = ashr i64 %{{.*}}, 3 |
| 239 |
// ARM64: %[[BYTEADDR:[^ ]*]] = getelementptr inbounds i8, ptr %{{.*}}, i64 %[[IDXHI]] |
| 240 |
// ARM64: %[[IDX8:[^ ]*]] = trunc i64 %{{.*}} to i8 |
| 241 |
// ARM64: %[[IDXLO:[^ ]*]] = and i8 %[[IDX8]], 7 |
| 242 |
// ARM64: %[[MASK:[^ ]*]] = shl i8 1, %[[IDXLO]] |
| 243 |
// ARM64: %[[BYTE:[^ ]*]] = atomicrmw or ptr %[[BYTEADDR]], i8 %[[MASK]] acquire, align 1 |
| 244 |
// ARM64: %[[BYTESHR:[^ ]*]] = lshr i8 %[[BYTE]], %[[IDXLO]] |
| 245 |
// ARM64: %[[RES:[^ ]*]] = and i8 %[[BYTESHR]], 1 |
| 246 |
// ARM64: store volatile i8 %[[RES]], ptr @sink, align 1 |
| 247 |
// ARM64: atomicrmw or ptr %{{.*}}, i8 {{.*}} release, align 1 |
| 248 |
// ARM64: atomicrmw or ptr %{{.*}}, i8 {{.*}} monotonic, align 1 |