2014-03-07 20:12:33 +00:00
|
|
|
; RUN: llc < %s -march=r600 -mcpu=redwood | FileCheck --check-prefix=EG-CHECK --check-prefix=FUNC %s
|
|
|
|
; RUN: llc < %s -march=r600 -mcpu=cayman | FileCheck --check-prefix=CM-CHECK --check-prefix=FUNC %s
|
|
|
|
; RUN: llc < %s -march=r600 -mcpu=verde -verify-machineinstrs | FileCheck --check-prefix=SI-CHECK --check-prefix=FUNC %s
|
2013-04-05 23:31:51 +00:00
|
|
|
|
2013-08-16 01:12:06 +00:00
|
|
|
;===------------------------------------------------------------------------===;
|
|
|
|
; Global Address Space
|
|
|
|
;===------------------------------------------------------------------------===;
|
2014-10-01 17:15:17 +00:00
|
|
|
; FUNC-LABEL: {{^}}store_i1:
|
2014-03-07 20:12:33 +00:00
|
|
|
; EG-CHECK: MEM_RAT MSKOR
|
|
|
|
; SI-CHECK: BUFFER_STORE_BYTE
|
|
|
|
define void @store_i1(i1 addrspace(1)* %out) {
|
|
|
|
entry:
|
|
|
|
store i1 true, i1 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
2013-08-16 01:12:06 +00:00
|
|
|
|
|
|
|
; i8 store
|
2014-10-01 17:15:17 +00:00
|
|
|
; EG-CHECK-LABEL: {{^}}store_i8:
|
2013-08-16 01:12:06 +00:00
|
|
|
; EG-CHECK: MEM_RAT MSKOR T[[RW_GPR:[0-9]]].XW, T{{[0-9]}}.X
|
|
|
|
; EG-CHECK: VTX_READ_8 [[VAL:T[0-9]\.X]], [[VAL]]
|
2013-09-04 19:53:46 +00:00
|
|
|
; IG 0: Get the byte index and truncate the value
|
|
|
|
; EG-CHECK: AND_INT T{{[0-9]}}.[[BI_CHAN:[XYZW]]], KC0[2].Y, literal.x
|
|
|
|
; EG-CHECK-NEXT: AND_INT * T{{[0-9]}}.[[TRUNC_CHAN:[XYZW]]], [[VAL]], literal.y
|
|
|
|
; EG-CHECK-NEXT: 3(4.203895e-45), 255(3.573311e-43)
|
|
|
|
; IG 1: Truncate the calculated the shift amount for the mask
|
|
|
|
; EG-CHECK: LSHL * T{{[0-9]}}.[[SHIFT_CHAN:[XYZW]]], PV.[[BI_CHAN]], literal.x
|
2013-08-16 01:12:06 +00:00
|
|
|
; EG-CHECK-NEXT: 3
|
|
|
|
; IG 2: Shift the value and the mask
|
2013-09-04 19:53:46 +00:00
|
|
|
; EG-CHECK: LSHL T[[RW_GPR]].X, T{{[0-9]}}.[[TRUNC_CHAN]], PV.[[SHIFT_CHAN]]
|
2013-08-16 01:12:06 +00:00
|
|
|
; EG-CHECK: LSHL * T[[RW_GPR]].W, literal.x, PV.[[SHIFT_CHAN]]
|
|
|
|
; EG-CHECK-NEXT: 255
|
|
|
|
; IG 3: Initialize the Y and Z channels to zero
|
|
|
|
; XXX: An optimal scheduler should merge this into one of the prevous IGs.
|
|
|
|
; EG-CHECK: MOV T[[RW_GPR]].Y, 0.0
|
|
|
|
; EG-CHECK: MOV * T[[RW_GPR]].Z, 0.0
|
|
|
|
|
2014-10-01 17:15:17 +00:00
|
|
|
; SI-CHECK-LABEL: {{^}}store_i8:
|
2013-08-16 01:12:06 +00:00
|
|
|
; SI-CHECK: BUFFER_STORE_BYTE
|
|
|
|
|
|
|
|
define void @store_i8(i8 addrspace(1)* %out, i8 %in) {
|
|
|
|
entry:
|
|
|
|
store i8 %in, i8 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; i16 store
|
2014-10-01 17:15:17 +00:00
|
|
|
; EG-CHECK-LABEL: {{^}}store_i16:
|
2013-08-16 01:12:06 +00:00
|
|
|
; EG-CHECK: MEM_RAT MSKOR T[[RW_GPR:[0-9]]].XW, T{{[0-9]}}.X
|
|
|
|
; EG-CHECK: VTX_READ_16 [[VAL:T[0-9]\.X]], [[VAL]]
|
2013-09-04 19:53:46 +00:00
|
|
|
; IG 0: Get the byte index and truncate the value
|
|
|
|
; EG-CHECK: AND_INT T{{[0-9]}}.[[BI_CHAN:[XYZW]]], KC0[2].Y, literal.x
|
|
|
|
; EG-CHECK: AND_INT * T{{[0-9]}}.[[TRUNC_CHAN:[XYZW]]], [[VAL]], literal.y
|
|
|
|
; EG-CHECK-NEXT: 3(4.203895e-45), 65535(9.183409e-41)
|
|
|
|
; IG 1: Truncate the calculated the shift amount for the mask
|
|
|
|
; EG-CHECK: LSHL * T{{[0-9]}}.[[SHIFT_CHAN:[XYZW]]], PV.[[BI_CHAN]], literal.x
|
|
|
|
; EG-CHECK: 3
|
2013-08-16 01:12:06 +00:00
|
|
|
; IG 2: Shift the value and the mask
|
2013-09-04 19:53:46 +00:00
|
|
|
; EG-CHECK: LSHL T[[RW_GPR]].X, T{{[0-9]}}.[[TRUNC_CHAN]], PV.[[SHIFT_CHAN]]
|
2013-08-16 01:12:06 +00:00
|
|
|
; EG-CHECK: LSHL * T[[RW_GPR]].W, literal.x, PV.[[SHIFT_CHAN]]
|
|
|
|
; EG-CHECK-NEXT: 65535
|
|
|
|
; IG 3: Initialize the Y and Z channels to zero
|
|
|
|
; XXX: An optimal scheduler should merge this into one of the prevous IGs.
|
|
|
|
; EG-CHECK: MOV T[[RW_GPR]].Y, 0.0
|
|
|
|
; EG-CHECK: MOV * T[[RW_GPR]].Z, 0.0
|
|
|
|
|
2014-10-01 17:15:17 +00:00
|
|
|
; SI-CHECK-LABEL: {{^}}store_i16:
|
2013-08-16 01:12:06 +00:00
|
|
|
; SI-CHECK: BUFFER_STORE_SHORT
|
|
|
|
define void @store_i16(i16 addrspace(1)* %out, i16 %in) {
|
|
|
|
entry:
|
|
|
|
store i16 %in, i16 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-10-01 17:15:17 +00:00
|
|
|
; EG-CHECK-LABEL: {{^}}store_v2i8:
|
2013-08-16 01:12:11 +00:00
|
|
|
; EG-CHECK: MEM_RAT MSKOR
|
|
|
|
; EG-CHECK-NOT: MEM_RAT MSKOR
|
2014-10-01 17:15:17 +00:00
|
|
|
; SI-CHECK-LABEL: {{^}}store_v2i8:
|
2013-08-16 01:12:11 +00:00
|
|
|
; SI-CHECK: BUFFER_STORE_BYTE
|
|
|
|
; SI-CHECK: BUFFER_STORE_BYTE
|
|
|
|
define void @store_v2i8(<2 x i8> addrspace(1)* %out, <2 x i32> %in) {
|
|
|
|
entry:
|
|
|
|
%0 = trunc <2 x i32> %in to <2 x i8>
|
|
|
|
store <2 x i8> %0, <2 x i8> addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-10-01 17:15:17 +00:00
|
|
|
; EG-CHECK-LABEL: {{^}}store_v2i16:
|
2013-08-16 01:12:11 +00:00
|
|
|
; EG-CHECK: MEM_RAT_CACHELESS STORE_RAW
|
2014-10-01 17:15:17 +00:00
|
|
|
; CM-CHECK-LABEL: {{^}}store_v2i16:
|
2013-08-16 01:12:11 +00:00
|
|
|
; CM-CHECK: MEM_RAT_CACHELESS STORE_DWORD
|
2014-10-01 17:15:17 +00:00
|
|
|
; SI-CHECK-LABEL: {{^}}store_v2i16:
|
2013-10-23 00:44:32 +00:00
|
|
|
; SI-CHECK: BUFFER_STORE_SHORT
|
|
|
|
; SI-CHECK: BUFFER_STORE_SHORT
|
2013-08-16 01:12:11 +00:00
|
|
|
define void @store_v2i16(<2 x i16> addrspace(1)* %out, <2 x i32> %in) {
|
|
|
|
entry:
|
|
|
|
%0 = trunc <2 x i32> %in to <2 x i16>
|
|
|
|
store <2 x i16> %0, <2 x i16> addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-10-01 17:15:17 +00:00
|
|
|
; EG-CHECK-LABEL: {{^}}store_v4i8:
|
2013-08-16 01:12:11 +00:00
|
|
|
; EG-CHECK: MEM_RAT_CACHELESS STORE_RAW
|
2014-10-01 17:15:17 +00:00
|
|
|
; CM-CHECK-LABEL: {{^}}store_v4i8:
|
2013-08-16 01:12:11 +00:00
|
|
|
; CM-CHECK: MEM_RAT_CACHELESS STORE_DWORD
|
2014-10-01 17:15:17 +00:00
|
|
|
; SI-CHECK-LABEL: {{^}}store_v4i8:
|
2013-08-16 01:12:11 +00:00
|
|
|
; SI-CHECK: BUFFER_STORE_BYTE
|
|
|
|
; SI-CHECK: BUFFER_STORE_BYTE
|
|
|
|
; SI-CHECK: BUFFER_STORE_BYTE
|
|
|
|
; SI-CHECK: BUFFER_STORE_BYTE
|
|
|
|
define void @store_v4i8(<4 x i8> addrspace(1)* %out, <4 x i32> %in) {
|
|
|
|
entry:
|
|
|
|
%0 = trunc <4 x i32> %in to <4 x i8>
|
|
|
|
store <4 x i8> %0, <4 x i8> addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2013-04-19 02:10:53 +00:00
|
|
|
; floating-point store
|
2014-10-01 17:15:17 +00:00
|
|
|
; EG-CHECK-LABEL: {{^}}store_f32:
|
2013-08-16 01:11:46 +00:00
|
|
|
; EG-CHECK: MEM_RAT_CACHELESS STORE_RAW T{{[0-9]+\.X, T[0-9]+\.X}}, 1
|
2014-10-01 17:15:17 +00:00
|
|
|
; CM-CHECK-LABEL: {{^}}store_f32:
|
2013-08-16 01:11:46 +00:00
|
|
|
; CM-CHECK: MEM_RAT_CACHELESS STORE_DWORD T{{[0-9]+\.X, T[0-9]+\.X}}
|
2014-10-01 17:15:17 +00:00
|
|
|
; SI-CHECK-LABEL: {{^}}store_f32:
|
2013-04-05 23:31:51 +00:00
|
|
|
; SI-CHECK: BUFFER_STORE_DWORD
|
|
|
|
|
2013-04-19 02:10:53 +00:00
|
|
|
define void @store_f32(float addrspace(1)* %out, float %in) {
|
2013-04-05 23:31:51 +00:00
|
|
|
store float %in, float addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
2013-06-25 02:39:35 +00:00
|
|
|
|
2014-10-01 17:15:17 +00:00
|
|
|
; EG-CHECK-LABEL: {{^}}store_v4i16:
|
2013-08-16 01:12:11 +00:00
|
|
|
; EG-CHECK: MEM_RAT MSKOR
|
|
|
|
; EG-CHECK: MEM_RAT MSKOR
|
|
|
|
; EG-CHECK: MEM_RAT MSKOR
|
|
|
|
; EG-CHECK: MEM_RAT MSKOR
|
|
|
|
; EG-CHECK-NOT: MEM_RAT MSKOR
|
2014-10-01 17:15:17 +00:00
|
|
|
; SI-CHECK-LABEL: {{^}}store_v4i16:
|
2013-08-16 01:12:11 +00:00
|
|
|
; SI-CHECK: BUFFER_STORE_SHORT
|
|
|
|
; SI-CHECK: BUFFER_STORE_SHORT
|
|
|
|
; SI-CHECK: BUFFER_STORE_SHORT
|
|
|
|
; SI-CHECK: BUFFER_STORE_SHORT
|
|
|
|
; SI-CHECK-NOT: BUFFER_STORE_BYTE
|
|
|
|
define void @store_v4i16(<4 x i16> addrspace(1)* %out, <4 x i32> %in) {
|
|
|
|
entry:
|
|
|
|
%0 = trunc <4 x i32> %in to <4 x i16>
|
|
|
|
store <4 x i16> %0, <4 x i16> addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2013-07-18 21:43:42 +00:00
|
|
|
; vec2 floating-point stores
|
2014-10-01 17:15:17 +00:00
|
|
|
; EG-CHECK-LABEL: {{^}}store_v2f32:
|
2013-08-16 01:11:46 +00:00
|
|
|
; EG-CHECK: MEM_RAT_CACHELESS STORE_RAW
|
2014-10-01 17:15:17 +00:00
|
|
|
; CM-CHECK-LABEL: {{^}}store_v2f32:
|
2013-08-16 01:11:46 +00:00
|
|
|
; CM-CHECK: MEM_RAT_CACHELESS STORE_DWORD
|
2014-10-01 17:15:17 +00:00
|
|
|
; SI-CHECK-LABEL: {{^}}store_v2f32:
|
2013-07-18 21:43:42 +00:00
|
|
|
; SI-CHECK: BUFFER_STORE_DWORDX2
|
|
|
|
|
|
|
|
define void @store_v2f32(<2 x float> addrspace(1)* %out, float %a, float %b) {
|
|
|
|
entry:
|
|
|
|
%0 = insertelement <2 x float> <float 0.0, float 0.0>, float %a, i32 0
|
2013-08-14 23:24:32 +00:00
|
|
|
%1 = insertelement <2 x float> %0, float %b, i32 1
|
2013-07-18 21:43:42 +00:00
|
|
|
store <2 x float> %1, <2 x float> addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-10-01 17:15:17 +00:00
|
|
|
; EG-CHECK-LABEL: {{^}}store_v4i32:
|
2013-08-16 01:12:00 +00:00
|
|
|
; EG-CHECK: MEM_RAT_CACHELESS STORE_RAW
|
|
|
|
; EG-CHECK-NOT: MEM_RAT_CACHELESS STORE_RAW
|
2014-10-01 17:15:17 +00:00
|
|
|
; CM-CHECK-LABEL: {{^}}store_v4i32:
|
2013-08-16 01:12:00 +00:00
|
|
|
; CM-CHECK: MEM_RAT_CACHELESS STORE_DWORD
|
|
|
|
; CM-CHECK-NOT: MEM_RAT_CACHELESS STORE_DWORD
|
2014-10-01 17:15:17 +00:00
|
|
|
; SI-CHECK-LABEL: {{^}}store_v4i32:
|
2013-08-16 01:12:00 +00:00
|
|
|
; SI-CHECK: BUFFER_STORE_DWORDX4
|
|
|
|
define void @store_v4i32(<4 x i32> addrspace(1)* %out, <4 x i32> %in) {
|
|
|
|
entry:
|
|
|
|
store <4 x i32> %in, <4 x i32> addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-10-01 17:15:17 +00:00
|
|
|
; FUNC-LABEL: {{^}}store_i64_i8:
|
2014-05-02 15:41:46 +00:00
|
|
|
; EG-CHECK: MEM_RAT MSKOR
|
|
|
|
; SI-CHECK: BUFFER_STORE_BYTE
|
|
|
|
define void @store_i64_i8(i8 addrspace(1)* %out, i64 %in) {
|
|
|
|
entry:
|
|
|
|
%0 = trunc i64 %in to i8
|
|
|
|
store i8 %0, i8 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-10-01 17:15:17 +00:00
|
|
|
; FUNC-LABEL: {{^}}store_i64_i16:
|
2014-05-02 15:41:46 +00:00
|
|
|
; EG-CHECK: MEM_RAT MSKOR
|
|
|
|
; SI-CHECK: BUFFER_STORE_SHORT
|
|
|
|
define void @store_i64_i16(i16 addrspace(1)* %out, i64 %in) {
|
|
|
|
entry:
|
|
|
|
%0 = trunc i64 %in to i16
|
|
|
|
store i16 %0, i16 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2013-08-26 15:05:44 +00:00
|
|
|
;===------------------------------------------------------------------------===;
|
|
|
|
; Local Address Space
|
|
|
|
;===------------------------------------------------------------------------===;
|
|
|
|
|
2014-10-01 17:15:17 +00:00
|
|
|
; FUNC-LABEL: {{^}}store_local_i1:
|
2014-03-07 20:12:33 +00:00
|
|
|
; EG-CHECK: LDS_BYTE_WRITE
|
|
|
|
; SI-CHECK: DS_WRITE_B8
|
|
|
|
define void @store_local_i1(i1 addrspace(3)* %out) {
|
|
|
|
entry:
|
|
|
|
store i1 true, i1 addrspace(3)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-10-01 17:15:17 +00:00
|
|
|
; EG-CHECK-LABEL: {{^}}store_local_i8:
|
2013-08-26 15:05:49 +00:00
|
|
|
; EG-CHECK: LDS_BYTE_WRITE
|
2014-10-01 17:15:17 +00:00
|
|
|
; SI-CHECK-LABEL: {{^}}store_local_i8:
|
2013-08-26 15:05:49 +00:00
|
|
|
; SI-CHECK: DS_WRITE_B8
|
|
|
|
define void @store_local_i8(i8 addrspace(3)* %out, i8 %in) {
|
|
|
|
store i8 %in, i8 addrspace(3)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-10-01 17:15:17 +00:00
|
|
|
; EG-CHECK-LABEL: {{^}}store_local_i16:
|
2013-08-26 15:05:49 +00:00
|
|
|
; EG-CHECK: LDS_SHORT_WRITE
|
2014-10-01 17:15:17 +00:00
|
|
|
; SI-CHECK-LABEL: {{^}}store_local_i16:
|
2013-08-26 15:05:49 +00:00
|
|
|
; SI-CHECK: DS_WRITE_B16
|
|
|
|
define void @store_local_i16(i16 addrspace(3)* %out, i16 %in) {
|
|
|
|
store i16 %in, i16 addrspace(3)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-10-01 17:15:17 +00:00
|
|
|
; EG-CHECK-LABEL: {{^}}store_local_v2i16:
|
2013-08-26 15:05:44 +00:00
|
|
|
; EG-CHECK: LDS_WRITE
|
2014-10-01 17:15:17 +00:00
|
|
|
; CM-CHECK-LABEL: {{^}}store_local_v2i16:
|
2013-08-26 15:05:44 +00:00
|
|
|
; CM-CHECK: LDS_WRITE
|
2014-10-01 17:15:17 +00:00
|
|
|
; SI-CHECK-LABEL: {{^}}store_local_v2i16:
|
2013-10-23 00:44:32 +00:00
|
|
|
; SI-CHECK: DS_WRITE_B16
|
|
|
|
; SI-CHECK: DS_WRITE_B16
|
2013-08-26 15:05:44 +00:00
|
|
|
define void @store_local_v2i16(<2 x i16> addrspace(3)* %out, <2 x i16> %in) {
|
|
|
|
entry:
|
|
|
|
store <2 x i16> %in, <2 x i16> addrspace(3)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-10-01 17:15:17 +00:00
|
|
|
; EG-CHECK-LABEL: {{^}}store_local_v4i8:
|
2013-08-26 15:05:55 +00:00
|
|
|
; EG-CHECK: LDS_WRITE
|
2014-10-01 17:15:17 +00:00
|
|
|
; CM-CHECK-LABEL: {{^}}store_local_v4i8:
|
2013-08-26 15:05:55 +00:00
|
|
|
; CM-CHECK: LDS_WRITE
|
2014-10-01 17:15:17 +00:00
|
|
|
; SI-CHECK-LABEL: {{^}}store_local_v4i8:
|
2013-08-26 15:05:55 +00:00
|
|
|
; SI-CHECK: DS_WRITE_B8
|
|
|
|
; SI-CHECK: DS_WRITE_B8
|
|
|
|
; SI-CHECK: DS_WRITE_B8
|
|
|
|
; SI-CHECK: DS_WRITE_B8
|
|
|
|
define void @store_local_v4i8(<4 x i8> addrspace(3)* %out, <4 x i8> %in) {
|
|
|
|
entry:
|
|
|
|
store <4 x i8> %in, <4 x i8> addrspace(3)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-10-01 17:15:17 +00:00
|
|
|
; EG-CHECK-LABEL: {{^}}store_local_v2i32:
|
2013-08-26 15:05:44 +00:00
|
|
|
; EG-CHECK: LDS_WRITE
|
|
|
|
; EG-CHECK: LDS_WRITE
|
2014-10-01 17:15:17 +00:00
|
|
|
; CM-CHECK-LABEL: {{^}}store_local_v2i32:
|
2013-08-26 15:05:44 +00:00
|
|
|
; CM-CHECK: LDS_WRITE
|
|
|
|
; CM-CHECK: LDS_WRITE
|
2014-10-01 17:15:17 +00:00
|
|
|
; SI-CHECK-LABEL: {{^}}store_local_v2i32:
|
2014-06-24 23:33:04 +00:00
|
|
|
; SI-CHECK: DS_WRITE_B64
|
2013-08-26 15:05:44 +00:00
|
|
|
define void @store_local_v2i32(<2 x i32> addrspace(3)* %out, <2 x i32> %in) {
|
|
|
|
entry:
|
|
|
|
store <2 x i32> %in, <2 x i32> addrspace(3)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-10-01 17:15:17 +00:00
|
|
|
; EG-CHECK-LABEL: {{^}}store_local_v4i32:
|
2013-08-26 15:05:44 +00:00
|
|
|
; EG-CHECK: LDS_WRITE
|
|
|
|
; EG-CHECK: LDS_WRITE
|
|
|
|
; EG-CHECK: LDS_WRITE
|
|
|
|
; EG-CHECK: LDS_WRITE
|
2014-10-01 17:15:17 +00:00
|
|
|
; CM-CHECK-LABEL: {{^}}store_local_v4i32:
|
2013-08-26 15:05:44 +00:00
|
|
|
; CM-CHECK: LDS_WRITE
|
|
|
|
; CM-CHECK: LDS_WRITE
|
|
|
|
; CM-CHECK: LDS_WRITE
|
|
|
|
; CM-CHECK: LDS_WRITE
|
2014-10-01 17:15:17 +00:00
|
|
|
; SI-CHECK-LABEL: {{^}}store_local_v4i32:
|
2013-08-26 15:05:44 +00:00
|
|
|
; SI-CHECK: DS_WRITE_B32
|
|
|
|
; SI-CHECK: DS_WRITE_B32
|
|
|
|
; SI-CHECK: DS_WRITE_B32
|
|
|
|
; SI-CHECK: DS_WRITE_B32
|
|
|
|
define void @store_local_v4i32(<4 x i32> addrspace(3)* %out, <4 x i32> %in) {
|
|
|
|
entry:
|
|
|
|
store <4 x i32> %in, <4 x i32> addrspace(3)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-10-01 17:15:17 +00:00
|
|
|
; FUNC-LABEL: {{^}}store_local_i64_i8:
|
2014-05-02 15:41:46 +00:00
|
|
|
; EG-CHECK: LDS_BYTE_WRITE
|
|
|
|
; SI-CHECK: DS_WRITE_B8
|
|
|
|
define void @store_local_i64_i8(i8 addrspace(3)* %out, i64 %in) {
|
|
|
|
entry:
|
|
|
|
%0 = trunc i64 %in to i8
|
|
|
|
store i8 %0, i8 addrspace(3)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-10-01 17:15:17 +00:00
|
|
|
; FUNC-LABEL: {{^}}store_local_i64_i16:
|
2014-05-02 15:41:46 +00:00
|
|
|
; EG-CHECK: LDS_SHORT_WRITE
|
|
|
|
; SI-CHECK: DS_WRITE_B16
|
|
|
|
define void @store_local_i64_i16(i16 addrspace(3)* %out, i64 %in) {
|
|
|
|
entry:
|
|
|
|
%0 = trunc i64 %in to i16
|
|
|
|
store i16 %0, i16 addrspace(3)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2013-06-25 02:39:35 +00:00
|
|
|
; The stores in this function are combined by the optimizer to create a
|
|
|
|
; 64-bit store with 32-bit alignment. This is legal for SI and the legalizer
|
|
|
|
; should not try to split the 64-bit store back into 2 32-bit stores.
|
|
|
|
;
|
|
|
|
; Evergreen / Northern Islands don't support 64-bit stores yet, so there should
|
|
|
|
; be two 32-bit stores.
|
|
|
|
|
2014-10-01 17:15:17 +00:00
|
|
|
; EG-CHECK-LABEL: {{^}}vecload2:
|
2013-08-16 01:11:46 +00:00
|
|
|
; EG-CHECK: MEM_RAT_CACHELESS STORE_RAW
|
2014-10-01 17:15:17 +00:00
|
|
|
; CM-CHECK-LABEL: {{^}}vecload2:
|
2013-08-16 01:11:46 +00:00
|
|
|
; CM-CHECK: MEM_RAT_CACHELESS STORE_DWORD
|
2014-10-01 17:15:17 +00:00
|
|
|
; SI-CHECK-LABEL: {{^}}vecload2:
|
2013-06-25 02:39:35 +00:00
|
|
|
; SI-CHECK: BUFFER_STORE_DWORDX2
|
|
|
|
define void @vecload2(i32 addrspace(1)* nocapture %out, i32 addrspace(2)* nocapture %mem) #0 {
|
|
|
|
entry:
|
2013-09-30 18:17:35 +00:00
|
|
|
%0 = load i32 addrspace(2)* %mem, align 4
|
2013-06-25 02:39:35 +00:00
|
|
|
%arrayidx1.i = getelementptr inbounds i32 addrspace(2)* %mem, i64 1
|
2013-09-30 18:17:35 +00:00
|
|
|
%1 = load i32 addrspace(2)* %arrayidx1.i, align 4
|
|
|
|
store i32 %0, i32 addrspace(1)* %out, align 4
|
2013-06-25 02:39:35 +00:00
|
|
|
%arrayidx1 = getelementptr inbounds i32 addrspace(1)* %out, i64 1
|
2013-09-30 18:17:35 +00:00
|
|
|
store i32 %1, i32 addrspace(1)* %arrayidx1, align 4
|
2013-06-25 02:39:35 +00:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2013-08-22 21:28:54 +00:00
|
|
|
attributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
|
2014-04-17 21:00:11 +00:00
|
|
|
|
|
|
|
; When i128 was a legal type this program generated cannot select errors:
|
|
|
|
|
2014-10-01 17:15:17 +00:00
|
|
|
; FUNC-LABEL: {{^}}"i128-const-store":
|
2014-04-17 21:00:11 +00:00
|
|
|
; FIXME: We should be able to to this with one store instruction
|
|
|
|
; EG-CHECK: STORE_RAW
|
|
|
|
; EG-CHECK: STORE_RAW
|
|
|
|
; EG-CHECK: STORE_RAW
|
|
|
|
; EG-CHECK: STORE_RAW
|
|
|
|
; CM-CHECK: STORE_DWORD
|
|
|
|
; CM-CHECK: STORE_DWORD
|
|
|
|
; CM-CHECK: STORE_DWORD
|
|
|
|
; CM-CHECK: STORE_DWORD
|
|
|
|
; SI: BUFFER_STORE_DWORDX2
|
|
|
|
; SI: BUFFER_STORE_DWORDX2
|
|
|
|
define void @i128-const-store(i32 addrspace(1)* %out) {
|
|
|
|
entry:
|
|
|
|
store i32 1, i32 addrspace(1)* %out, align 4
|
|
|
|
%arrayidx2 = getelementptr inbounds i32 addrspace(1)* %out, i64 1
|
|
|
|
store i32 1, i32 addrspace(1)* %arrayidx2, align 4
|
|
|
|
%arrayidx4 = getelementptr inbounds i32 addrspace(1)* %out, i64 2
|
|
|
|
store i32 2, i32 addrspace(1)* %arrayidx4, align 4
|
|
|
|
%arrayidx6 = getelementptr inbounds i32 addrspace(1)* %out, i64 3
|
|
|
|
store i32 2, i32 addrspace(1)* %arrayidx6, align 4
|
|
|
|
ret void
|
|
|
|
}
|