2016-05-06 04:07:37 +08:00
|
|
|
; RUN: llc < %s -march=amdgcn -verify-machineinstrs | FileCheck %s --check-prefix=SI
|
2017-01-25 06:02:15 +08:00
|
|
|
; RUN: llc < %s -march=amdgcn -mcpu=tonga -mattr=-flat-for-global -verify-machineinstrs | FileCheck %s --check-prefix=SI
|
2016-05-06 04:07:37 +08:00
|
|
|
; RUN: llc < %s -march=r600 -mcpu=redwood | FileCheck %s --check-prefix=R600
|
2013-08-01 23:23:26 +08:00
|
|
|
|
2016-11-11 00:02:37 +08:00
|
|
|
; R600: {{^}}s_mad_zext_i32_to_i64:
|
2015-02-04 05:53:27 +08:00
|
|
|
; R600: MEM_RAT_CACHELESS STORE_RAW
|
|
|
|
; R600: MEM_RAT_CACHELESS STORE_RAW
|
2013-08-01 23:23:26 +08:00
|
|
|
|
2016-11-11 00:02:37 +08:00
|
|
|
; SI: {{^}}s_mad_zext_i32_to_i64:
|
2015-11-03 07:15:42 +08:00
|
|
|
; SI: v_mov_b32_e32 v[[V_ZERO:[0-9]]], 0{{$}}
|
2015-02-04 05:53:27 +08:00
|
|
|
; SI: buffer_store_dwordx2 v[0:[[V_ZERO]]{{\]}}
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @s_mad_zext_i32_to_i64(i64 addrspace(1)* %out, i32 %a, i32 %b, i32 %c) #0 {
|
2013-08-01 23:23:26 +08:00
|
|
|
entry:
|
2016-11-11 00:02:37 +08:00
|
|
|
%tmp0 = mul i32 %a, %b
|
|
|
|
%tmp1 = add i32 %tmp0, %c
|
|
|
|
%tmp2 = zext i32 %tmp1 to i64
|
|
|
|
store i64 %tmp2, i64 addrspace(1)* %out
|
2013-08-01 23:23:26 +08:00
|
|
|
ret void
|
|
|
|
}
|
2014-02-05 17:48:05 +08:00
|
|
|
|
2016-11-11 00:02:37 +08:00
|
|
|
; SI-LABEL: {{^}}s_cmp_zext_i1_to_i32
|
2015-02-04 05:53:27 +08:00
|
|
|
; SI: v_cndmask_b32
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @s_cmp_zext_i1_to_i32(i32 addrspace(1)* %out, i32 %a, i32 %b) #0 {
|
2014-02-05 17:48:05 +08:00
|
|
|
entry:
|
2016-11-11 00:02:37 +08:00
|
|
|
%tmp0 = icmp eq i32 %a, %b
|
|
|
|
%tmp1 = zext i1 %tmp0 to i32
|
|
|
|
store i32 %tmp1, i32 addrspace(1)* %out
|
2014-02-05 17:48:05 +08:00
|
|
|
ret void
|
|
|
|
}
|
2014-04-17 10:03:08 +08:00
|
|
|
|
2016-11-11 00:02:37 +08:00
|
|
|
; SI-LABEL: {{^}}s_arg_zext_i1_to_i64:
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @s_arg_zext_i1_to_i64(i64 addrspace(1)* %out, i1 zeroext %arg) #0 {
|
2016-11-11 00:02:37 +08:00
|
|
|
%ext = zext i1 %arg to i64
|
|
|
|
store i64 %ext, i64 addrspace(1)* %out, align 8
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; SI-LABEL: {{^}}s_cmp_zext_i1_to_i64:
|
2015-02-04 05:53:27 +08:00
|
|
|
; SI: s_mov_b32 s{{[0-9]+}}, 0
|
2016-09-30 09:50:20 +08:00
|
|
|
; SI: v_cmp_eq_u32
|
2015-02-04 05:53:27 +08:00
|
|
|
; SI: v_cndmask_b32
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @s_cmp_zext_i1_to_i64(i64 addrspace(1)* %out, i32 %a, i32 %b) #0 {
|
2014-04-17 10:03:08 +08:00
|
|
|
%cmp = icmp eq i32 %a, %b
|
|
|
|
%ext = zext i1 %cmp to i64
|
|
|
|
store i64 %ext, i64 addrspace(1)* %out, align 8
|
|
|
|
ret void
|
|
|
|
}
|
2016-11-11 00:02:37 +08:00
|
|
|
|
|
|
|
; SI-LABEL: {{^}}s_cmp_zext_i1_to_i16
|
|
|
|
; SI: v_cndmask_b32_e64 [[RESULT:v[0-9]+]], 0, 1, vcc
|
|
|
|
; SI: buffer_store_short [[RESULT]]
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @s_cmp_zext_i1_to_i16(i16 addrspace(1)* %out, i16 zeroext %a, i16 zeroext %b) #0 {
|
2016-11-11 00:02:37 +08:00
|
|
|
%tmp0 = icmp eq i16 %a, %b
|
|
|
|
%tmp1 = zext i1 %tmp0 to i16
|
|
|
|
store i16 %tmp1, i16 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
attributes #0 = { nounwind }
|