2017-01-25 06:02:15 +08:00
|
|
|
; RUN: llc -march=amdgcn -verify-machineinstrs< %s | FileCheck -check-prefix=SI %s
|
|
|
|
; RUN: llc -march=amdgcn -mcpu=tonga -mattr=-flat-for-global -verify-machineinstrs< %s | FileCheck -check-prefix=SI %s
|
2014-03-13 02:45:52 +08:00
|
|
|
|
|
|
|
|
2014-10-02 01:15:17 +08:00
|
|
|
; SI-LABEL: {{^}}global_truncstore_i32_to_i1:
|
2014-11-05 22:50:53 +08:00
|
|
|
; SI: s_load_dword [[LOAD:s[0-9]+]],
|
|
|
|
; SI: s_and_b32 [[SREG:s[0-9]+]], [[LOAD]], 1
|
|
|
|
; SI: v_mov_b32_e32 [[VREG:v[0-9]+]], [[SREG]]
|
|
|
|
; SI: buffer_store_byte [[VREG]],
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @global_truncstore_i32_to_i1(i1 addrspace(1)* %out, i32 %val) nounwind {
|
2014-03-13 02:45:52 +08:00
|
|
|
%trunc = trunc i32 %val to i1
|
|
|
|
store i1 %trunc, i1 addrspace(1)* %out, align 1
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-10-02 01:15:17 +08:00
|
|
|
; SI-LABEL: {{^}}global_truncstore_i64_to_i1:
|
2014-11-05 22:50:53 +08:00
|
|
|
; SI: buffer_store_byte
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @global_truncstore_i64_to_i1(i1 addrspace(1)* %out, i64 %val) nounwind {
|
2014-03-13 02:45:52 +08:00
|
|
|
%trunc = trunc i64 %val to i1
|
|
|
|
store i1 %trunc, i1 addrspace(1)* %out, align 1
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2016-11-11 00:02:37 +08:00
|
|
|
; SI-LABEL: {{^}}s_arg_global_truncstore_i16_to_i1:
|
2014-11-05 22:50:53 +08:00
|
|
|
; SI: s_load_dword [[LOAD:s[0-9]+]],
|
|
|
|
; SI: s_and_b32 [[SREG:s[0-9]+]], [[LOAD]], 1
|
|
|
|
; SI: v_mov_b32_e32 [[VREG:v[0-9]+]], [[SREG]]
|
|
|
|
; SI: buffer_store_byte [[VREG]],
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @s_arg_global_truncstore_i16_to_i1(i1 addrspace(1)* %out, i16 %val) nounwind {
|
2014-03-13 02:45:52 +08:00
|
|
|
%trunc = trunc i16 %val to i1
|
|
|
|
store i1 %trunc, i1 addrspace(1)* %out, align 1
|
|
|
|
ret void
|
|
|
|
}
|
2016-11-11 00:02:37 +08:00
|
|
|
; SI-LABEL: {{^}}global_truncstore_i16_to_i1:
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @global_truncstore_i16_to_i1(i1 addrspace(1)* %out, i16 %val0, i16 %val1) nounwind {
|
2016-11-11 00:02:37 +08:00
|
|
|
%add = add i16 %val0, %val1
|
|
|
|
%trunc = trunc i16 %add to i1
|
|
|
|
store i1 %trunc, i1 addrspace(1)* %out, align 1
|
|
|
|
ret void
|
|
|
|
}
|