2018-11-14 05:18:21 +08:00
|
|
|
; RUN: llc -march=amdgcn -mtriple=amdgcn-- -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefix=GCN %s
|
|
|
|
; RUN: llc -march=amdgcn -mtriple=amdgcn-- -mcpu=tonga -mattr=-flat-for-global -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefix=GCN %s
|
2016-05-28 08:51:06 +08:00
|
|
|
|
|
|
|
; GCN-LABEL: {{^}}extract_vector_elt_v3f64_2:
|
|
|
|
; GCN: buffer_load_dwordx4
|
|
|
|
; GCN: buffer_load_dwordx2
|
|
|
|
; GCN: buffer_store_dwordx2
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @extract_vector_elt_v3f64_2(double addrspace(1)* %out, <3 x double> addrspace(1)* %in) #0 {
|
2016-05-28 08:51:06 +08:00
|
|
|
%ld = load volatile <3 x double>, <3 x double> addrspace(1)* %in
|
|
|
|
%elt = extractelement <3 x double> %ld, i32 2
|
|
|
|
store volatile double %elt, double addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; GCN-LABEL: {{^}}dyn_extract_vector_elt_v3f64:
|
2018-11-14 05:18:21 +08:00
|
|
|
; GCN-NOT: buffer_load
|
2020-06-24 22:27:23 +08:00
|
|
|
; GCN-DAG: v_cmp_eq_u32_e64 [[C1:[^,]+]], [[IDX:s[0-9]+]], 1
|
|
|
|
; GCN-DAG: v_cmp_eq_u32_e64 [[C2:[^,]+]], [[IDX]], 2
|
2018-11-14 05:18:21 +08:00
|
|
|
; GCN-DAG: v_cndmask_b32_e{{32|64}} v{{[0-9]+}}, v{{[0-9]+}}, v{{[0-9]+}}, [[C1]]
|
|
|
|
; GCN-DAG: v_cndmask_b32_e{{32|64}} v{{[0-9]+}}, v{{[0-9]+}}, v{{[0-9]+}}, [[C1]]
|
|
|
|
; GCN-DAG: v_cndmask_b32_e{{32|64}} v{{[0-9]+}}, v{{[0-9]+}}, v{{[0-9]+}}, [[C2]]
|
|
|
|
; GCN-DAG: v_cndmask_b32_e{{32|64}} v{{[0-9]+}}, v{{[0-9]+}}, v{{[0-9]+}}, [[C2]]
|
|
|
|
; GCN: store_dwordx2 v[{{[0-9:]+}}]
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @dyn_extract_vector_elt_v3f64(double addrspace(1)* %out, <3 x double> %foo, i32 %elt) #0 {
|
2016-05-28 08:51:06 +08:00
|
|
|
%dynelt = extractelement <3 x double> %foo, i32 %elt
|
|
|
|
store volatile double %dynelt, double addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; GCN-LABEL: {{^}}dyn_extract_vector_elt_v4f64:
|
2018-11-14 05:18:21 +08:00
|
|
|
; GCN-NOT: buffer_load
|
2020-06-24 22:27:23 +08:00
|
|
|
; GCN-DAG: v_cmp_eq_u32_e64 [[C1:[^,]+]], [[IDX:s[0-9]+]], 1
|
|
|
|
; GCN-DAG: v_cmp_eq_u32_e64 [[C2:[^,]+]], [[IDX]], 2
|
|
|
|
; GCN-DAG: v_cmp_eq_u32_e64 [[C3:[^,]+]], [[IDX]], 3
|
2018-11-14 05:18:21 +08:00
|
|
|
; GCN-DAG: v_cndmask_b32_e{{32|64}} v{{[0-9]+}}, v{{[0-9]+}}, v{{[0-9]+}}, [[C1]]
|
|
|
|
; GCN-DAG: v_cndmask_b32_e{{32|64}} v{{[0-9]+}}, v{{[0-9]+}}, v{{[0-9]+}}, [[C1]]
|
|
|
|
; GCN-DAG: v_cndmask_b32_e{{32|64}} v{{[0-9]+}}, v{{[0-9]+}}, v{{[0-9]+}}, [[C2]]
|
|
|
|
; GCN-DAG: v_cndmask_b32_e{{32|64}} v{{[0-9]+}}, v{{[0-9]+}}, v{{[0-9]+}}, [[C2]]
|
|
|
|
; GCN-DAG: v_cndmask_b32_e{{32|64}} v{{[0-9]+}}, v{{[0-9]+}}, v{{[0-9]+}}, [[C3]]
|
|
|
|
; GCN-DAG: v_cndmask_b32_e{{32|64}} v{{[0-9]+}}, v{{[0-9]+}}, v{{[0-9]+}}, [[C3]]
|
|
|
|
; GCN: store_dwordx2 v[{{[0-9:]+}}]
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @dyn_extract_vector_elt_v4f64(double addrspace(1)* %out, <4 x double> %foo, i32 %elt) #0 {
|
2016-05-28 08:51:06 +08:00
|
|
|
%dynelt = extractelement <4 x double> %foo, i32 %elt
|
|
|
|
store volatile double %dynelt, double addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
attributes #0 = { nounwind }
|