1*9880d681SAndroid Build Coastguard Worker; RUN: llc -march=amdgcn -mcpu=SI -verify-machineinstrs< %s | FileCheck -check-prefix=SI %s 2*9880d681SAndroid Build Coastguard Worker; RUN: llc -march=amdgcn -mcpu=tonga -verify-machineinstrs< %s | FileCheck -check-prefix=SI %s 3*9880d681SAndroid Build Coastguard Worker 4*9880d681SAndroid Build Coastguard Worker 5*9880d681SAndroid Build Coastguard Worker; SI-LABEL: {{^}}global_truncstore_i32_to_i1: 6*9880d681SAndroid Build Coastguard Worker; SI: s_load_dword [[LOAD:s[0-9]+]], 7*9880d681SAndroid Build Coastguard Worker; SI: s_and_b32 [[SREG:s[0-9]+]], [[LOAD]], 1 8*9880d681SAndroid Build Coastguard Worker; SI: v_mov_b32_e32 [[VREG:v[0-9]+]], [[SREG]] 9*9880d681SAndroid Build Coastguard Worker; SI: buffer_store_byte [[VREG]], 10*9880d681SAndroid Build Coastguard Workerdefine void @global_truncstore_i32_to_i1(i1 addrspace(1)* %out, i32 %val) nounwind { 11*9880d681SAndroid Build Coastguard Worker %trunc = trunc i32 %val to i1 12*9880d681SAndroid Build Coastguard Worker store i1 %trunc, i1 addrspace(1)* %out, align 1 13*9880d681SAndroid Build Coastguard Worker ret void 14*9880d681SAndroid Build Coastguard Worker} 15*9880d681SAndroid Build Coastguard Worker 16*9880d681SAndroid Build Coastguard Worker; SI-LABEL: {{^}}global_truncstore_i64_to_i1: 17*9880d681SAndroid Build Coastguard Worker; SI: buffer_store_byte 18*9880d681SAndroid Build Coastguard Workerdefine void @global_truncstore_i64_to_i1(i1 addrspace(1)* %out, i64 %val) nounwind { 19*9880d681SAndroid Build Coastguard Worker %trunc = trunc i64 %val to i1 20*9880d681SAndroid Build Coastguard Worker store i1 %trunc, i1 addrspace(1)* %out, align 1 21*9880d681SAndroid Build Coastguard Worker ret void 22*9880d681SAndroid Build Coastguard Worker} 23*9880d681SAndroid Build Coastguard Worker 24*9880d681SAndroid Build Coastguard Worker; SI-LABEL: {{^}}global_truncstore_i16_to_i1: 25*9880d681SAndroid Build Coastguard Worker; SI: s_load_dword [[LOAD:s[0-9]+]], 26*9880d681SAndroid Build Coastguard Worker; SI: s_and_b32 [[SREG:s[0-9]+]], [[LOAD]], 1 27*9880d681SAndroid Build Coastguard Worker; SI: v_mov_b32_e32 [[VREG:v[0-9]+]], [[SREG]] 28*9880d681SAndroid Build Coastguard Worker; SI: buffer_store_byte [[VREG]], 29*9880d681SAndroid Build Coastguard Workerdefine void @global_truncstore_i16_to_i1(i1 addrspace(1)* %out, i16 %val) nounwind { 30*9880d681SAndroid Build Coastguard Worker %trunc = trunc i16 %val to i1 31*9880d681SAndroid Build Coastguard Worker store i1 %trunc, i1 addrspace(1)* %out, align 1 32*9880d681SAndroid Build Coastguard Worker ret void 33*9880d681SAndroid Build Coastguard Worker} 34