1 ; RUN: llc -march=amdgcn -mcpu=tahiti -mattr=-flat-for-global -verify-machineinstrs < %s | FileCheck -check-prefix=SI %s
3 ; SI-LABEL: {{^}}s_clear_msb:
4 ; SI: s_bitset0_b32 s{{[0-9]+}}, 31
5 define amdgpu_kernel void @s_clear_msb(i32 addrspace(1)* %out, i32 %in) {
6 %x = and i32 %in, 2147483647
7 store i32 %x, i32 addrspace(1)* %out
11 ; SI-LABEL: {{^}}s_set_msb:
12 ; SI: s_bitset1_b32 s{{[0-9]+}}, 31
13 define amdgpu_kernel void @s_set_msb(i32 addrspace(1)* %out, i32 %in) {
14 %x = or i32 %in, 2147483648
15 store i32 %x, i32 addrspace(1)* %out
19 ; SI-LABEL: {{^}}s_clear_lsb:
20 ; SI: s_and_b32 s{{[0-9]+}}, s{{[0-9]+}}, -2
21 define amdgpu_kernel void @s_clear_lsb(i32 addrspace(1)* %out, i32 %in) {
22 %x = and i32 %in, 4294967294
23 store i32 %x, i32 addrspace(1)* %out
27 ; SI-LABEL: {{^}}s_set_lsb:
28 ; SI: s_or_b32 s{{[0-9]+}}, s{{[0-9]+}}, 1
29 define amdgpu_kernel void @s_set_lsb(i32 addrspace(1)* %out, i32 %in) {
31 store i32 %x, i32 addrspace(1)* %out
35 ; SI-LABEL: {{^}}s_clear_midbit:
36 ; SI: s_bitset0_b32 s{{[0-9]+}}, 8
37 define amdgpu_kernel void @s_clear_midbit(i32 addrspace(1)* %out, i32 %in) {
38 %x = and i32 %in, 4294967039
39 store i32 %x, i32 addrspace(1)* %out
43 ; SI-LABEL: {{^}}s_set_midbit:
44 ; SI: s_bitset1_b32 s{{[0-9]+}}, 8
45 define amdgpu_kernel void @s_set_midbit(i32 addrspace(1)* %out, i32 %in) {
47 store i32 %x, i32 addrspace(1)* %out