2019-04-22 12:19:09 +02:00
|
|
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
2020-03-29 16:10:28 +02:00
|
|
|
; RUN: llc -mtriple=amdgcn-- -mcpu=tahiti -verify-machineinstrs < %s | FileCheck %s -check-prefixes=GCN,SI
|
|
|
|
; RUN: llc -mtriple=amdgcn-- -mcpu=tonga -mattr=-flat-for-global -verify-machineinstrs < %s | FileCheck %s -check-prefixes=GCN,VI
|
2021-03-29 11:12:46 +02:00
|
|
|
; RUN: llc -mtriple=amdgcn-- -mcpu=gfx1010 -verify-machineinstrs < %s | FileCheck %s -check-prefixes=GFX10
|
2014-06-11 19:50:44 +02:00
|
|
|
|
2016-10-07 16:22:58 +02:00
|
|
|
declare i32 @llvm.amdgcn.workitem.id.x() nounwind readnone
|
|
|
|
declare i32 @llvm.amdgcn.workitem.id.y() nounwind readnone
|
|
|
|
|
2020-03-29 16:10:28 +02:00
|
|
|
define float @v_uitofp_i32_to_f32_mask255(i32 %arg0) nounwind {
|
|
|
|
; GCN-LABEL: v_uitofp_i32_to_f32_mask255:
|
|
|
|
; GCN: ; %bb.0:
|
|
|
|
; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; GCN-NEXT: v_cvt_f32_ubyte0_e32 v0, v0
|
|
|
|
; GCN-NEXT: s_setpc_b64 s[30:31]
|
2021-03-29 11:12:46 +02:00
|
|
|
;
|
|
|
|
; GFX10-LABEL: v_uitofp_i32_to_f32_mask255:
|
|
|
|
; GFX10: ; %bb.0:
|
|
|
|
; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte0_e32 v0, v0
|
|
|
|
; GFX10-NEXT: s_setpc_b64 s[30:31]
|
2020-03-29 16:10:28 +02:00
|
|
|
%masked = and i32 %arg0, 255
|
|
|
|
%cvt = uitofp i32 %masked to float
|
|
|
|
ret float %cvt
|
|
|
|
}
|
|
|
|
|
|
|
|
define float @v_sitofp_i32_to_f32_mask255(i32 %arg0) nounwind {
|
|
|
|
; GCN-LABEL: v_sitofp_i32_to_f32_mask255:
|
|
|
|
; GCN: ; %bb.0:
|
|
|
|
; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; GCN-NEXT: v_cvt_f32_ubyte0_e32 v0, v0
|
|
|
|
; GCN-NEXT: s_setpc_b64 s[30:31]
|
2021-03-29 11:12:46 +02:00
|
|
|
;
|
|
|
|
; GFX10-LABEL: v_sitofp_i32_to_f32_mask255:
|
|
|
|
; GFX10: ; %bb.0:
|
|
|
|
; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte0_e32 v0, v0
|
|
|
|
; GFX10-NEXT: s_setpc_b64 s[30:31]
|
2020-03-29 16:10:28 +02:00
|
|
|
%masked = and i32 %arg0, 255
|
|
|
|
%cvt = sitofp i32 %masked to float
|
|
|
|
ret float %cvt
|
|
|
|
}
|
|
|
|
|
|
|
|
define float @v_uitofp_to_f32_lshr7_mask255(i32 %arg0) nounwind {
|
|
|
|
; GCN-LABEL: v_uitofp_to_f32_lshr7_mask255:
|
|
|
|
; GCN: ; %bb.0:
|
|
|
|
; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; GCN-NEXT: v_lshrrev_b32_e32 v0, 7, v0
|
|
|
|
; GCN-NEXT: v_cvt_f32_ubyte0_e32 v0, v0
|
|
|
|
; GCN-NEXT: s_setpc_b64 s[30:31]
|
2021-03-29 11:12:46 +02:00
|
|
|
;
|
|
|
|
; GFX10-LABEL: v_uitofp_to_f32_lshr7_mask255:
|
|
|
|
; GFX10: ; %bb.0:
|
|
|
|
; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
|
|
|
|
; GFX10-NEXT: v_lshrrev_b32_e32 v0, 7, v0
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte0_e32 v0, v0
|
|
|
|
; GFX10-NEXT: s_setpc_b64 s[30:31]
|
2020-03-29 16:10:28 +02:00
|
|
|
%lshr.7 = lshr i32 %arg0, 7
|
|
|
|
%masked = and i32 %lshr.7, 255
|
|
|
|
%cvt = uitofp i32 %masked to float
|
|
|
|
ret float %cvt
|
|
|
|
}
|
|
|
|
|
|
|
|
define float @v_uitofp_to_f32_lshr8_mask255(i32 %arg0) nounwind {
|
|
|
|
; GCN-LABEL: v_uitofp_to_f32_lshr8_mask255:
|
|
|
|
; GCN: ; %bb.0:
|
|
|
|
; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; GCN-NEXT: v_cvt_f32_ubyte1_e32 v0, v0
|
|
|
|
; GCN-NEXT: s_setpc_b64 s[30:31]
|
2021-03-29 11:12:46 +02:00
|
|
|
;
|
|
|
|
; GFX10-LABEL: v_uitofp_to_f32_lshr8_mask255:
|
|
|
|
; GFX10: ; %bb.0:
|
|
|
|
; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte1_e32 v0, v0
|
|
|
|
; GFX10-NEXT: s_setpc_b64 s[30:31]
|
2020-03-29 16:10:28 +02:00
|
|
|
%lshr.8 = lshr i32 %arg0, 8
|
|
|
|
%masked = and i32 %lshr.8, 255
|
|
|
|
%cvt = uitofp i32 %masked to float
|
|
|
|
ret float %cvt
|
|
|
|
}
|
|
|
|
|
|
|
|
define float @v_uitofp_to_f32_multi_use_lshr8_mask255(i32 %arg0) nounwind {
|
2020-09-23 17:16:39 +02:00
|
|
|
; SI-LABEL: v_uitofp_to_f32_multi_use_lshr8_mask255:
|
|
|
|
; SI: ; %bb.0:
|
|
|
|
; SI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; SI-NEXT: v_lshrrev_b32_e32 v1, 8, v0
|
|
|
|
; SI-NEXT: v_cvt_f32_ubyte1_e32 v0, v0
|
|
|
|
; SI-NEXT: s_mov_b32 s7, 0xf000
|
|
|
|
; SI-NEXT: s_mov_b32 s6, -1
|
|
|
|
; SI-NEXT: buffer_store_dword v1, off, s[4:7], 0
|
|
|
|
; SI-NEXT: s_waitcnt vmcnt(0) expcnt(0)
|
|
|
|
; SI-NEXT: s_setpc_b64 s[30:31]
|
|
|
|
;
|
|
|
|
; VI-LABEL: v_uitofp_to_f32_multi_use_lshr8_mask255:
|
|
|
|
; VI: ; %bb.0:
|
|
|
|
; VI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; VI-NEXT: v_lshrrev_b32_e32 v1, 8, v0
|
|
|
|
; VI-NEXT: v_cvt_f32_ubyte1_e32 v0, v0
|
|
|
|
; VI-NEXT: s_mov_b32 s7, 0xf000
|
|
|
|
; VI-NEXT: s_mov_b32 s6, -1
|
|
|
|
; VI-NEXT: buffer_store_dword v1, off, s[4:7], 0
|
|
|
|
; VI-NEXT: s_waitcnt vmcnt(0)
|
|
|
|
; VI-NEXT: s_setpc_b64 s[30:31]
|
2021-03-29 11:12:46 +02:00
|
|
|
;
|
|
|
|
; GFX10-LABEL: v_uitofp_to_f32_multi_use_lshr8_mask255:
|
|
|
|
; GFX10: ; %bb.0:
|
|
|
|
; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
|
|
|
|
; GFX10-NEXT: v_lshrrev_b32_e32 v1, 8, v0
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte1_e32 v0, v0
|
|
|
|
; GFX10-NEXT: global_store_dword v[0:1], v1, off
|
|
|
|
; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
|
|
|
|
; GFX10-NEXT: s_setpc_b64 s[30:31]
|
2020-03-29 16:10:28 +02:00
|
|
|
%lshr.8 = lshr i32 %arg0, 8
|
|
|
|
store i32 %lshr.8, i32 addrspace(1)* undef
|
|
|
|
%masked = and i32 %lshr.8, 255
|
|
|
|
%cvt = uitofp i32 %masked to float
|
|
|
|
ret float %cvt
|
|
|
|
}
|
|
|
|
|
|
|
|
define float @v_uitofp_to_f32_lshr16_mask255(i32 %arg0) nounwind {
|
|
|
|
; GCN-LABEL: v_uitofp_to_f32_lshr16_mask255:
|
|
|
|
; GCN: ; %bb.0:
|
|
|
|
; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; GCN-NEXT: v_cvt_f32_ubyte2_e32 v0, v0
|
|
|
|
; GCN-NEXT: s_setpc_b64 s[30:31]
|
2021-03-29 11:12:46 +02:00
|
|
|
;
|
|
|
|
; GFX10-LABEL: v_uitofp_to_f32_lshr16_mask255:
|
|
|
|
; GFX10: ; %bb.0:
|
|
|
|
; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte2_e32 v0, v0
|
|
|
|
; GFX10-NEXT: s_setpc_b64 s[30:31]
|
2020-03-29 16:10:28 +02:00
|
|
|
%lshr.16 = lshr i32 %arg0, 16
|
|
|
|
%masked = and i32 %lshr.16, 255
|
|
|
|
%cvt = uitofp i32 %masked to float
|
|
|
|
ret float %cvt
|
|
|
|
}
|
|
|
|
|
|
|
|
define float @v_uitofp_to_f32_lshr24_mask255(i32 %arg0) nounwind {
|
|
|
|
; GCN-LABEL: v_uitofp_to_f32_lshr24_mask255:
|
|
|
|
; GCN: ; %bb.0:
|
|
|
|
; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; GCN-NEXT: v_cvt_f32_ubyte3_e32 v0, v0
|
|
|
|
; GCN-NEXT: s_setpc_b64 s[30:31]
|
2021-03-29 11:12:46 +02:00
|
|
|
;
|
|
|
|
; GFX10-LABEL: v_uitofp_to_f32_lshr24_mask255:
|
|
|
|
; GFX10: ; %bb.0:
|
|
|
|
; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte3_e32 v0, v0
|
|
|
|
; GFX10-NEXT: s_setpc_b64 s[30:31]
|
2020-03-29 16:10:28 +02:00
|
|
|
%lshr.16 = lshr i32 %arg0, 24
|
|
|
|
%masked = and i32 %lshr.16, 255
|
|
|
|
%cvt = uitofp i32 %masked to float
|
|
|
|
ret float %cvt
|
|
|
|
}
|
|
|
|
|
|
|
|
define float @v_uitofp_i8_to_f32(i8 %arg0) nounwind {
|
|
|
|
; GCN-LABEL: v_uitofp_i8_to_f32:
|
|
|
|
; GCN: ; %bb.0:
|
|
|
|
; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; GCN-NEXT: v_cvt_f32_ubyte0_e32 v0, v0
|
|
|
|
; GCN-NEXT: s_setpc_b64 s[30:31]
|
2021-03-29 11:12:46 +02:00
|
|
|
;
|
|
|
|
; GFX10-LABEL: v_uitofp_i8_to_f32:
|
|
|
|
; GFX10: ; %bb.0:
|
|
|
|
; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte0_e32 v0, v0
|
|
|
|
; GFX10-NEXT: s_setpc_b64 s[30:31]
|
2020-03-29 16:10:28 +02:00
|
|
|
%cvt = uitofp i8 %arg0 to float
|
|
|
|
ret float %cvt
|
|
|
|
}
|
|
|
|
|
|
|
|
define <2 x float> @v_uitofp_v2i8_to_v2f32(i16 %arg0) nounwind {
|
|
|
|
; GCN-LABEL: v_uitofp_v2i8_to_v2f32:
|
|
|
|
; GCN: ; %bb.0:
|
|
|
|
; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; GCN-NEXT: v_cvt_f32_ubyte0_e32 v2, v0
|
|
|
|
; GCN-NEXT: v_cvt_f32_ubyte1_e32 v1, v0
|
|
|
|
; GCN-NEXT: v_mov_b32_e32 v0, v2
|
|
|
|
; GCN-NEXT: s_setpc_b64 s[30:31]
|
2021-03-29 11:12:46 +02:00
|
|
|
;
|
|
|
|
; GFX10-LABEL: v_uitofp_v2i8_to_v2f32:
|
|
|
|
; GFX10: ; %bb.0:
|
|
|
|
; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte0_e32 v2, v0
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte1_e32 v1, v0
|
|
|
|
; GFX10-NEXT: v_mov_b32_e32 v0, v2
|
|
|
|
; GFX10-NEXT: s_setpc_b64 s[30:31]
|
2020-03-29 16:10:28 +02:00
|
|
|
%val = bitcast i16 %arg0 to <2 x i8>
|
|
|
|
%cvt = uitofp <2 x i8> %val to <2 x float>
|
|
|
|
ret <2 x float> %cvt
|
|
|
|
}
|
|
|
|
|
|
|
|
define <3 x float> @v_uitofp_v3i8_to_v3f32(i32 %arg0) nounwind {
|
|
|
|
; GCN-LABEL: v_uitofp_v3i8_to_v3f32:
|
|
|
|
; GCN: ; %bb.0:
|
|
|
|
; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; GCN-NEXT: v_cvt_f32_ubyte0_e32 v3, v0
|
|
|
|
; GCN-NEXT: v_cvt_f32_ubyte1_e32 v1, v0
|
|
|
|
; GCN-NEXT: v_cvt_f32_ubyte2_e32 v2, v0
|
|
|
|
; GCN-NEXT: v_mov_b32_e32 v0, v3
|
|
|
|
; GCN-NEXT: s_setpc_b64 s[30:31]
|
2021-03-29 11:12:46 +02:00
|
|
|
;
|
|
|
|
; GFX10-LABEL: v_uitofp_v3i8_to_v3f32:
|
|
|
|
; GFX10: ; %bb.0:
|
|
|
|
; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte0_e32 v3, v0
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte1_e32 v1, v0
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte2_e32 v2, v0
|
|
|
|
; GFX10-NEXT: v_mov_b32_e32 v0, v3
|
|
|
|
; GFX10-NEXT: s_setpc_b64 s[30:31]
|
2020-03-29 16:10:28 +02:00
|
|
|
%trunc = trunc i32 %arg0 to i24
|
|
|
|
%val = bitcast i24 %trunc to <3 x i8>
|
|
|
|
%cvt = uitofp <3 x i8> %val to <3 x float>
|
|
|
|
ret <3 x float> %cvt
|
|
|
|
}
|
|
|
|
|
|
|
|
define <4 x float> @v_uitofp_v4i8_to_v4f32(i32 %arg0) nounwind {
|
|
|
|
; GCN-LABEL: v_uitofp_v4i8_to_v4f32:
|
|
|
|
; GCN: ; %bb.0:
|
|
|
|
; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; GCN-NEXT: v_cvt_f32_ubyte0_e32 v4, v0
|
|
|
|
; GCN-NEXT: v_cvt_f32_ubyte1_e32 v1, v0
|
|
|
|
; GCN-NEXT: v_cvt_f32_ubyte2_e32 v2, v0
|
|
|
|
; GCN-NEXT: v_cvt_f32_ubyte3_e32 v3, v0
|
|
|
|
; GCN-NEXT: v_mov_b32_e32 v0, v4
|
|
|
|
; GCN-NEXT: s_setpc_b64 s[30:31]
|
2021-03-29 11:12:46 +02:00
|
|
|
;
|
|
|
|
; GFX10-LABEL: v_uitofp_v4i8_to_v4f32:
|
|
|
|
; GFX10: ; %bb.0:
|
|
|
|
; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte0_e32 v4, v0
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte1_e32 v1, v0
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte2_e32 v2, v0
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte3_e32 v3, v0
|
|
|
|
; GFX10-NEXT: v_mov_b32_e32 v0, v4
|
|
|
|
; GFX10-NEXT: s_setpc_b64 s[30:31]
|
2020-03-29 16:10:28 +02:00
|
|
|
%val = bitcast i32 %arg0 to <4 x i8>
|
|
|
|
%cvt = uitofp <4 x i8> %val to <4 x float>
|
|
|
|
ret <4 x float> %cvt
|
|
|
|
}
|
|
|
|
|
|
|
|
define <4 x float> @v_uitofp_unpack_i32_to_v4f32(i32 %arg0) nounwind {
|
|
|
|
; GCN-LABEL: v_uitofp_unpack_i32_to_v4f32:
|
|
|
|
; GCN: ; %bb.0:
|
|
|
|
; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; GCN-NEXT: v_cvt_f32_ubyte0_e32 v4, v0
|
|
|
|
; GCN-NEXT: v_cvt_f32_ubyte1_e32 v1, v0
|
|
|
|
; GCN-NEXT: v_cvt_f32_ubyte2_e32 v2, v0
|
|
|
|
; GCN-NEXT: v_cvt_f32_ubyte3_e32 v3, v0
|
|
|
|
; GCN-NEXT: v_mov_b32_e32 v0, v4
|
|
|
|
; GCN-NEXT: s_setpc_b64 s[30:31]
|
2021-03-29 11:12:46 +02:00
|
|
|
;
|
|
|
|
; GFX10-LABEL: v_uitofp_unpack_i32_to_v4f32:
|
|
|
|
; GFX10: ; %bb.0:
|
|
|
|
; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte0_e32 v4, v0
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte1_e32 v1, v0
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte2_e32 v2, v0
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte3_e32 v3, v0
|
|
|
|
; GFX10-NEXT: v_mov_b32_e32 v0, v4
|
|
|
|
; GFX10-NEXT: s_setpc_b64 s[30:31]
|
2020-03-29 16:10:28 +02:00
|
|
|
%mask.arg0 = and i32 %arg0, 255
|
|
|
|
%cvt0 = uitofp i32 %mask.arg0 to float
|
|
|
|
|
|
|
|
%lshr.8 = lshr i32 %arg0, 8
|
|
|
|
%mask.lshr.8 = and i32 %lshr.8, 255
|
|
|
|
%cvt1 = uitofp i32 %mask.lshr.8 to float
|
|
|
|
|
|
|
|
%lshr.16 = lshr i32 %arg0, 16
|
|
|
|
%mask.lshr.16 = and i32 %lshr.16, 255
|
|
|
|
%cvt2 = uitofp i32 %mask.lshr.16 to float
|
|
|
|
|
|
|
|
%lshr.24 = lshr i32 %arg0, 24
|
|
|
|
%mask.lshr.24 = and i32 %lshr.24, 255
|
|
|
|
%cvt3 = uitofp i32 %mask.lshr.24 to float
|
|
|
|
|
|
|
|
%ins.0 = insertelement <4 x float> undef, float %cvt0, i32 0
|
|
|
|
%ins.1 = insertelement <4 x float> %ins.0, float %cvt1, i32 1
|
|
|
|
%ins.2 = insertelement <4 x float> %ins.1, float %cvt2, i32 2
|
|
|
|
%ins.3 = insertelement <4 x float> %ins.2, float %cvt3, i32 3
|
|
|
|
ret <4 x float> %ins.3
|
|
|
|
}
|
|
|
|
|
|
|
|
define half @v_uitofp_i32_to_f16_mask255(i32 %arg0) nounwind {
|
|
|
|
; SI-LABEL: v_uitofp_i32_to_f16_mask255:
|
|
|
|
; SI: ; %bb.0:
|
|
|
|
; SI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; SI-NEXT: v_cvt_f32_ubyte0_e32 v0, v0
|
|
|
|
; SI-NEXT: v_cvt_f16_f32_e32 v0, v0
|
|
|
|
; SI-NEXT: v_cvt_f32_f16_e32 v0, v0
|
|
|
|
; SI-NEXT: s_setpc_b64 s[30:31]
|
|
|
|
;
|
|
|
|
; VI-LABEL: v_uitofp_i32_to_f16_mask255:
|
|
|
|
; VI: ; %bb.0:
|
|
|
|
; VI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
2020-03-29 16:26:16 +02:00
|
|
|
; VI-NEXT: v_cvt_f32_ubyte0_e32 v0, v0
|
2020-03-29 16:10:28 +02:00
|
|
|
; VI-NEXT: v_cvt_f16_f32_e32 v0, v0
|
|
|
|
; VI-NEXT: s_setpc_b64 s[30:31]
|
2021-03-29 11:12:46 +02:00
|
|
|
;
|
|
|
|
; GFX10-LABEL: v_uitofp_i32_to_f16_mask255:
|
|
|
|
; GFX10: ; %bb.0:
|
|
|
|
; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte0_e32 v0, v0
|
|
|
|
; GFX10-NEXT: v_cvt_f16_f32_e32 v0, v0
|
|
|
|
; GFX10-NEXT: s_setpc_b64 s[30:31]
|
2020-03-29 16:10:28 +02:00
|
|
|
%masked = and i32 %arg0, 255
|
|
|
|
%cvt = uitofp i32 %masked to half
|
|
|
|
ret half %cvt
|
|
|
|
}
|
|
|
|
|
|
|
|
define half @v_sitofp_i32_to_f16_mask255(i32 %arg0) nounwind {
|
|
|
|
; SI-LABEL: v_sitofp_i32_to_f16_mask255:
|
|
|
|
; SI: ; %bb.0:
|
|
|
|
; SI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; SI-NEXT: v_cvt_f32_ubyte0_e32 v0, v0
|
|
|
|
; SI-NEXT: v_cvt_f16_f32_e32 v0, v0
|
|
|
|
; SI-NEXT: v_cvt_f32_f16_e32 v0, v0
|
|
|
|
; SI-NEXT: s_setpc_b64 s[30:31]
|
|
|
|
;
|
|
|
|
; VI-LABEL: v_sitofp_i32_to_f16_mask255:
|
|
|
|
; VI: ; %bb.0:
|
|
|
|
; VI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
2020-03-29 16:26:16 +02:00
|
|
|
; VI-NEXT: v_cvt_f32_ubyte0_e32 v0, v0
|
2020-03-29 16:10:28 +02:00
|
|
|
; VI-NEXT: v_cvt_f16_f32_e32 v0, v0
|
|
|
|
; VI-NEXT: s_setpc_b64 s[30:31]
|
2021-03-29 11:12:46 +02:00
|
|
|
;
|
|
|
|
; GFX10-LABEL: v_sitofp_i32_to_f16_mask255:
|
|
|
|
; GFX10: ; %bb.0:
|
|
|
|
; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte0_e32 v0, v0
|
|
|
|
; GFX10-NEXT: v_cvt_f16_f32_e32 v0, v0
|
|
|
|
; GFX10-NEXT: s_setpc_b64 s[30:31]
|
2020-03-29 16:10:28 +02:00
|
|
|
%masked = and i32 %arg0, 255
|
|
|
|
%cvt = sitofp i32 %masked to half
|
|
|
|
ret half %cvt
|
|
|
|
}
|
|
|
|
|
|
|
|
define half @v_uitofp_to_f16_lshr8_mask255(i32 %arg0) nounwind {
|
|
|
|
; SI-LABEL: v_uitofp_to_f16_lshr8_mask255:
|
|
|
|
; SI: ; %bb.0:
|
|
|
|
; SI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; SI-NEXT: v_cvt_f32_ubyte1_e32 v0, v0
|
|
|
|
; SI-NEXT: v_cvt_f16_f32_e32 v0, v0
|
|
|
|
; SI-NEXT: v_cvt_f32_f16_e32 v0, v0
|
|
|
|
; SI-NEXT: s_setpc_b64 s[30:31]
|
|
|
|
;
|
|
|
|
; VI-LABEL: v_uitofp_to_f16_lshr8_mask255:
|
|
|
|
; VI: ; %bb.0:
|
|
|
|
; VI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
2020-03-29 16:26:16 +02:00
|
|
|
; VI-NEXT: v_cvt_f32_ubyte1_e32 v0, v0
|
2020-03-29 16:10:28 +02:00
|
|
|
; VI-NEXT: v_cvt_f16_f32_e32 v0, v0
|
|
|
|
; VI-NEXT: s_setpc_b64 s[30:31]
|
2021-03-29 11:12:46 +02:00
|
|
|
;
|
|
|
|
; GFX10-LABEL: v_uitofp_to_f16_lshr8_mask255:
|
|
|
|
; GFX10: ; %bb.0:
|
|
|
|
; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte1_e32 v0, v0
|
|
|
|
; GFX10-NEXT: v_cvt_f16_f32_e32 v0, v0
|
|
|
|
; GFX10-NEXT: s_setpc_b64 s[30:31]
|
2020-03-29 16:10:28 +02:00
|
|
|
%lshr.8 = lshr i32 %arg0, 8
|
|
|
|
%masked = and i32 %lshr.8, 255
|
|
|
|
%cvt = uitofp i32 %masked to half
|
|
|
|
ret half %cvt
|
|
|
|
}
|
|
|
|
|
|
|
|
define half @v_uitofp_to_f16_lshr16_mask255(i32 %arg0) nounwind {
|
|
|
|
; SI-LABEL: v_uitofp_to_f16_lshr16_mask255:
|
|
|
|
; SI: ; %bb.0:
|
|
|
|
; SI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; SI-NEXT: v_cvt_f32_ubyte2_e32 v0, v0
|
|
|
|
; SI-NEXT: v_cvt_f16_f32_e32 v0, v0
|
|
|
|
; SI-NEXT: v_cvt_f32_f16_e32 v0, v0
|
|
|
|
; SI-NEXT: s_setpc_b64 s[30:31]
|
|
|
|
;
|
|
|
|
; VI-LABEL: v_uitofp_to_f16_lshr16_mask255:
|
|
|
|
; VI: ; %bb.0:
|
|
|
|
; VI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
2020-03-29 16:26:16 +02:00
|
|
|
; VI-NEXT: v_cvt_f32_ubyte2_e32 v0, v0
|
2020-03-29 16:10:28 +02:00
|
|
|
; VI-NEXT: v_cvt_f16_f32_e32 v0, v0
|
|
|
|
; VI-NEXT: s_setpc_b64 s[30:31]
|
2021-03-29 11:12:46 +02:00
|
|
|
;
|
|
|
|
; GFX10-LABEL: v_uitofp_to_f16_lshr16_mask255:
|
|
|
|
; GFX10: ; %bb.0:
|
|
|
|
; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte2_e32 v0, v0
|
|
|
|
; GFX10-NEXT: v_cvt_f16_f32_e32 v0, v0
|
|
|
|
; GFX10-NEXT: s_setpc_b64 s[30:31]
|
2020-03-29 16:10:28 +02:00
|
|
|
%lshr.16 = lshr i32 %arg0, 16
|
|
|
|
%masked = and i32 %lshr.16, 255
|
|
|
|
%cvt = uitofp i32 %masked to half
|
|
|
|
ret half %cvt
|
|
|
|
}
|
|
|
|
|
|
|
|
define half @v_uitofp_to_f16_lshr24_mask255(i32 %arg0) nounwind {
|
|
|
|
; SI-LABEL: v_uitofp_to_f16_lshr24_mask255:
|
|
|
|
; SI: ; %bb.0:
|
|
|
|
; SI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; SI-NEXT: v_cvt_f32_ubyte3_e32 v0, v0
|
|
|
|
; SI-NEXT: v_cvt_f16_f32_e32 v0, v0
|
|
|
|
; SI-NEXT: v_cvt_f32_f16_e32 v0, v0
|
|
|
|
; SI-NEXT: s_setpc_b64 s[30:31]
|
|
|
|
;
|
|
|
|
; VI-LABEL: v_uitofp_to_f16_lshr24_mask255:
|
|
|
|
; VI: ; %bb.0:
|
|
|
|
; VI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
2020-03-29 16:26:16 +02:00
|
|
|
; VI-NEXT: v_cvt_f32_ubyte3_e32 v0, v0
|
2020-03-29 16:10:28 +02:00
|
|
|
; VI-NEXT: v_cvt_f16_f32_e32 v0, v0
|
|
|
|
; VI-NEXT: s_setpc_b64 s[30:31]
|
2021-03-29 11:12:46 +02:00
|
|
|
;
|
|
|
|
; GFX10-LABEL: v_uitofp_to_f16_lshr24_mask255:
|
|
|
|
; GFX10: ; %bb.0:
|
|
|
|
; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte3_e32 v0, v0
|
|
|
|
; GFX10-NEXT: v_cvt_f16_f32_e32 v0, v0
|
|
|
|
; GFX10-NEXT: s_setpc_b64 s[30:31]
|
2020-03-29 16:10:28 +02:00
|
|
|
%lshr.16 = lshr i32 %arg0, 24
|
|
|
|
%masked = and i32 %lshr.16, 255
|
|
|
|
%cvt = uitofp i32 %masked to half
|
|
|
|
ret half %cvt
|
|
|
|
}
|
|
|
|
|
|
|
|
define half @v_uitofp_i8_to_f16(i8 %arg0) nounwind {
|
|
|
|
; SI-LABEL: v_uitofp_i8_to_f16:
|
|
|
|
; SI: ; %bb.0:
|
|
|
|
; SI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; SI-NEXT: v_cvt_f32_ubyte0_e32 v0, v0
|
|
|
|
; SI-NEXT: v_cvt_f16_f32_e32 v0, v0
|
|
|
|
; SI-NEXT: v_cvt_f32_f16_e32 v0, v0
|
|
|
|
; SI-NEXT: s_setpc_b64 s[30:31]
|
|
|
|
;
|
|
|
|
; VI-LABEL: v_uitofp_i8_to_f16:
|
|
|
|
; VI: ; %bb.0:
|
|
|
|
; VI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; VI-NEXT: v_cvt_f16_u16_sdwa v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0
|
|
|
|
; VI-NEXT: s_setpc_b64 s[30:31]
|
2021-03-29 11:12:46 +02:00
|
|
|
;
|
|
|
|
; GFX10-LABEL: v_uitofp_i8_to_f16:
|
|
|
|
; GFX10: ; %bb.0:
|
|
|
|
; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
|
|
|
|
; GFX10-NEXT: v_cvt_f16_u16_sdwa v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:BYTE_0
|
|
|
|
; GFX10-NEXT: s_setpc_b64 s[30:31]
|
2020-03-29 16:10:28 +02:00
|
|
|
%cvt = uitofp i8 %arg0 to half
|
|
|
|
ret half %cvt
|
|
|
|
}
|
|
|
|
|
|
|
|
define double @v_uitofp_i32_to_f64_mask255(i32 %arg0) nounwind {
|
|
|
|
; GCN-LABEL: v_uitofp_i32_to_f64_mask255:
|
|
|
|
; GCN: ; %bb.0:
|
|
|
|
; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; GCN-NEXT: v_and_b32_e32 v0, 0xff, v0
|
|
|
|
; GCN-NEXT: v_cvt_f64_u32_e32 v[0:1], v0
|
|
|
|
; GCN-NEXT: s_setpc_b64 s[30:31]
|
2021-03-29 11:12:46 +02:00
|
|
|
;
|
|
|
|
; GFX10-LABEL: v_uitofp_i32_to_f64_mask255:
|
|
|
|
; GFX10: ; %bb.0:
|
|
|
|
; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
|
|
|
|
; GFX10-NEXT: v_and_b32_e32 v0, 0xff, v0
|
|
|
|
; GFX10-NEXT: v_cvt_f64_u32_e32 v[0:1], v0
|
|
|
|
; GFX10-NEXT: s_setpc_b64 s[30:31]
|
2020-03-29 16:10:28 +02:00
|
|
|
%masked = and i32 %arg0, 255
|
|
|
|
%cvt = uitofp i32 %masked to double
|
|
|
|
ret double %cvt
|
|
|
|
}
|
|
|
|
|
|
|
|
define double @v_uitofp_to_f64_lshr8_mask255(i32 %arg0) nounwind {
|
|
|
|
; GCN-LABEL: v_uitofp_to_f64_lshr8_mask255:
|
|
|
|
; GCN: ; %bb.0:
|
|
|
|
; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; GCN-NEXT: v_bfe_u32 v0, v0, 8, 8
|
|
|
|
; GCN-NEXT: v_cvt_f64_u32_e32 v[0:1], v0
|
|
|
|
; GCN-NEXT: s_setpc_b64 s[30:31]
|
2021-03-29 11:12:46 +02:00
|
|
|
;
|
|
|
|
; GFX10-LABEL: v_uitofp_to_f64_lshr8_mask255:
|
|
|
|
; GFX10: ; %bb.0:
|
|
|
|
; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
|
|
|
|
; GFX10-NEXT: v_bfe_u32 v0, v0, 8, 8
|
|
|
|
; GFX10-NEXT: v_cvt_f64_u32_e32 v[0:1], v0
|
|
|
|
; GFX10-NEXT: s_setpc_b64 s[30:31]
|
2020-03-29 16:10:28 +02:00
|
|
|
%lshr.8 = lshr i32 %arg0, 8
|
|
|
|
%masked = and i32 %lshr.8, 255
|
|
|
|
%cvt = uitofp i32 %masked to double
|
|
|
|
ret double %cvt
|
|
|
|
}
|
|
|
|
|
|
|
|
define double @v_uitofp_to_f64_lshr16_mask255(i32 %arg0) nounwind {
|
|
|
|
; GCN-LABEL: v_uitofp_to_f64_lshr16_mask255:
|
|
|
|
; GCN: ; %bb.0:
|
|
|
|
; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; GCN-NEXT: v_bfe_u32 v0, v0, 16, 8
|
|
|
|
; GCN-NEXT: v_cvt_f64_u32_e32 v[0:1], v0
|
|
|
|
; GCN-NEXT: s_setpc_b64 s[30:31]
|
2021-03-29 11:12:46 +02:00
|
|
|
;
|
|
|
|
; GFX10-LABEL: v_uitofp_to_f64_lshr16_mask255:
|
|
|
|
; GFX10: ; %bb.0:
|
|
|
|
; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
|
|
|
|
; GFX10-NEXT: v_bfe_u32 v0, v0, 16, 8
|
|
|
|
; GFX10-NEXT: v_cvt_f64_u32_e32 v[0:1], v0
|
|
|
|
; GFX10-NEXT: s_setpc_b64 s[30:31]
|
2020-03-29 16:10:28 +02:00
|
|
|
%lshr.16 = lshr i32 %arg0, 16
|
|
|
|
%masked = and i32 %lshr.16, 255
|
|
|
|
%cvt = uitofp i32 %masked to double
|
|
|
|
ret double %cvt
|
|
|
|
}
|
|
|
|
|
|
|
|
define double @v_uitofp_to_f64_lshr24_mask255(i32 %arg0) nounwind {
|
|
|
|
; GCN-LABEL: v_uitofp_to_f64_lshr24_mask255:
|
|
|
|
; GCN: ; %bb.0:
|
|
|
|
; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; GCN-NEXT: v_lshrrev_b32_e32 v0, 24, v0
|
|
|
|
; GCN-NEXT: v_cvt_f64_u32_e32 v[0:1], v0
|
|
|
|
; GCN-NEXT: s_setpc_b64 s[30:31]
|
2021-03-29 11:12:46 +02:00
|
|
|
;
|
|
|
|
; GFX10-LABEL: v_uitofp_to_f64_lshr24_mask255:
|
|
|
|
; GFX10: ; %bb.0:
|
|
|
|
; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
|
|
|
|
; GFX10-NEXT: v_lshrrev_b32_e32 v0, 24, v0
|
|
|
|
; GFX10-NEXT: v_cvt_f64_u32_e32 v[0:1], v0
|
|
|
|
; GFX10-NEXT: s_setpc_b64 s[30:31]
|
2020-03-29 16:10:28 +02:00
|
|
|
%lshr.16 = lshr i32 %arg0, 24
|
|
|
|
%masked = and i32 %lshr.16, 255
|
|
|
|
%cvt = uitofp i32 %masked to double
|
|
|
|
ret double %cvt
|
|
|
|
}
|
|
|
|
|
|
|
|
define double @v_uitofp_i8_to_f64(i8 %arg0) nounwind {
|
|
|
|
; SI-LABEL: v_uitofp_i8_to_f64:
|
|
|
|
; SI: ; %bb.0:
|
|
|
|
; SI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; SI-NEXT: v_and_b32_e32 v0, 0xff, v0
|
|
|
|
; SI-NEXT: v_cvt_f64_u32_e32 v[0:1], v0
|
|
|
|
; SI-NEXT: s_setpc_b64 s[30:31]
|
|
|
|
;
|
|
|
|
; VI-LABEL: v_uitofp_i8_to_f64:
|
|
|
|
; VI: ; %bb.0:
|
|
|
|
; VI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; VI-NEXT: v_mov_b32_e32 v1, 0xffff
|
|
|
|
; VI-NEXT: v_and_b32_sdwa v0, v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:BYTE_0
|
|
|
|
; VI-NEXT: v_cvt_f64_u32_e32 v[0:1], v0
|
|
|
|
; VI-NEXT: s_setpc_b64 s[30:31]
|
2021-03-29 11:12:46 +02:00
|
|
|
;
|
|
|
|
; GFX10-LABEL: v_uitofp_i8_to_f64:
|
|
|
|
; GFX10: ; %bb.0:
|
|
|
|
; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
|
|
|
|
; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
|
|
|
|
; GFX10-NEXT: v_mov_b32_e32 v1, 0xffff
|
|
|
|
; GFX10-NEXT: v_and_b32_sdwa v0, v1, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:BYTE_0
|
|
|
|
; GFX10-NEXT: v_cvt_f64_u32_e32 v[0:1], v0
|
|
|
|
; GFX10-NEXT: s_setpc_b64 s[30:31]
|
2020-03-29 16:10:28 +02:00
|
|
|
%cvt = uitofp i8 %arg0 to double
|
|
|
|
ret double %cvt
|
|
|
|
}
|
|
|
|
|
2017-03-21 22:39:51 +01:00
|
|
|
define amdgpu_kernel void @load_i8_to_f32(float addrspace(1)* noalias %out, i8 addrspace(1)* noalias %in) nounwind {
|
2019-04-22 12:19:09 +02:00
|
|
|
; SI-LABEL: load_i8_to_f32:
|
|
|
|
; SI: ; %bb.0:
|
|
|
|
; SI-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x9
|
|
|
|
; SI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0xb
|
|
|
|
; SI-NEXT: s_mov_b32 s7, 0xf000
|
|
|
|
; SI-NEXT: v_mov_b32_e32 v1, 0
|
|
|
|
; SI-NEXT: s_mov_b32 s2, 0
|
|
|
|
; SI-NEXT: s_mov_b32 s3, s7
|
|
|
|
; SI-NEXT: s_waitcnt lgkmcnt(0)
|
|
|
|
; SI-NEXT: buffer_load_ubyte v0, v[0:1], s[0:3], 0 addr64
|
|
|
|
; SI-NEXT: s_mov_b32 s6, -1
|
|
|
|
; SI-NEXT: s_waitcnt vmcnt(0)
|
|
|
|
; SI-NEXT: v_cvt_f32_ubyte0_e32 v0, v0
|
|
|
|
; SI-NEXT: buffer_store_dword v0, off, s[4:7], 0
|
|
|
|
; SI-NEXT: s_endpgm
|
|
|
|
;
|
|
|
|
; VI-LABEL: load_i8_to_f32:
|
|
|
|
; VI: ; %bb.0:
|
|
|
|
; VI-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x24
|
|
|
|
; VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x2c
|
|
|
|
; VI-NEXT: s_mov_b32 s7, 0xf000
|
|
|
|
; VI-NEXT: s_mov_b32 s6, -1
|
|
|
|
; VI-NEXT: s_waitcnt lgkmcnt(0)
|
|
|
|
; VI-NEXT: v_mov_b32_e32 v1, s1
|
|
|
|
; VI-NEXT: v_add_u32_e32 v0, vcc, s0, v0
|
|
|
|
; VI-NEXT: v_addc_u32_e32 v1, vcc, 0, v1, vcc
|
|
|
|
; VI-NEXT: flat_load_ubyte v0, v[0:1]
|
2020-10-16 09:09:38 +02:00
|
|
|
; VI-NEXT: s_waitcnt vmcnt(0)
|
2019-04-22 12:19:09 +02:00
|
|
|
; VI-NEXT: v_cvt_f32_ubyte0_e32 v0, v0
|
|
|
|
; VI-NEXT: buffer_store_dword v0, off, s[4:7], 0
|
|
|
|
; VI-NEXT: s_endpgm
|
2021-03-29 11:12:46 +02:00
|
|
|
;
|
|
|
|
; GFX10-LABEL: load_i8_to_f32:
|
|
|
|
; GFX10: ; %bb.0:
|
|
|
|
; GFX10-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x2c
|
|
|
|
; GFX10-NEXT: v_mov_b32_e32 v1, 0
|
|
|
|
; GFX10-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
|
|
|
|
; GFX10-NEXT: s_waitcnt lgkmcnt(0)
|
|
|
|
; GFX10-NEXT: global_load_ubyte v0, v0, s[2:3]
|
|
|
|
; GFX10-NEXT: s_waitcnt vmcnt(0)
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte0_e32 v0, v0
|
|
|
|
; GFX10-NEXT: global_store_dword v1, v0, s[0:1]
|
|
|
|
; GFX10-NEXT: s_endpgm
|
2017-07-04 19:32:00 +02:00
|
|
|
%tid = call i32 @llvm.amdgcn.workitem.id.x()
|
2017-08-07 16:58:04 +02:00
|
|
|
%gep = getelementptr i8, i8 addrspace(1)* %in, i32 %tid
|
2017-07-04 19:32:00 +02:00
|
|
|
%load = load i8, i8 addrspace(1)* %gep, align 1
|
2014-06-11 19:50:44 +02:00
|
|
|
%cvt = uitofp i8 %load to float
|
|
|
|
store float %cvt, float addrspace(1)* %out, align 4
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2017-03-21 22:39:51 +01:00
|
|
|
define amdgpu_kernel void @load_v2i8_to_v2f32(<2 x float> addrspace(1)* noalias %out, <2 x i8> addrspace(1)* noalias %in) nounwind {
|
2019-04-22 12:19:09 +02:00
|
|
|
; SI-LABEL: load_v2i8_to_v2f32:
|
|
|
|
; SI: ; %bb.0:
|
|
|
|
; SI-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x9
|
|
|
|
; SI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0xb
|
|
|
|
; SI-NEXT: s_mov_b32 s7, 0xf000
|
|
|
|
; SI-NEXT: s_mov_b32 s2, 0
|
|
|
|
; SI-NEXT: s_mov_b32 s3, s7
|
|
|
|
; SI-NEXT: v_lshlrev_b32_e32 v0, 1, v0
|
|
|
|
; SI-NEXT: v_mov_b32_e32 v1, 0
|
|
|
|
; SI-NEXT: s_waitcnt lgkmcnt(0)
|
|
|
|
; SI-NEXT: buffer_load_ushort v0, v[0:1], s[0:3], 0 addr64
|
|
|
|
; SI-NEXT: s_mov_b32 s6, -1
|
|
|
|
; SI-NEXT: s_waitcnt vmcnt(0)
|
|
|
|
; SI-NEXT: v_cvt_f32_ubyte1_e32 v1, v0
|
|
|
|
; SI-NEXT: v_cvt_f32_ubyte0_e32 v0, v0
|
|
|
|
; SI-NEXT: buffer_store_dwordx2 v[0:1], off, s[4:7], 0
|
|
|
|
; SI-NEXT: s_endpgm
|
|
|
|
;
|
|
|
|
; VI-LABEL: load_v2i8_to_v2f32:
|
|
|
|
; VI: ; %bb.0:
|
|
|
|
; VI-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x24
|
|
|
|
; VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x2c
|
|
|
|
; VI-NEXT: v_lshlrev_b32_e32 v0, 1, v0
|
|
|
|
; VI-NEXT: s_mov_b32 s7, 0xf000
|
|
|
|
; VI-NEXT: s_mov_b32 s6, -1
|
|
|
|
; VI-NEXT: s_waitcnt lgkmcnt(0)
|
|
|
|
; VI-NEXT: v_mov_b32_e32 v1, s1
|
|
|
|
; VI-NEXT: v_add_u32_e32 v0, vcc, s0, v0
|
|
|
|
; VI-NEXT: v_addc_u32_e32 v1, vcc, 0, v1, vcc
|
|
|
|
; VI-NEXT: flat_load_ushort v0, v[0:1]
|
2020-10-16 09:09:38 +02:00
|
|
|
; VI-NEXT: s_waitcnt vmcnt(0)
|
2019-04-22 12:19:09 +02:00
|
|
|
; VI-NEXT: v_cvt_f32_ubyte1_e32 v1, v0
|
|
|
|
; VI-NEXT: v_cvt_f32_ubyte0_e32 v0, v0
|
|
|
|
; VI-NEXT: buffer_store_dwordx2 v[0:1], off, s[4:7], 0
|
|
|
|
; VI-NEXT: s_endpgm
|
2021-03-29 11:12:46 +02:00
|
|
|
;
|
|
|
|
; GFX10-LABEL: load_v2i8_to_v2f32:
|
|
|
|
; GFX10: ; %bb.0:
|
|
|
|
; GFX10-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x2c
|
|
|
|
; GFX10-NEXT: v_lshlrev_b32_e32 v0, 1, v0
|
|
|
|
; GFX10-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
|
|
|
|
; GFX10-NEXT: v_mov_b32_e32 v2, 0
|
|
|
|
; GFX10-NEXT: s_waitcnt lgkmcnt(0)
|
|
|
|
; GFX10-NEXT: global_load_ushort v0, v0, s[2:3]
|
|
|
|
; GFX10-NEXT: s_waitcnt vmcnt(0)
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte1_e32 v1, v0
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte0_e32 v0, v0
|
|
|
|
; GFX10-NEXT: global_store_dwordx2 v2, v[0:1], s[0:1]
|
|
|
|
; GFX10-NEXT: s_endpgm
|
2017-07-04 19:32:00 +02:00
|
|
|
%tid = call i32 @llvm.amdgcn.workitem.id.x()
|
2017-08-07 16:58:04 +02:00
|
|
|
%gep = getelementptr <2 x i8>, <2 x i8> addrspace(1)* %in, i32 %tid
|
2017-07-04 19:32:00 +02:00
|
|
|
%load = load <2 x i8>, <2 x i8> addrspace(1)* %gep, align 2
|
2014-06-11 19:50:44 +02:00
|
|
|
%cvt = uitofp <2 x i8> %load to <2 x float>
|
|
|
|
store <2 x float> %cvt, <2 x float> addrspace(1)* %out, align 16
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2017-03-21 22:39:51 +01:00
|
|
|
define amdgpu_kernel void @load_v3i8_to_v3f32(<3 x float> addrspace(1)* noalias %out, <3 x i8> addrspace(1)* noalias %in) nounwind {
|
2019-04-22 12:19:09 +02:00
|
|
|
; SI-LABEL: load_v3i8_to_v3f32:
|
|
|
|
; SI: ; %bb.0:
|
|
|
|
; SI-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x9
|
|
|
|
; SI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0xb
|
|
|
|
; SI-NEXT: s_mov_b32 s7, 0xf000
|
|
|
|
; SI-NEXT: s_mov_b32 s2, 0
|
|
|
|
; SI-NEXT: s_mov_b32 s3, s7
|
|
|
|
; SI-NEXT: v_lshlrev_b32_e32 v0, 2, v0
|
|
|
|
; SI-NEXT: v_mov_b32_e32 v1, 0
|
|
|
|
; SI-NEXT: s_waitcnt lgkmcnt(0)
|
|
|
|
; SI-NEXT: buffer_load_dword v2, v[0:1], s[0:3], 0 addr64
|
|
|
|
; SI-NEXT: s_mov_b32 s6, -1
|
|
|
|
; SI-NEXT: s_waitcnt vmcnt(0)
|
|
|
|
; SI-NEXT: v_cvt_f32_ubyte1_e32 v1, v2
|
|
|
|
; SI-NEXT: v_cvt_f32_ubyte0_e32 v0, v2
|
|
|
|
; SI-NEXT: v_cvt_f32_ubyte2_e32 v2, v2
|
|
|
|
; SI-NEXT: buffer_store_dword v2, off, s[4:7], 0 offset:8
|
|
|
|
; SI-NEXT: buffer_store_dwordx2 v[0:1], off, s[4:7], 0
|
|
|
|
; SI-NEXT: s_endpgm
|
|
|
|
;
|
|
|
|
; VI-LABEL: load_v3i8_to_v3f32:
|
|
|
|
; VI: ; %bb.0:
|
|
|
|
; VI-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x24
|
|
|
|
; VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x2c
|
|
|
|
; VI-NEXT: v_lshlrev_b32_e32 v0, 2, v0
|
|
|
|
; VI-NEXT: s_mov_b32 s7, 0xf000
|
|
|
|
; VI-NEXT: s_mov_b32 s6, -1
|
|
|
|
; VI-NEXT: s_waitcnt lgkmcnt(0)
|
|
|
|
; VI-NEXT: v_mov_b32_e32 v1, s1
|
|
|
|
; VI-NEXT: v_add_u32_e32 v0, vcc, s0, v0
|
|
|
|
; VI-NEXT: v_addc_u32_e32 v1, vcc, 0, v1, vcc
|
|
|
|
; VI-NEXT: flat_load_dword v0, v[0:1]
|
2020-10-16 09:09:38 +02:00
|
|
|
; VI-NEXT: s_waitcnt vmcnt(0)
|
2019-04-22 12:19:09 +02:00
|
|
|
; VI-NEXT: v_cvt_f32_ubyte2_e32 v2, v0
|
|
|
|
; VI-NEXT: v_cvt_f32_ubyte1_e32 v1, v0
|
|
|
|
; VI-NEXT: v_cvt_f32_ubyte0_e32 v0, v0
|
|
|
|
; VI-NEXT: buffer_store_dwordx3 v[0:2], off, s[4:7], 0
|
|
|
|
; VI-NEXT: s_endpgm
|
2021-03-29 11:12:46 +02:00
|
|
|
;
|
|
|
|
; GFX10-LABEL: load_v3i8_to_v3f32:
|
|
|
|
; GFX10: ; %bb.0:
|
|
|
|
; GFX10-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x2c
|
|
|
|
; GFX10-NEXT: v_lshlrev_b32_e32 v0, 2, v0
|
|
|
|
; GFX10-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
|
|
|
|
; GFX10-NEXT: v_mov_b32_e32 v3, 0
|
|
|
|
; GFX10-NEXT: s_waitcnt lgkmcnt(0)
|
|
|
|
; GFX10-NEXT: global_load_dword v0, v0, s[2:3]
|
|
|
|
; GFX10-NEXT: s_waitcnt vmcnt(0)
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte2_e32 v2, v0
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte1_e32 v1, v0
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte0_e32 v0, v0
|
|
|
|
; GFX10-NEXT: global_store_dwordx3 v3, v[0:2], s[0:1]
|
|
|
|
; GFX10-NEXT: s_endpgm
|
2017-07-04 19:32:00 +02:00
|
|
|
%tid = call i32 @llvm.amdgcn.workitem.id.x()
|
2017-08-07 16:58:04 +02:00
|
|
|
%gep = getelementptr <3 x i8>, <3 x i8> addrspace(1)* %in, i32 %tid
|
2017-07-04 19:32:00 +02:00
|
|
|
%load = load <3 x i8>, <3 x i8> addrspace(1)* %gep, align 4
|
2014-06-11 19:50:44 +02:00
|
|
|
%cvt = uitofp <3 x i8> %load to <3 x float>
|
|
|
|
store <3 x float> %cvt, <3 x float> addrspace(1)* %out, align 16
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2017-03-21 22:39:51 +01:00
|
|
|
define amdgpu_kernel void @load_v4i8_to_v4f32(<4 x float> addrspace(1)* noalias %out, <4 x i8> addrspace(1)* noalias %in) nounwind {
|
2019-04-22 12:19:09 +02:00
|
|
|
; SI-LABEL: load_v4i8_to_v4f32:
|
|
|
|
; SI: ; %bb.0:
|
|
|
|
; SI-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x9
|
|
|
|
; SI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0xb
|
|
|
|
; SI-NEXT: s_mov_b32 s7, 0xf000
|
|
|
|
; SI-NEXT: s_mov_b32 s2, 0
|
|
|
|
; SI-NEXT: s_mov_b32 s3, s7
|
|
|
|
; SI-NEXT: v_lshlrev_b32_e32 v0, 2, v0
|
|
|
|
; SI-NEXT: v_mov_b32_e32 v1, 0
|
|
|
|
; SI-NEXT: s_waitcnt lgkmcnt(0)
|
|
|
|
; SI-NEXT: buffer_load_dword v0, v[0:1], s[0:3], 0 addr64
|
|
|
|
; SI-NEXT: s_mov_b32 s6, -1
|
|
|
|
; SI-NEXT: s_waitcnt vmcnt(0)
|
|
|
|
; SI-NEXT: v_cvt_f32_ubyte3_e32 v3, v0
|
|
|
|
; SI-NEXT: v_cvt_f32_ubyte2_e32 v2, v0
|
|
|
|
; SI-NEXT: v_cvt_f32_ubyte1_e32 v1, v0
|
|
|
|
; SI-NEXT: v_cvt_f32_ubyte0_e32 v0, v0
|
|
|
|
; SI-NEXT: buffer_store_dwordx4 v[0:3], off, s[4:7], 0
|
|
|
|
; SI-NEXT: s_endpgm
|
|
|
|
;
|
|
|
|
; VI-LABEL: load_v4i8_to_v4f32:
|
|
|
|
; VI: ; %bb.0:
|
|
|
|
; VI-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x24
|
|
|
|
; VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x2c
|
|
|
|
; VI-NEXT: v_lshlrev_b32_e32 v0, 2, v0
|
|
|
|
; VI-NEXT: s_mov_b32 s7, 0xf000
|
|
|
|
; VI-NEXT: s_mov_b32 s6, -1
|
|
|
|
; VI-NEXT: s_waitcnt lgkmcnt(0)
|
|
|
|
; VI-NEXT: v_mov_b32_e32 v1, s1
|
|
|
|
; VI-NEXT: v_add_u32_e32 v0, vcc, s0, v0
|
|
|
|
; VI-NEXT: v_addc_u32_e32 v1, vcc, 0, v1, vcc
|
|
|
|
; VI-NEXT: flat_load_dword v0, v[0:1]
|
2020-10-16 09:09:38 +02:00
|
|
|
; VI-NEXT: s_waitcnt vmcnt(0)
|
2019-04-22 12:19:09 +02:00
|
|
|
; VI-NEXT: v_cvt_f32_ubyte3_e32 v3, v0
|
|
|
|
; VI-NEXT: v_cvt_f32_ubyte2_e32 v2, v0
|
|
|
|
; VI-NEXT: v_cvt_f32_ubyte1_e32 v1, v0
|
|
|
|
; VI-NEXT: v_cvt_f32_ubyte0_e32 v0, v0
|
|
|
|
; VI-NEXT: buffer_store_dwordx4 v[0:3], off, s[4:7], 0
|
|
|
|
; VI-NEXT: s_endpgm
|
2021-03-29 11:12:46 +02:00
|
|
|
;
|
|
|
|
; GFX10-LABEL: load_v4i8_to_v4f32:
|
|
|
|
; GFX10: ; %bb.0:
|
|
|
|
; GFX10-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x2c
|
|
|
|
; GFX10-NEXT: v_lshlrev_b32_e32 v0, 2, v0
|
|
|
|
; GFX10-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
|
|
|
|
; GFX10-NEXT: v_mov_b32_e32 v4, 0
|
|
|
|
; GFX10-NEXT: s_waitcnt lgkmcnt(0)
|
|
|
|
; GFX10-NEXT: global_load_dword v0, v0, s[2:3]
|
|
|
|
; GFX10-NEXT: s_waitcnt vmcnt(0)
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte3_e32 v3, v0
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte2_e32 v2, v0
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte1_e32 v1, v0
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte0_e32 v0, v0
|
|
|
|
; GFX10-NEXT: global_store_dwordx4 v4, v[0:3], s[0:1]
|
|
|
|
; GFX10-NEXT: s_endpgm
|
2017-07-04 19:32:00 +02:00
|
|
|
%tid = call i32 @llvm.amdgcn.workitem.id.x()
|
2017-08-07 16:58:04 +02:00
|
|
|
%gep = getelementptr <4 x i8>, <4 x i8> addrspace(1)* %in, i32 %tid
|
2017-07-04 19:32:00 +02:00
|
|
|
%load = load <4 x i8>, <4 x i8> addrspace(1)* %gep, align 4
|
2015-01-14 02:35:17 +01:00
|
|
|
%cvt = uitofp <4 x i8> %load to <4 x float>
|
|
|
|
store <4 x float> %cvt, <4 x float> addrspace(1)* %out, align 16
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; This should not be adding instructions to shift into the correct
|
|
|
|
; position in the word for the component.
|
|
|
|
|
2016-07-02 00:55:55 +02:00
|
|
|
; FIXME: Packing bytes
|
2017-03-21 22:39:51 +01:00
|
|
|
define amdgpu_kernel void @load_v4i8_to_v4f32_unaligned(<4 x float> addrspace(1)* noalias %out, <4 x i8> addrspace(1)* noalias %in) nounwind {
|
2019-04-22 12:19:09 +02:00
|
|
|
; SI-LABEL: load_v4i8_to_v4f32_unaligned:
|
|
|
|
; SI: ; %bb.0:
|
|
|
|
; SI-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x9
|
|
|
|
; SI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0xb
|
|
|
|
; SI-NEXT: s_mov_b32 s7, 0xf000
|
|
|
|
; SI-NEXT: s_mov_b32 s2, 0
|
|
|
|
; SI-NEXT: s_mov_b32 s3, s7
|
|
|
|
; SI-NEXT: v_lshlrev_b32_e32 v0, 2, v0
|
|
|
|
; SI-NEXT: v_mov_b32_e32 v1, 0
|
|
|
|
; SI-NEXT: s_waitcnt lgkmcnt(0)
|
2020-02-19 12:45:45 +01:00
|
|
|
; SI-NEXT: buffer_load_ubyte v4, v[0:1], s[0:3], 0 addr64
|
|
|
|
; SI-NEXT: buffer_load_ubyte v2, v[0:1], s[0:3], 0 addr64 offset:1
|
|
|
|
; SI-NEXT: buffer_load_ubyte v3, v[0:1], s[0:3], 0 addr64 offset:2
|
2019-04-22 12:19:09 +02:00
|
|
|
; SI-NEXT: buffer_load_ubyte v0, v[0:1], s[0:3], 0 addr64 offset:3
|
|
|
|
; SI-NEXT: s_mov_b32 s6, -1
|
|
|
|
; SI-NEXT: s_waitcnt vmcnt(2)
|
2020-02-19 12:45:45 +01:00
|
|
|
; SI-NEXT: v_cvt_f32_ubyte2_e32 v1, v2
|
2019-04-22 12:19:09 +02:00
|
|
|
; SI-NEXT: s_waitcnt vmcnt(0)
|
|
|
|
; SI-NEXT: v_lshlrev_b32_e32 v0, 8, v0
|
2020-02-19 12:45:45 +01:00
|
|
|
; SI-NEXT: v_or_b32_e32 v0, v0, v3
|
2019-04-22 12:19:09 +02:00
|
|
|
; SI-NEXT: v_lshlrev_b32_e32 v0, 16, v0
|
2020-03-04 11:53:27 +01:00
|
|
|
; SI-NEXT: v_cvt_f32_ubyte3_e32 v3, v0
|
2019-04-22 12:19:09 +02:00
|
|
|
; SI-NEXT: v_cvt_f32_ubyte2_e32 v2, v0
|
2020-02-19 12:45:45 +01:00
|
|
|
; SI-NEXT: v_cvt_f32_ubyte0_e32 v0, v4
|
2019-04-22 12:19:09 +02:00
|
|
|
; SI-NEXT: buffer_store_dwordx4 v[0:3], off, s[4:7], 0
|
|
|
|
; SI-NEXT: s_endpgm
|
|
|
|
;
|
|
|
|
; VI-LABEL: load_v4i8_to_v4f32_unaligned:
|
|
|
|
; VI: ; %bb.0:
|
|
|
|
; VI-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x24
|
|
|
|
; VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x2c
|
|
|
|
; VI-NEXT: v_lshlrev_b32_e32 v0, 2, v0
|
|
|
|
; VI-NEXT: s_mov_b32 s7, 0xf000
|
|
|
|
; VI-NEXT: s_mov_b32 s6, -1
|
|
|
|
; VI-NEXT: s_waitcnt lgkmcnt(0)
|
|
|
|
; VI-NEXT: v_mov_b32_e32 v1, s1
|
|
|
|
; VI-NEXT: v_add_u32_e32 v0, vcc, s0, v0
|
|
|
|
; VI-NEXT: v_addc_u32_e32 v1, vcc, 0, v1, vcc
|
2020-02-19 12:45:45 +01:00
|
|
|
; VI-NEXT: v_add_u32_e32 v2, vcc, 1, v0
|
2019-04-22 12:19:09 +02:00
|
|
|
; VI-NEXT: v_addc_u32_e32 v3, vcc, 0, v1, vcc
|
|
|
|
; VI-NEXT: v_add_u32_e32 v4, vcc, 2, v0
|
|
|
|
; VI-NEXT: v_addc_u32_e32 v5, vcc, 0, v1, vcc
|
2020-02-19 12:45:45 +01:00
|
|
|
; VI-NEXT: v_add_u32_e32 v6, vcc, 3, v0
|
2019-04-22 12:19:09 +02:00
|
|
|
; VI-NEXT: v_addc_u32_e32 v7, vcc, 0, v1, vcc
|
[AMDGPU] Enable carry out ADD/SUB operations divergence driven instruction selection.
Summary: This change enables all kind of carry out ISD opcodes to be selected according to the node divergence.
Reviewers: rampitec, arsenm, vpykhtin
Reviewed By: rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78091
2020-04-23 19:55:36 +02:00
|
|
|
; VI-NEXT: flat_load_ubyte v4, v[4:5]
|
|
|
|
; VI-NEXT: flat_load_ubyte v5, v[6:7]
|
|
|
|
; VI-NEXT: flat_load_ubyte v6, v[2:3]
|
[MachineScheduler] Reduce reordering due to mem op clustering
Summary:
Mem op clustering adds a weak edge in the DAG between two loads or
stores that should be clustered, but the direction of this edge is
pretty arbitrary (it depends on the sort order of MemOpInfo, which
represents the operands of a load or store). This often means that two
loads or stores will get reordered even if they would naturally have
been scheduled together anyway, which leads to test case churn and goes
against the scheduler's "do no harm" philosophy.
The fix makes sure that the direction of the edge always matches the
original code order of the instructions.
Reviewers: atrick, MatzeB, arsenm, rampitec, t.p.northover
Subscribers: jvesely, wdng, nhaehnle, kristof.beyls, hiraditya, javed.absar, arphaman, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72706
2020-01-14 16:40:52 +01:00
|
|
|
; VI-NEXT: flat_load_ubyte v0, v[0:1]
|
2020-10-16 09:09:38 +02:00
|
|
|
; VI-NEXT: s_waitcnt vmcnt(3)
|
[AMDGPU] Enable carry out ADD/SUB operations divergence driven instruction selection.
Summary: This change enables all kind of carry out ISD opcodes to be selected according to the node divergence.
Reviewers: rampitec, arsenm, vpykhtin
Reviewed By: rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78091
2020-04-23 19:55:36 +02:00
|
|
|
; VI-NEXT: v_cvt_f32_ubyte0_e32 v2, v4
|
2020-10-16 09:09:38 +02:00
|
|
|
; VI-NEXT: s_waitcnt vmcnt(2)
|
[AMDGPU] Enable carry out ADD/SUB operations divergence driven instruction selection.
Summary: This change enables all kind of carry out ISD opcodes to be selected according to the node divergence.
Reviewers: rampitec, arsenm, vpykhtin
Reviewed By: rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78091
2020-04-23 19:55:36 +02:00
|
|
|
; VI-NEXT: v_cvt_f32_ubyte0_e32 v3, v5
|
2020-10-16 09:09:38 +02:00
|
|
|
; VI-NEXT: s_waitcnt vmcnt(1)
|
[AMDGPU] Enable carry out ADD/SUB operations divergence driven instruction selection.
Summary: This change enables all kind of carry out ISD opcodes to be selected according to the node divergence.
Reviewers: rampitec, arsenm, vpykhtin
Reviewed By: rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78091
2020-04-23 19:55:36 +02:00
|
|
|
; VI-NEXT: v_cvt_f32_ubyte2_e32 v1, v6
|
2020-10-16 09:09:38 +02:00
|
|
|
; VI-NEXT: s_waitcnt vmcnt(0)
|
2019-04-22 12:19:09 +02:00
|
|
|
; VI-NEXT: v_cvt_f32_ubyte0_e32 v0, v0
|
|
|
|
; VI-NEXT: buffer_store_dwordx4 v[0:3], off, s[4:7], 0
|
|
|
|
; VI-NEXT: s_endpgm
|
2021-03-29 11:12:46 +02:00
|
|
|
;
|
|
|
|
; GFX10-LABEL: load_v4i8_to_v4f32_unaligned:
|
|
|
|
; GFX10: ; %bb.0:
|
|
|
|
; GFX10-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x2c
|
|
|
|
; GFX10-NEXT: v_lshlrev_b32_e32 v0, 2, v0
|
|
|
|
; GFX10-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
|
|
|
|
; GFX10-NEXT: v_mov_b32_e32 v6, 0
|
|
|
|
; GFX10-NEXT: s_waitcnt lgkmcnt(0)
|
|
|
|
; GFX10-NEXT: s_clause 0x3
|
|
|
|
; GFX10-NEXT: global_load_ubyte v1, v0, s[2:3] offset:3
|
|
|
|
; GFX10-NEXT: global_load_ubyte v2, v0, s[2:3] offset:2
|
|
|
|
; GFX10-NEXT: global_load_ubyte v4, v0, s[2:3] offset:1
|
|
|
|
; GFX10-NEXT: global_load_ubyte v5, v0, s[2:3]
|
|
|
|
; GFX10-NEXT: s_waitcnt vmcnt(3)
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte0_e32 v3, v1
|
|
|
|
; GFX10-NEXT: s_waitcnt vmcnt(2)
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte0_e32 v2, v2
|
|
|
|
; GFX10-NEXT: s_waitcnt vmcnt(1)
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte2_e32 v1, v4
|
|
|
|
; GFX10-NEXT: s_waitcnt vmcnt(0)
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte0_e32 v0, v5
|
|
|
|
; GFX10-NEXT: global_store_dwordx4 v6, v[0:3], s[0:1]
|
|
|
|
; GFX10-NEXT: s_endpgm
|
2017-07-04 19:32:00 +02:00
|
|
|
%tid = call i32 @llvm.amdgcn.workitem.id.x()
|
2017-08-07 16:58:04 +02:00
|
|
|
%gep = getelementptr <4 x i8>, <4 x i8> addrspace(1)* %in, i32 %tid
|
2017-07-04 19:32:00 +02:00
|
|
|
%load = load <4 x i8>, <4 x i8> addrspace(1)* %gep, align 1
|
2014-06-11 19:50:44 +02:00
|
|
|
%cvt = uitofp <4 x i8> %load to <4 x float>
|
|
|
|
store <4 x float> %cvt, <4 x float> addrspace(1)* %out, align 16
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2016-10-07 16:22:58 +02:00
|
|
|
; FIXME: Need to handle non-uniform case for function below (load without gep).
|
2016-07-02 00:47:50 +02:00
|
|
|
; Instructions still emitted to repack bytes for add use.
|
2017-03-21 22:39:51 +01:00
|
|
|
define amdgpu_kernel void @load_v4i8_to_v4f32_2_uses(<4 x float> addrspace(1)* noalias %out, <4 x i8> addrspace(1)* noalias %out2, <4 x i8> addrspace(1)* noalias %in) nounwind {
|
2019-04-22 12:19:09 +02:00
|
|
|
; SI-LABEL: load_v4i8_to_v4f32_2_uses:
|
|
|
|
; SI: ; %bb.0:
|
2020-08-02 19:11:01 +02:00
|
|
|
; SI-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x9
|
|
|
|
; SI-NEXT: s_load_dwordx2 s[8:9], s[0:1], 0xb
|
|
|
|
; SI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0xd
|
|
|
|
; SI-NEXT: s_mov_b32 s11, 0xf000
|
|
|
|
; SI-NEXT: s_mov_b32 s2, 0
|
|
|
|
; SI-NEXT: s_mov_b32 s3, s11
|
|
|
|
; SI-NEXT: v_lshlrev_b32_e32 v0, 2, v0
|
|
|
|
; SI-NEXT: v_mov_b32_e32 v1, 0
|
|
|
|
; SI-NEXT: s_waitcnt lgkmcnt(0)
|
|
|
|
; SI-NEXT: buffer_load_dword v4, v[0:1], s[0:3], 0 addr64
|
|
|
|
; SI-NEXT: s_mov_b32 s10, -1
|
|
|
|
; SI-NEXT: s_movk_i32 s0, 0xff
|
|
|
|
; SI-NEXT: s_mov_b32 s6, s10
|
|
|
|
; SI-NEXT: s_mov_b32 s7, s11
|
|
|
|
; SI-NEXT: s_waitcnt vmcnt(0)
|
|
|
|
; SI-NEXT: v_lshrrev_b32_e32 v5, 16, v4
|
|
|
|
; SI-NEXT: v_lshrrev_b32_e32 v6, 24, v4
|
|
|
|
; SI-NEXT: v_and_b32_e32 v7, 0xff00, v4
|
|
|
|
; SI-NEXT: v_cvt_f32_ubyte3_e32 v3, v4
|
|
|
|
; SI-NEXT: v_cvt_f32_ubyte2_e32 v2, v4
|
|
|
|
; SI-NEXT: v_cvt_f32_ubyte1_e32 v1, v4
|
|
|
|
; SI-NEXT: v_cvt_f32_ubyte0_e32 v0, v4
|
|
|
|
; SI-NEXT: v_add_i32_e32 v4, vcc, 9, v4
|
|
|
|
; SI-NEXT: buffer_store_dwordx4 v[0:3], off, s[4:7], 0
|
|
|
|
; SI-NEXT: s_waitcnt expcnt(0)
|
|
|
|
; SI-NEXT: v_and_b32_e32 v0, s0, v4
|
|
|
|
; SI-NEXT: v_add_i32_e32 v2, vcc, 9, v5
|
|
|
|
; SI-NEXT: v_or_b32_e32 v0, v7, v0
|
|
|
|
; SI-NEXT: v_lshlrev_b32_e32 v1, 8, v6
|
|
|
|
; SI-NEXT: v_and_b32_e32 v2, s0, v2
|
|
|
|
; SI-NEXT: v_add_i32_e32 v0, vcc, 0x900, v0
|
|
|
|
; SI-NEXT: v_or_b32_e32 v1, v1, v2
|
|
|
|
; SI-NEXT: v_and_b32_e32 v0, 0xffff, v0
|
|
|
|
; SI-NEXT: v_lshlrev_b32_e32 v1, 16, v1
|
|
|
|
; SI-NEXT: v_or_b32_e32 v0, v1, v0
|
|
|
|
; SI-NEXT: v_add_i32_e32 v0, vcc, 0x9000000, v0
|
|
|
|
; SI-NEXT: buffer_store_dword v0, off, s[8:11], 0
|
|
|
|
; SI-NEXT: s_endpgm
|
2019-04-22 12:19:09 +02:00
|
|
|
;
|
|
|
|
; VI-LABEL: load_v4i8_to_v4f32_2_uses:
|
|
|
|
; VI: ; %bb.0:
|
2020-08-02 19:11:01 +02:00
|
|
|
; VI-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x24
|
|
|
|
; VI-NEXT: s_load_dwordx2 s[8:9], s[0:1], 0x2c
|
|
|
|
; VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x34
|
|
|
|
; VI-NEXT: v_lshlrev_b32_e32 v0, 2, v0
|
|
|
|
; VI-NEXT: s_mov_b32 s11, 0xf000
|
|
|
|
; VI-NEXT: s_mov_b32 s10, -1
|
|
|
|
; VI-NEXT: v_mov_b32_e32 v5, 9
|
|
|
|
; VI-NEXT: s_waitcnt lgkmcnt(0)
|
|
|
|
; VI-NEXT: v_add_u32_e32 v0, vcc, s0, v0
|
|
|
|
; VI-NEXT: v_mov_b32_e32 v1, s1
|
|
|
|
; VI-NEXT: v_addc_u32_e32 v1, vcc, 0, v1, vcc
|
|
|
|
; VI-NEXT: flat_load_dword v4, v[0:1]
|
|
|
|
; VI-NEXT: s_mov_b32 s6, s10
|
|
|
|
; VI-NEXT: s_mov_b32 s7, s11
|
|
|
|
; VI-NEXT: s_movk_i32 s0, 0x900
|
2020-10-16 09:09:38 +02:00
|
|
|
; VI-NEXT: s_waitcnt vmcnt(0)
|
2020-08-02 19:11:01 +02:00
|
|
|
; VI-NEXT: v_lshrrev_b32_e32 v6, 24, v4
|
|
|
|
; VI-NEXT: v_cvt_f32_ubyte3_e32 v3, v4
|
|
|
|
; VI-NEXT: v_cvt_f32_ubyte2_e32 v2, v4
|
|
|
|
; VI-NEXT: v_cvt_f32_ubyte1_e32 v1, v4
|
|
|
|
; VI-NEXT: v_cvt_f32_ubyte0_e32 v0, v4
|
|
|
|
; VI-NEXT: buffer_store_dwordx4 v[0:3], off, s[4:7], 0
|
|
|
|
; VI-NEXT: v_and_b32_e32 v7, 0xffffff00, v4
|
|
|
|
; VI-NEXT: v_add_u16_e32 v8, 9, v4
|
|
|
|
; VI-NEXT: v_add_u16_sdwa v4, v4, v5 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:DWORD
|
|
|
|
; VI-NEXT: v_lshlrev_b16_e32 v1, 8, v6
|
|
|
|
; VI-NEXT: v_or_b32_sdwa v0, v7, v8 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:BYTE_0
|
|
|
|
; VI-NEXT: v_or_b32_sdwa v1, v1, v4 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:BYTE_0
|
|
|
|
; VI-NEXT: v_mov_b32_e32 v2, s0
|
|
|
|
; VI-NEXT: v_add_u16_e32 v0, s0, v0
|
|
|
|
; VI-NEXT: v_add_u16_sdwa v1, v1, v2 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
|
|
|
|
; VI-NEXT: v_or_b32_e32 v0, v0, v1
|
|
|
|
; VI-NEXT: buffer_store_dword v0, off, s[8:11], 0
|
|
|
|
; VI-NEXT: s_endpgm
|
2021-03-29 11:12:46 +02:00
|
|
|
;
|
|
|
|
; GFX10-LABEL: load_v4i8_to_v4f32_2_uses:
|
|
|
|
; GFX10: ; %bb.0:
|
|
|
|
; GFX10-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x34
|
|
|
|
; GFX10-NEXT: v_lshlrev_b32_e32 v0, 2, v0
|
|
|
|
; GFX10-NEXT: v_mov_b32_e32 v1, 24
|
|
|
|
; GFX10-NEXT: s_waitcnt lgkmcnt(0)
|
|
|
|
; GFX10-NEXT: global_load_dword v0, v0, s[2:3]
|
|
|
|
; GFX10-NEXT: s_clause 0x1
|
|
|
|
; GFX10-NEXT: s_waitcnt_depctr 0xffe3
|
|
|
|
; GFX10-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x24
|
|
|
|
; GFX10-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x2c
|
|
|
|
; GFX10-NEXT: s_movk_i32 s0, 0x900
|
|
|
|
; GFX10-NEXT: s_waitcnt vmcnt(0)
|
|
|
|
; GFX10-NEXT: v_lshrrev_b32_e32 v2, 16, v0
|
|
|
|
; GFX10-NEXT: v_lshrrev_b32_sdwa v1, v1, v0 dst_sel:BYTE_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
|
|
|
|
; GFX10-NEXT: v_and_b32_e32 v3, 0xffffff00, v0
|
2021-04-01 13:21:00 +02:00
|
|
|
; GFX10-NEXT: v_add_nc_u16 v4, v0, 9
|
|
|
|
; GFX10-NEXT: v_add_nc_u16 v2, v2, 9
|
2021-03-29 11:12:46 +02:00
|
|
|
; GFX10-NEXT: v_or_b32_sdwa v1, v1, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:BYTE_0
|
|
|
|
; GFX10-NEXT: v_or_b32_sdwa v2, v3, v4 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:BYTE_0
|
|
|
|
; GFX10-NEXT: v_mov_b32_e32 v4, 0
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte3_e32 v3, v0
|
2021-04-01 13:21:00 +02:00
|
|
|
; GFX10-NEXT: v_add_nc_u16 v1, v1, s0
|
|
|
|
; GFX10-NEXT: v_add_nc_u16 v5, v2, s0
|
2021-03-29 11:12:46 +02:00
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte2_e32 v2, v0
|
|
|
|
; GFX10-NEXT: v_lshlrev_b32_e32 v6, 16, v1
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte1_e32 v1, v0
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte0_e32 v0, v0
|
|
|
|
; GFX10-NEXT: v_or_b32_sdwa v5, v5, v6 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_0 src1_sel:DWORD
|
|
|
|
; GFX10-NEXT: s_waitcnt lgkmcnt(0)
|
|
|
|
; GFX10-NEXT: global_store_dwordx4 v4, v[0:3], s[2:3]
|
|
|
|
; GFX10-NEXT: global_store_dword v4, v5, s[4:5]
|
|
|
|
; GFX10-NEXT: s_endpgm
|
2016-10-07 16:22:58 +02:00
|
|
|
%tid.x = call i32 @llvm.amdgcn.workitem.id.x()
|
|
|
|
%in.ptr = getelementptr <4 x i8>, <4 x i8> addrspace(1)* %in, i32 %tid.x
|
|
|
|
%load = load <4 x i8>, <4 x i8> addrspace(1)* %in.ptr, align 4
|
2014-06-11 19:50:44 +02:00
|
|
|
%cvt = uitofp <4 x i8> %load to <4 x float>
|
|
|
|
store <4 x float> %cvt, <4 x float> addrspace(1)* %out, align 16
|
|
|
|
%add = add <4 x i8> %load, <i8 9, i8 9, i8 9, i8 9> ; Second use of %load
|
|
|
|
store <4 x i8> %add, <4 x i8> addrspace(1)* %out2, align 4
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; Make sure this doesn't crash.
|
2017-03-21 22:39:51 +01:00
|
|
|
define amdgpu_kernel void @load_v7i8_to_v7f32(<7 x float> addrspace(1)* noalias %out, <7 x i8> addrspace(1)* noalias %in) nounwind {
|
2019-04-22 12:19:09 +02:00
|
|
|
; SI-LABEL: load_v7i8_to_v7f32:
|
|
|
|
; SI: ; %bb.0:
|
2020-08-02 19:11:01 +02:00
|
|
|
; SI-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x9
|
|
|
|
; SI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0xb
|
|
|
|
; SI-NEXT: s_mov_b32 s7, 0xf000
|
|
|
|
; SI-NEXT: s_mov_b32 s2, 0
|
|
|
|
; SI-NEXT: s_mov_b32 s3, s7
|
|
|
|
; SI-NEXT: v_lshlrev_b32_e32 v0, 3, v0
|
|
|
|
; SI-NEXT: v_mov_b32_e32 v1, 0
|
|
|
|
; SI-NEXT: s_waitcnt lgkmcnt(0)
|
|
|
|
; SI-NEXT: buffer_load_ubyte v2, v[0:1], s[0:3], 0 addr64
|
|
|
|
; SI-NEXT: buffer_load_ubyte v3, v[0:1], s[0:3], 0 addr64 offset:1
|
|
|
|
; SI-NEXT: buffer_load_ubyte v6, v[0:1], s[0:3], 0 addr64 offset:2
|
|
|
|
; SI-NEXT: buffer_load_ubyte v4, v[0:1], s[0:3], 0 addr64 offset:3
|
|
|
|
; SI-NEXT: buffer_load_ubyte v7, v[0:1], s[0:3], 0 addr64 offset:4
|
|
|
|
; SI-NEXT: buffer_load_ubyte v5, v[0:1], s[0:3], 0 addr64 offset:5
|
|
|
|
; SI-NEXT: buffer_load_ubyte v8, v[0:1], s[0:3], 0 addr64 offset:6
|
|
|
|
; SI-NEXT: s_mov_b32 s6, -1
|
|
|
|
; SI-NEXT: s_waitcnt vmcnt(6)
|
|
|
|
; SI-NEXT: v_cvt_f32_ubyte0_e32 v0, v2
|
|
|
|
; SI-NEXT: s_waitcnt vmcnt(5)
|
|
|
|
; SI-NEXT: v_cvt_f32_ubyte2_e32 v1, v3
|
|
|
|
; SI-NEXT: s_waitcnt vmcnt(3)
|
|
|
|
; SI-NEXT: v_lshlrev_b32_e32 v9, 8, v4
|
|
|
|
; SI-NEXT: v_or_b32_e32 v3, v9, v6
|
|
|
|
; SI-NEXT: s_waitcnt vmcnt(1)
|
|
|
|
; SI-NEXT: v_cvt_f32_ubyte2_e32 v5, v5
|
|
|
|
; SI-NEXT: s_waitcnt vmcnt(0)
|
|
|
|
; SI-NEXT: v_cvt_f32_ubyte0_e32 v2, v8
|
|
|
|
; SI-NEXT: buffer_store_dword v2, off, s[4:7], 0 offset:24
|
|
|
|
; SI-NEXT: s_waitcnt expcnt(0)
|
|
|
|
; SI-NEXT: v_lshlrev_b32_e32 v2, 16, v3
|
|
|
|
; SI-NEXT: v_cvt_f32_ubyte0_e32 v4, v7
|
|
|
|
; SI-NEXT: v_cvt_f32_ubyte3_e32 v3, v2
|
|
|
|
; SI-NEXT: v_cvt_f32_ubyte2_e32 v2, v2
|
|
|
|
; SI-NEXT: buffer_store_dwordx2 v[4:5], off, s[4:7], 0 offset:16
|
|
|
|
; SI-NEXT: buffer_store_dwordx4 v[0:3], off, s[4:7], 0
|
|
|
|
; SI-NEXT: s_endpgm
|
2019-04-22 12:19:09 +02:00
|
|
|
;
|
|
|
|
; VI-LABEL: load_v7i8_to_v7f32:
|
|
|
|
; VI: ; %bb.0:
|
|
|
|
; VI-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x24
|
|
|
|
; VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x2c
|
|
|
|
; VI-NEXT: v_lshlrev_b32_e32 v0, 3, v0
|
|
|
|
; VI-NEXT: s_mov_b32 s7, 0xf000
|
|
|
|
; VI-NEXT: s_mov_b32 s6, -1
|
|
|
|
; VI-NEXT: s_waitcnt lgkmcnt(0)
|
|
|
|
; VI-NEXT: v_mov_b32_e32 v1, s1
|
|
|
|
; VI-NEXT: v_add_u32_e32 v0, vcc, s0, v0
|
|
|
|
; VI-NEXT: v_addc_u32_e32 v1, vcc, 0, v1, vcc
|
2020-02-19 12:45:45 +01:00
|
|
|
; VI-NEXT: v_add_u32_e32 v2, vcc, 3, v0
|
2019-04-22 12:19:09 +02:00
|
|
|
; VI-NEXT: v_addc_u32_e32 v3, vcc, 0, v1, vcc
|
2020-02-19 12:45:45 +01:00
|
|
|
; VI-NEXT: v_add_u32_e32 v4, vcc, 2, v0
|
2019-04-22 12:19:09 +02:00
|
|
|
; VI-NEXT: v_addc_u32_e32 v5, vcc, 0, v1, vcc
|
[AMDGPU] Enable carry out ADD/SUB operations divergence driven instruction selection.
Summary: This change enables all kind of carry out ISD opcodes to be selected according to the node divergence.
Reviewers: rampitec, arsenm, vpykhtin
Reviewed By: rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78091
2020-04-23 19:55:36 +02:00
|
|
|
; VI-NEXT: v_add_u32_e32 v6, vcc, 4, v0
|
2019-04-22 12:19:09 +02:00
|
|
|
; VI-NEXT: v_addc_u32_e32 v7, vcc, 0, v1, vcc
|
[AMDGPU] Enable carry out ADD/SUB operations divergence driven instruction selection.
Summary: This change enables all kind of carry out ISD opcodes to be selected according to the node divergence.
Reviewers: rampitec, arsenm, vpykhtin
Reviewed By: rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78091
2020-04-23 19:55:36 +02:00
|
|
|
; VI-NEXT: v_add_u32_e32 v8, vcc, 5, v0
|
2020-02-19 12:45:45 +01:00
|
|
|
; VI-NEXT: v_addc_u32_e32 v9, vcc, 0, v1, vcc
|
2021-06-24 02:59:55 +02:00
|
|
|
; VI-NEXT: flat_load_ubyte v10, v[4:5]
|
|
|
|
; VI-NEXT: flat_load_ubyte v11, v[6:7]
|
[AMDGPU] Enable carry out ADD/SUB operations divergence driven instruction selection.
Summary: This change enables all kind of carry out ISD opcodes to be selected according to the node divergence.
Reviewers: rampitec, arsenm, vpykhtin
Reviewed By: rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78091
2020-04-23 19:55:36 +02:00
|
|
|
; VI-NEXT: flat_load_ubyte v8, v[8:9]
|
2021-06-24 02:59:55 +02:00
|
|
|
; VI-NEXT: v_add_u32_e32 v4, vcc, 6, v0
|
|
|
|
; VI-NEXT: v_addc_u32_e32 v5, vcc, 0, v1, vcc
|
|
|
|
; VI-NEXT: v_add_u32_e32 v6, vcc, 1, v0
|
|
|
|
; VI-NEXT: v_addc_u32_e32 v7, vcc, 0, v1, vcc
|
[AMDGPU] Remove dubious logic in bidirectional list scheduler
Summary:
pickNodeBidirectional tried to compare the best top candidate and the
best bottom candidate by examining TopCand.Reason and BotCand.Reason.
This is unsound because, after calling pickNodeFromQueue, Cand.Reason
does not reflect the most important reason why Cand was chosen. Rather
it reflects the most recent reason why it beat some other potential
candidate, which could have been for some low priority tie breaker
reason.
I have seen this cause problems where TopCand is a good candidate, but
because TopCand.Reason is ORDER (which is very low priority) it is
repeatedly ignored in favour of a mediocre BotCand. This is not how
bidirectional scheduling is supposed to work.
To fix this I changed the code to always compare TopCand and BotCand
directly, like the generic implementation of pickNodeBidirectional does.
This removes some uncommented AMDGPU-specific logic; if this logic turns
out to be important then perhaps it could be moved into an override of
tryCandidate instead.
Graphics shader benchmarking on gfx10 shows a lot more positive than
negative effects from this change.
Reviewers: arsenm, tstellar, rampitec, kzhuravl, vpykhtin, dstuttard, tpr, atrick, MatzeB
Subscribers: jvesely, wdng, nhaehnle, yaxunl, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68338
2019-10-07 16:33:59 +02:00
|
|
|
; VI-NEXT: flat_load_ubyte v6, v[6:7]
|
2021-06-24 02:59:55 +02:00
|
|
|
; VI-NEXT: flat_load_ubyte v4, v[4:5]
|
[AMDGPU] Enable carry out ADD/SUB operations divergence driven instruction selection.
Summary: This change enables all kind of carry out ISD opcodes to be selected according to the node divergence.
Reviewers: rampitec, arsenm, vpykhtin
Reviewed By: rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78091
2020-04-23 19:55:36 +02:00
|
|
|
; VI-NEXT: flat_load_ubyte v2, v[2:3]
|
[MachineScheduler] Reduce reordering due to mem op clustering
Summary:
Mem op clustering adds a weak edge in the DAG between two loads or
stores that should be clustered, but the direction of this edge is
pretty arbitrary (it depends on the sort order of MemOpInfo, which
represents the operands of a load or store). This often means that two
loads or stores will get reordered even if they would naturally have
been scheduled together anyway, which leads to test case churn and goes
against the scheduler's "do no harm" philosophy.
The fix makes sure that the direction of the edge always matches the
original code order of the instructions.
Reviewers: atrick, MatzeB, arsenm, rampitec, t.p.northover
Subscribers: jvesely, wdng, nhaehnle, kristof.beyls, hiraditya, javed.absar, arphaman, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72706
2020-01-14 16:40:52 +01:00
|
|
|
; VI-NEXT: flat_load_ubyte v0, v[0:1]
|
2020-10-16 09:09:38 +02:00
|
|
|
; VI-NEXT: s_waitcnt vmcnt(4)
|
2021-06-24 02:59:55 +02:00
|
|
|
; VI-NEXT: v_cvt_f32_ubyte2_e32 v5, v8
|
2020-10-16 09:09:38 +02:00
|
|
|
; VI-NEXT: s_waitcnt vmcnt(3)
|
2021-06-24 02:59:55 +02:00
|
|
|
; VI-NEXT: v_cvt_f32_ubyte2_e32 v1, v6
|
2020-10-16 09:09:38 +02:00
|
|
|
; VI-NEXT: s_waitcnt vmcnt(2)
|
2021-06-24 02:59:55 +02:00
|
|
|
; VI-NEXT: v_cvt_f32_ubyte0_e32 v6, v4
|
2020-10-16 09:09:38 +02:00
|
|
|
; VI-NEXT: s_waitcnt vmcnt(1)
|
[AMDGPU] Enable carry out ADD/SUB operations divergence driven instruction selection.
Summary: This change enables all kind of carry out ISD opcodes to be selected according to the node divergence.
Reviewers: rampitec, arsenm, vpykhtin
Reviewed By: rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78091
2020-04-23 19:55:36 +02:00
|
|
|
; VI-NEXT: v_lshlrev_b32_e32 v2, 8, v2
|
2021-06-24 02:59:55 +02:00
|
|
|
; VI-NEXT: v_or_b32_sdwa v2, v2, v10 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
|
|
|
|
; VI-NEXT: v_cvt_f32_ubyte0_e32 v4, v11
|
[AMDGPU] Remove dubious logic in bidirectional list scheduler
Summary:
pickNodeBidirectional tried to compare the best top candidate and the
best bottom candidate by examining TopCand.Reason and BotCand.Reason.
This is unsound because, after calling pickNodeFromQueue, Cand.Reason
does not reflect the most important reason why Cand was chosen. Rather
it reflects the most recent reason why it beat some other potential
candidate, which could have been for some low priority tie breaker
reason.
I have seen this cause problems where TopCand is a good candidate, but
because TopCand.Reason is ORDER (which is very low priority) it is
repeatedly ignored in favour of a mediocre BotCand. This is not how
bidirectional scheduling is supposed to work.
To fix this I changed the code to always compare TopCand and BotCand
directly, like the generic implementation of pickNodeBidirectional does.
This removes some uncommented AMDGPU-specific logic; if this logic turns
out to be important then perhaps it could be moved into an override of
tryCandidate instead.
Graphics shader benchmarking on gfx10 shows a lot more positive than
negative effects from this change.
Reviewers: arsenm, tstellar, rampitec, kzhuravl, vpykhtin, dstuttard, tpr, atrick, MatzeB
Subscribers: jvesely, wdng, nhaehnle, yaxunl, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68338
2019-10-07 16:33:59 +02:00
|
|
|
; VI-NEXT: v_cvt_f32_ubyte3_e32 v3, v2
|
2020-10-16 09:09:38 +02:00
|
|
|
; VI-NEXT: s_waitcnt vmcnt(0)
|
[AMDGPU] Enable carry out ADD/SUB operations divergence driven instruction selection.
Summary: This change enables all kind of carry out ISD opcodes to be selected according to the node divergence.
Reviewers: rampitec, arsenm, vpykhtin
Reviewed By: rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78091
2020-04-23 19:55:36 +02:00
|
|
|
; VI-NEXT: v_cvt_f32_ubyte0_e32 v0, v0
|
2020-02-19 12:45:45 +01:00
|
|
|
; VI-NEXT: v_cvt_f32_ubyte2_e32 v2, v2
|
2019-04-22 12:19:09 +02:00
|
|
|
; VI-NEXT: buffer_store_dwordx3 v[4:6], off, s[4:7], 0 offset:16
|
2020-01-21 11:56:55 +01:00
|
|
|
; VI-NEXT: buffer_store_dwordx4 v[0:3], off, s[4:7], 0
|
2019-04-22 12:19:09 +02:00
|
|
|
; VI-NEXT: s_endpgm
|
2021-03-29 11:12:46 +02:00
|
|
|
;
|
|
|
|
; GFX10-LABEL: load_v7i8_to_v7f32:
|
|
|
|
; GFX10: ; %bb.0:
|
|
|
|
; GFX10-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x2c
|
|
|
|
; GFX10-NEXT: v_lshlrev_b32_e32 v0, 3, v0
|
|
|
|
; GFX10-NEXT: v_mov_b32_e32 v2, 0
|
|
|
|
; GFX10-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
|
2021-04-26 21:48:12 +02:00
|
|
|
; GFX10-NEXT: v_mov_b32_e32 v8, 0
|
2021-03-29 11:12:46 +02:00
|
|
|
; GFX10-NEXT: s_waitcnt lgkmcnt(0)
|
|
|
|
; GFX10-NEXT: s_clause 0x5
|
|
|
|
; GFX10-NEXT: global_load_ubyte v1, v0, s[2:3] offset:2
|
|
|
|
; GFX10-NEXT: global_load_ubyte v3, v0, s[2:3] offset:3
|
|
|
|
; GFX10-NEXT: global_load_short_d16 v2, v0, s[2:3] offset:4
|
2021-06-24 02:59:55 +02:00
|
|
|
; GFX10-NEXT: global_load_ubyte v4, v0, s[2:3] offset:6
|
|
|
|
; GFX10-NEXT: global_load_ubyte v5, v0, s[2:3] offset:1
|
2021-03-29 11:12:46 +02:00
|
|
|
; GFX10-NEXT: global_load_ubyte v7, v0, s[2:3]
|
|
|
|
; GFX10-NEXT: s_waitcnt vmcnt(4)
|
|
|
|
; GFX10-NEXT: v_lshl_or_b32 v0, v3, 8, v1
|
|
|
|
; GFX10-NEXT: s_waitcnt vmcnt(2)
|
2021-06-24 02:59:55 +02:00
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte0_e32 v6, v4
|
2021-03-29 11:12:46 +02:00
|
|
|
; GFX10-NEXT: s_waitcnt vmcnt(1)
|
2021-06-24 02:59:55 +02:00
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte2_e32 v1, v5
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte1_e32 v5, v2
|
2021-03-29 11:12:46 +02:00
|
|
|
; GFX10-NEXT: v_lshlrev_b32_e32 v0, 16, v0
|
2021-06-24 02:59:55 +02:00
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte0_e32 v4, v2
|
2021-03-29 11:12:46 +02:00
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte3_e32 v3, v0
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte2_e32 v2, v0
|
|
|
|
; GFX10-NEXT: s_waitcnt vmcnt(0)
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte0_e32 v0, v7
|
2021-06-24 02:59:55 +02:00
|
|
|
; GFX10-NEXT: global_store_dwordx3 v8, v[4:6], s[0:1] offset:16
|
2021-04-26 21:48:12 +02:00
|
|
|
; GFX10-NEXT: global_store_dwordx4 v8, v[0:3], s[0:1]
|
2021-03-29 11:12:46 +02:00
|
|
|
; GFX10-NEXT: s_endpgm
|
2017-07-04 19:32:00 +02:00
|
|
|
%tid = call i32 @llvm.amdgcn.workitem.id.x()
|
2017-08-07 16:58:04 +02:00
|
|
|
%gep = getelementptr <7 x i8>, <7 x i8> addrspace(1)* %in, i32 %tid
|
2017-07-04 19:32:00 +02:00
|
|
|
%load = load <7 x i8>, <7 x i8> addrspace(1)* %gep, align 1
|
2014-06-11 19:50:44 +02:00
|
|
|
%cvt = uitofp <7 x i8> %load to <7 x float>
|
|
|
|
store <7 x float> %cvt, <7 x float> addrspace(1)* %out, align 16
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2017-03-21 22:39:51 +01:00
|
|
|
define amdgpu_kernel void @load_v8i8_to_v8f32(<8 x float> addrspace(1)* noalias %out, <8 x i8> addrspace(1)* noalias %in) nounwind {
|
2019-04-22 12:19:09 +02:00
|
|
|
; SI-LABEL: load_v8i8_to_v8f32:
|
|
|
|
; SI: ; %bb.0:
|
|
|
|
; SI-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x9
|
|
|
|
; SI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0xb
|
|
|
|
; SI-NEXT: s_mov_b32 s7, 0xf000
|
|
|
|
; SI-NEXT: s_mov_b32 s2, 0
|
|
|
|
; SI-NEXT: s_mov_b32 s3, s7
|
|
|
|
; SI-NEXT: v_lshlrev_b32_e32 v0, 3, v0
|
|
|
|
; SI-NEXT: v_mov_b32_e32 v1, 0
|
|
|
|
; SI-NEXT: s_waitcnt lgkmcnt(0)
|
|
|
|
; SI-NEXT: buffer_load_dwordx2 v[7:8], v[0:1], s[0:3], 0 addr64
|
|
|
|
; SI-NEXT: s_mov_b32 s6, -1
|
|
|
|
; SI-NEXT: s_waitcnt vmcnt(0)
|
|
|
|
; SI-NEXT: v_cvt_f32_ubyte3_e32 v3, v7
|
|
|
|
; SI-NEXT: v_cvt_f32_ubyte2_e32 v2, v7
|
|
|
|
; SI-NEXT: v_cvt_f32_ubyte1_e32 v1, v7
|
|
|
|
; SI-NEXT: v_cvt_f32_ubyte0_e32 v0, v7
|
|
|
|
; SI-NEXT: v_cvt_f32_ubyte3_e32 v7, v8
|
|
|
|
; SI-NEXT: v_cvt_f32_ubyte2_e32 v6, v8
|
|
|
|
; SI-NEXT: v_cvt_f32_ubyte1_e32 v5, v8
|
|
|
|
; SI-NEXT: v_cvt_f32_ubyte0_e32 v4, v8
|
|
|
|
; SI-NEXT: buffer_store_dwordx4 v[4:7], off, s[4:7], 0 offset:16
|
|
|
|
; SI-NEXT: buffer_store_dwordx4 v[0:3], off, s[4:7], 0
|
|
|
|
; SI-NEXT: s_endpgm
|
|
|
|
;
|
|
|
|
; VI-LABEL: load_v8i8_to_v8f32:
|
|
|
|
; VI: ; %bb.0:
|
|
|
|
; VI-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x24
|
|
|
|
; VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x2c
|
|
|
|
; VI-NEXT: v_lshlrev_b32_e32 v0, 3, v0
|
|
|
|
; VI-NEXT: s_mov_b32 s7, 0xf000
|
|
|
|
; VI-NEXT: s_mov_b32 s6, -1
|
|
|
|
; VI-NEXT: s_waitcnt lgkmcnt(0)
|
|
|
|
; VI-NEXT: v_mov_b32_e32 v1, s1
|
|
|
|
; VI-NEXT: v_add_u32_e32 v0, vcc, s0, v0
|
|
|
|
; VI-NEXT: v_addc_u32_e32 v1, vcc, 0, v1, vcc
|
|
|
|
; VI-NEXT: flat_load_dwordx2 v[7:8], v[0:1]
|
2020-10-16 09:09:38 +02:00
|
|
|
; VI-NEXT: s_waitcnt vmcnt(0)
|
2019-04-22 12:19:09 +02:00
|
|
|
; VI-NEXT: v_cvt_f32_ubyte3_e32 v3, v7
|
|
|
|
; VI-NEXT: v_cvt_f32_ubyte2_e32 v2, v7
|
|
|
|
; VI-NEXT: v_cvt_f32_ubyte1_e32 v1, v7
|
|
|
|
; VI-NEXT: v_cvt_f32_ubyte0_e32 v0, v7
|
|
|
|
; VI-NEXT: v_cvt_f32_ubyte3_e32 v7, v8
|
|
|
|
; VI-NEXT: v_cvt_f32_ubyte2_e32 v6, v8
|
|
|
|
; VI-NEXT: v_cvt_f32_ubyte1_e32 v5, v8
|
|
|
|
; VI-NEXT: v_cvt_f32_ubyte0_e32 v4, v8
|
|
|
|
; VI-NEXT: buffer_store_dwordx4 v[4:7], off, s[4:7], 0 offset:16
|
|
|
|
; VI-NEXT: buffer_store_dwordx4 v[0:3], off, s[4:7], 0
|
|
|
|
; VI-NEXT: s_endpgm
|
2021-03-29 11:12:46 +02:00
|
|
|
;
|
|
|
|
; GFX10-LABEL: load_v8i8_to_v8f32:
|
|
|
|
; GFX10: ; %bb.0:
|
|
|
|
; GFX10-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x2c
|
|
|
|
; GFX10-NEXT: v_lshlrev_b32_e32 v0, 3, v0
|
|
|
|
; GFX10-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
|
|
|
|
; GFX10-NEXT: v_mov_b32_e32 v10, 0
|
|
|
|
; GFX10-NEXT: s_waitcnt lgkmcnt(0)
|
|
|
|
; GFX10-NEXT: global_load_dwordx2 v[8:9], v0, s[2:3]
|
|
|
|
; GFX10-NEXT: s_waitcnt vmcnt(0)
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte3_e32 v7, v9
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte2_e32 v6, v9
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte1_e32 v5, v9
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte0_e32 v4, v9
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte3_e32 v3, v8
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte2_e32 v2, v8
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte1_e32 v1, v8
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte0_e32 v0, v8
|
|
|
|
; GFX10-NEXT: global_store_dwordx4 v10, v[4:7], s[0:1] offset:16
|
|
|
|
; GFX10-NEXT: global_store_dwordx4 v10, v[0:3], s[0:1]
|
|
|
|
; GFX10-NEXT: s_endpgm
|
2017-07-04 19:32:00 +02:00
|
|
|
%tid = call i32 @llvm.amdgcn.workitem.id.x()
|
2017-08-07 16:58:04 +02:00
|
|
|
%gep = getelementptr <8 x i8>, <8 x i8> addrspace(1)* %in, i32 %tid
|
2017-07-04 19:32:00 +02:00
|
|
|
%load = load <8 x i8>, <8 x i8> addrspace(1)* %gep, align 8
|
2014-06-11 19:50:44 +02:00
|
|
|
%cvt = uitofp <8 x i8> %load to <8 x float>
|
|
|
|
store <8 x float> %cvt, <8 x float> addrspace(1)* %out, align 16
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2017-03-21 22:39:51 +01:00
|
|
|
define amdgpu_kernel void @i8_zext_inreg_i32_to_f32(float addrspace(1)* noalias %out, i32 addrspace(1)* noalias %in) nounwind {
|
2019-04-22 12:19:09 +02:00
|
|
|
; SI-LABEL: i8_zext_inreg_i32_to_f32:
|
|
|
|
; SI: ; %bb.0:
|
|
|
|
; SI-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x9
|
|
|
|
; SI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0xb
|
|
|
|
; SI-NEXT: s_mov_b32 s7, 0xf000
|
|
|
|
; SI-NEXT: s_mov_b32 s2, 0
|
|
|
|
; SI-NEXT: s_mov_b32 s3, s7
|
|
|
|
; SI-NEXT: v_lshlrev_b32_e32 v0, 2, v0
|
|
|
|
; SI-NEXT: v_mov_b32_e32 v1, 0
|
|
|
|
; SI-NEXT: s_waitcnt lgkmcnt(0)
|
|
|
|
; SI-NEXT: buffer_load_dword v0, v[0:1], s[0:3], 0 addr64
|
|
|
|
; SI-NEXT: s_mov_b32 s6, -1
|
|
|
|
; SI-NEXT: s_waitcnt vmcnt(0)
|
|
|
|
; SI-NEXT: v_add_i32_e32 v0, vcc, 2, v0
|
|
|
|
; SI-NEXT: v_cvt_f32_ubyte0_e32 v0, v0
|
|
|
|
; SI-NEXT: buffer_store_dword v0, off, s[4:7], 0
|
|
|
|
; SI-NEXT: s_endpgm
|
|
|
|
;
|
|
|
|
; VI-LABEL: i8_zext_inreg_i32_to_f32:
|
|
|
|
; VI: ; %bb.0:
|
|
|
|
; VI-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x24
|
|
|
|
; VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x2c
|
|
|
|
; VI-NEXT: v_lshlrev_b32_e32 v0, 2, v0
|
|
|
|
; VI-NEXT: s_mov_b32 s7, 0xf000
|
|
|
|
; VI-NEXT: s_mov_b32 s6, -1
|
|
|
|
; VI-NEXT: s_waitcnt lgkmcnt(0)
|
|
|
|
; VI-NEXT: v_mov_b32_e32 v1, s1
|
|
|
|
; VI-NEXT: v_add_u32_e32 v0, vcc, s0, v0
|
|
|
|
; VI-NEXT: v_addc_u32_e32 v1, vcc, 0, v1, vcc
|
|
|
|
; VI-NEXT: flat_load_dword v0, v[0:1]
|
2020-10-16 09:09:38 +02:00
|
|
|
; VI-NEXT: s_waitcnt vmcnt(0)
|
2019-04-22 12:19:09 +02:00
|
|
|
; VI-NEXT: v_add_u32_e32 v0, vcc, 2, v0
|
|
|
|
; VI-NEXT: v_cvt_f32_ubyte0_e32 v0, v0
|
|
|
|
; VI-NEXT: buffer_store_dword v0, off, s[4:7], 0
|
|
|
|
; VI-NEXT: s_endpgm
|
2021-03-29 11:12:46 +02:00
|
|
|
;
|
|
|
|
; GFX10-LABEL: i8_zext_inreg_i32_to_f32:
|
|
|
|
; GFX10: ; %bb.0:
|
|
|
|
; GFX10-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x2c
|
|
|
|
; GFX10-NEXT: v_lshlrev_b32_e32 v0, 2, v0
|
|
|
|
; GFX10-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
|
|
|
|
; GFX10-NEXT: v_mov_b32_e32 v1, 0
|
|
|
|
; GFX10-NEXT: s_waitcnt lgkmcnt(0)
|
|
|
|
; GFX10-NEXT: global_load_dword v0, v0, s[2:3]
|
|
|
|
; GFX10-NEXT: s_waitcnt vmcnt(0)
|
|
|
|
; GFX10-NEXT: v_add_nc_u32_e32 v0, 2, v0
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte0_e32 v0, v0
|
|
|
|
; GFX10-NEXT: global_store_dword v1, v0, s[0:1]
|
|
|
|
; GFX10-NEXT: s_endpgm
|
2017-07-04 19:32:00 +02:00
|
|
|
%tid = call i32 @llvm.amdgcn.workitem.id.x()
|
2017-08-07 16:58:04 +02:00
|
|
|
%gep = getelementptr i32, i32 addrspace(1)* %in, i32 %tid
|
2017-07-04 19:32:00 +02:00
|
|
|
%load = load i32, i32 addrspace(1)* %gep, align 4
|
2014-06-11 19:50:44 +02:00
|
|
|
%add = add i32 %load, 2
|
|
|
|
%inreg = and i32 %add, 255
|
|
|
|
%cvt = uitofp i32 %inreg to float
|
|
|
|
store float %cvt, float addrspace(1)* %out, align 4
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2017-03-21 22:39:51 +01:00
|
|
|
define amdgpu_kernel void @i8_zext_inreg_hi1_to_f32(float addrspace(1)* noalias %out, i32 addrspace(1)* noalias %in) nounwind {
|
2019-04-22 12:19:09 +02:00
|
|
|
; SI-LABEL: i8_zext_inreg_hi1_to_f32:
|
|
|
|
; SI: ; %bb.0:
|
|
|
|
; SI-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x9
|
|
|
|
; SI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0xb
|
|
|
|
; SI-NEXT: s_mov_b32 s7, 0xf000
|
|
|
|
; SI-NEXT: s_mov_b32 s2, 0
|
|
|
|
; SI-NEXT: s_mov_b32 s3, s7
|
|
|
|
; SI-NEXT: v_lshlrev_b32_e32 v0, 2, v0
|
|
|
|
; SI-NEXT: v_mov_b32_e32 v1, 0
|
|
|
|
; SI-NEXT: s_waitcnt lgkmcnt(0)
|
|
|
|
; SI-NEXT: buffer_load_dword v0, v[0:1], s[0:3], 0 addr64
|
|
|
|
; SI-NEXT: s_mov_b32 s6, -1
|
|
|
|
; SI-NEXT: s_waitcnt vmcnt(0)
|
|
|
|
; SI-NEXT: v_cvt_f32_ubyte1_e32 v0, v0
|
|
|
|
; SI-NEXT: buffer_store_dword v0, off, s[4:7], 0
|
|
|
|
; SI-NEXT: s_endpgm
|
|
|
|
;
|
|
|
|
; VI-LABEL: i8_zext_inreg_hi1_to_f32:
|
|
|
|
; VI: ; %bb.0:
|
|
|
|
; VI-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x24
|
|
|
|
; VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x2c
|
|
|
|
; VI-NEXT: v_lshlrev_b32_e32 v0, 2, v0
|
|
|
|
; VI-NEXT: s_mov_b32 s7, 0xf000
|
|
|
|
; VI-NEXT: s_mov_b32 s6, -1
|
|
|
|
; VI-NEXT: s_waitcnt lgkmcnt(0)
|
|
|
|
; VI-NEXT: v_mov_b32_e32 v1, s1
|
|
|
|
; VI-NEXT: v_add_u32_e32 v0, vcc, s0, v0
|
|
|
|
; VI-NEXT: v_addc_u32_e32 v1, vcc, 0, v1, vcc
|
|
|
|
; VI-NEXT: flat_load_dword v0, v[0:1]
|
2020-10-16 09:09:38 +02:00
|
|
|
; VI-NEXT: s_waitcnt vmcnt(0)
|
2019-04-22 12:19:09 +02:00
|
|
|
; VI-NEXT: v_cvt_f32_ubyte1_e32 v0, v0
|
|
|
|
; VI-NEXT: buffer_store_dword v0, off, s[4:7], 0
|
|
|
|
; VI-NEXT: s_endpgm
|
2021-03-29 11:12:46 +02:00
|
|
|
;
|
|
|
|
; GFX10-LABEL: i8_zext_inreg_hi1_to_f32:
|
|
|
|
; GFX10: ; %bb.0:
|
|
|
|
; GFX10-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x2c
|
|
|
|
; GFX10-NEXT: v_lshlrev_b32_e32 v0, 2, v0
|
|
|
|
; GFX10-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
|
|
|
|
; GFX10-NEXT: v_mov_b32_e32 v1, 0
|
|
|
|
; GFX10-NEXT: s_waitcnt lgkmcnt(0)
|
|
|
|
; GFX10-NEXT: global_load_dword v0, v0, s[2:3]
|
|
|
|
; GFX10-NEXT: s_waitcnt vmcnt(0)
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte1_e32 v0, v0
|
|
|
|
; GFX10-NEXT: global_store_dword v1, v0, s[0:1]
|
|
|
|
; GFX10-NEXT: s_endpgm
|
2017-07-04 19:32:00 +02:00
|
|
|
%tid = call i32 @llvm.amdgcn.workitem.id.x()
|
2017-08-07 16:58:04 +02:00
|
|
|
%gep = getelementptr i32, i32 addrspace(1)* %in, i32 %tid
|
2017-07-04 19:32:00 +02:00
|
|
|
%load = load i32, i32 addrspace(1)* %gep, align 4
|
2014-06-11 19:50:44 +02:00
|
|
|
%inreg = and i32 %load, 65280
|
|
|
|
%shr = lshr i32 %inreg, 8
|
|
|
|
%cvt = uitofp i32 %shr to float
|
|
|
|
store float %cvt, float addrspace(1)* %out, align 4
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; We don't get these ones because of the zext, but instcombine removes
|
|
|
|
; them so it shouldn't really matter.
|
2017-03-21 22:39:51 +01:00
|
|
|
define amdgpu_kernel void @i8_zext_i32_to_f32(float addrspace(1)* noalias %out, i8 addrspace(1)* noalias %in) nounwind {
|
2019-04-22 12:19:09 +02:00
|
|
|
; SI-LABEL: i8_zext_i32_to_f32:
|
|
|
|
; SI: ; %bb.0:
|
|
|
|
; SI-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x9
|
|
|
|
; SI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0xb
|
|
|
|
; SI-NEXT: s_mov_b32 s7, 0xf000
|
|
|
|
; SI-NEXT: v_mov_b32_e32 v1, 0
|
|
|
|
; SI-NEXT: s_mov_b32 s2, 0
|
|
|
|
; SI-NEXT: s_mov_b32 s3, s7
|
|
|
|
; SI-NEXT: s_waitcnt lgkmcnt(0)
|
|
|
|
; SI-NEXT: buffer_load_ubyte v0, v[0:1], s[0:3], 0 addr64
|
|
|
|
; SI-NEXT: s_mov_b32 s6, -1
|
|
|
|
; SI-NEXT: s_waitcnt vmcnt(0)
|
|
|
|
; SI-NEXT: v_cvt_f32_ubyte0_e32 v0, v0
|
|
|
|
; SI-NEXT: buffer_store_dword v0, off, s[4:7], 0
|
|
|
|
; SI-NEXT: s_endpgm
|
|
|
|
;
|
|
|
|
; VI-LABEL: i8_zext_i32_to_f32:
|
|
|
|
; VI: ; %bb.0:
|
|
|
|
; VI-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x24
|
|
|
|
; VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x2c
|
|
|
|
; VI-NEXT: s_mov_b32 s7, 0xf000
|
|
|
|
; VI-NEXT: s_mov_b32 s6, -1
|
|
|
|
; VI-NEXT: s_waitcnt lgkmcnt(0)
|
|
|
|
; VI-NEXT: v_mov_b32_e32 v1, s1
|
|
|
|
; VI-NEXT: v_add_u32_e32 v0, vcc, s0, v0
|
|
|
|
; VI-NEXT: v_addc_u32_e32 v1, vcc, 0, v1, vcc
|
|
|
|
; VI-NEXT: flat_load_ubyte v0, v[0:1]
|
2020-10-16 09:09:38 +02:00
|
|
|
; VI-NEXT: s_waitcnt vmcnt(0)
|
2019-04-22 12:19:09 +02:00
|
|
|
; VI-NEXT: v_cvt_f32_ubyte0_e32 v0, v0
|
|
|
|
; VI-NEXT: buffer_store_dword v0, off, s[4:7], 0
|
|
|
|
; VI-NEXT: s_endpgm
|
2021-03-29 11:12:46 +02:00
|
|
|
;
|
|
|
|
; GFX10-LABEL: i8_zext_i32_to_f32:
|
|
|
|
; GFX10: ; %bb.0:
|
|
|
|
; GFX10-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x2c
|
|
|
|
; GFX10-NEXT: v_mov_b32_e32 v1, 0
|
|
|
|
; GFX10-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
|
|
|
|
; GFX10-NEXT: s_waitcnt lgkmcnt(0)
|
|
|
|
; GFX10-NEXT: global_load_ubyte v0, v0, s[2:3]
|
|
|
|
; GFX10-NEXT: s_waitcnt vmcnt(0)
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte0_e32 v0, v0
|
|
|
|
; GFX10-NEXT: global_store_dword v1, v0, s[0:1]
|
|
|
|
; GFX10-NEXT: s_endpgm
|
2017-07-04 19:32:00 +02:00
|
|
|
%tid = call i32 @llvm.amdgcn.workitem.id.x()
|
2017-08-07 16:58:04 +02:00
|
|
|
%gep = getelementptr i8, i8 addrspace(1)* %in, i32 %tid
|
2017-07-04 19:32:00 +02:00
|
|
|
%load = load i8, i8 addrspace(1)* %gep, align 1
|
2014-06-11 19:50:44 +02:00
|
|
|
%ext = zext i8 %load to i32
|
|
|
|
%cvt = uitofp i32 %ext to float
|
|
|
|
store float %cvt, float addrspace(1)* %out, align 4
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2017-03-21 22:39:51 +01:00
|
|
|
define amdgpu_kernel void @v4i8_zext_v4i32_to_v4f32(<4 x float> addrspace(1)* noalias %out, <4 x i8> addrspace(1)* noalias %in) nounwind {
|
2019-04-22 12:19:09 +02:00
|
|
|
; SI-LABEL: v4i8_zext_v4i32_to_v4f32:
|
|
|
|
; SI: ; %bb.0:
|
|
|
|
; SI-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x9
|
|
|
|
; SI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0xb
|
|
|
|
; SI-NEXT: s_mov_b32 s7, 0xf000
|
|
|
|
; SI-NEXT: s_mov_b32 s2, 0
|
|
|
|
; SI-NEXT: s_mov_b32 s3, s7
|
|
|
|
; SI-NEXT: v_lshlrev_b32_e32 v0, 2, v0
|
|
|
|
; SI-NEXT: v_mov_b32_e32 v1, 0
|
|
|
|
; SI-NEXT: s_waitcnt lgkmcnt(0)
|
2020-02-19 12:45:45 +01:00
|
|
|
; SI-NEXT: buffer_load_ubyte v4, v[0:1], s[0:3], 0 addr64
|
|
|
|
; SI-NEXT: buffer_load_ubyte v2, v[0:1], s[0:3], 0 addr64 offset:1
|
|
|
|
; SI-NEXT: buffer_load_ubyte v3, v[0:1], s[0:3], 0 addr64 offset:2
|
2019-04-22 12:19:09 +02:00
|
|
|
; SI-NEXT: buffer_load_ubyte v0, v[0:1], s[0:3], 0 addr64 offset:3
|
|
|
|
; SI-NEXT: s_mov_b32 s6, -1
|
|
|
|
; SI-NEXT: s_waitcnt vmcnt(2)
|
2020-02-19 12:45:45 +01:00
|
|
|
; SI-NEXT: v_cvt_f32_ubyte2_e32 v1, v2
|
2019-04-22 12:19:09 +02:00
|
|
|
; SI-NEXT: s_waitcnt vmcnt(0)
|
|
|
|
; SI-NEXT: v_lshlrev_b32_e32 v0, 8, v0
|
2020-02-19 12:45:45 +01:00
|
|
|
; SI-NEXT: v_or_b32_e32 v0, v0, v3
|
2019-04-22 12:19:09 +02:00
|
|
|
; SI-NEXT: v_lshlrev_b32_e32 v0, 16, v0
|
2020-03-04 11:53:27 +01:00
|
|
|
; SI-NEXT: v_cvt_f32_ubyte3_e32 v3, v0
|
2019-04-22 12:19:09 +02:00
|
|
|
; SI-NEXT: v_cvt_f32_ubyte2_e32 v2, v0
|
2020-02-19 12:45:45 +01:00
|
|
|
; SI-NEXT: v_cvt_f32_ubyte0_e32 v0, v4
|
2019-04-22 12:19:09 +02:00
|
|
|
; SI-NEXT: buffer_store_dwordx4 v[0:3], off, s[4:7], 0
|
|
|
|
; SI-NEXT: s_endpgm
|
|
|
|
;
|
|
|
|
; VI-LABEL: v4i8_zext_v4i32_to_v4f32:
|
|
|
|
; VI: ; %bb.0:
|
|
|
|
; VI-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x24
|
|
|
|
; VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x2c
|
|
|
|
; VI-NEXT: v_lshlrev_b32_e32 v0, 2, v0
|
|
|
|
; VI-NEXT: s_mov_b32 s7, 0xf000
|
|
|
|
; VI-NEXT: s_mov_b32 s6, -1
|
|
|
|
; VI-NEXT: s_waitcnt lgkmcnt(0)
|
|
|
|
; VI-NEXT: v_mov_b32_e32 v1, s1
|
|
|
|
; VI-NEXT: v_add_u32_e32 v0, vcc, s0, v0
|
|
|
|
; VI-NEXT: v_addc_u32_e32 v1, vcc, 0, v1, vcc
|
2020-02-19 12:45:45 +01:00
|
|
|
; VI-NEXT: v_add_u32_e32 v2, vcc, 3, v0
|
2019-04-22 12:19:09 +02:00
|
|
|
; VI-NEXT: v_addc_u32_e32 v3, vcc, 0, v1, vcc
|
2020-02-19 12:45:45 +01:00
|
|
|
; VI-NEXT: v_add_u32_e32 v4, vcc, 2, v0
|
2019-04-22 12:19:09 +02:00
|
|
|
; VI-NEXT: v_addc_u32_e32 v5, vcc, 0, v1, vcc
|
2020-02-19 12:45:45 +01:00
|
|
|
; VI-NEXT: v_add_u32_e32 v6, vcc, 1, v0
|
|
|
|
; VI-NEXT: v_addc_u32_e32 v7, vcc, 0, v1, vcc
|
[AMDGPU] Enable carry out ADD/SUB operations divergence driven instruction selection.
Summary: This change enables all kind of carry out ISD opcodes to be selected according to the node divergence.
Reviewers: rampitec, arsenm, vpykhtin
Reviewed By: rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78091
2020-04-23 19:55:36 +02:00
|
|
|
; VI-NEXT: flat_load_ubyte v4, v[4:5]
|
|
|
|
; VI-NEXT: flat_load_ubyte v5, v[6:7]
|
2019-04-22 12:19:09 +02:00
|
|
|
; VI-NEXT: flat_load_ubyte v2, v[2:3]
|
[MachineScheduler] Reduce reordering due to mem op clustering
Summary:
Mem op clustering adds a weak edge in the DAG between two loads or
stores that should be clustered, but the direction of this edge is
pretty arbitrary (it depends on the sort order of MemOpInfo, which
represents the operands of a load or store). This often means that two
loads or stores will get reordered even if they would naturally have
been scheduled together anyway, which leads to test case churn and goes
against the scheduler's "do no harm" philosophy.
The fix makes sure that the direction of the edge always matches the
original code order of the instructions.
Reviewers: atrick, MatzeB, arsenm, rampitec, t.p.northover
Subscribers: jvesely, wdng, nhaehnle, kristof.beyls, hiraditya, javed.absar, arphaman, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72706
2020-01-14 16:40:52 +01:00
|
|
|
; VI-NEXT: flat_load_ubyte v0, v[0:1]
|
2020-10-16 09:09:38 +02:00
|
|
|
; VI-NEXT: s_waitcnt vmcnt(1)
|
[MachineScheduler] Reduce reordering due to mem op clustering
Summary:
Mem op clustering adds a weak edge in the DAG between two loads or
stores that should be clustered, but the direction of this edge is
pretty arbitrary (it depends on the sort order of MemOpInfo, which
represents the operands of a load or store). This often means that two
loads or stores will get reordered even if they would naturally have
been scheduled together anyway, which leads to test case churn and goes
against the scheduler's "do no harm" philosophy.
The fix makes sure that the direction of the edge always matches the
original code order of the instructions.
Reviewers: atrick, MatzeB, arsenm, rampitec, t.p.northover
Subscribers: jvesely, wdng, nhaehnle, kristof.beyls, hiraditya, javed.absar, arphaman, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72706
2020-01-14 16:40:52 +01:00
|
|
|
; VI-NEXT: v_lshlrev_b32_e32 v1, 8, v2
|
[AMDGPU] Enable carry out ADD/SUB operations divergence driven instruction selection.
Summary: This change enables all kind of carry out ISD opcodes to be selected according to the node divergence.
Reviewers: rampitec, arsenm, vpykhtin
Reviewed By: rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78091
2020-04-23 19:55:36 +02:00
|
|
|
; VI-NEXT: v_or_b32_sdwa v1, v1, v4 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
|
2020-10-16 09:09:38 +02:00
|
|
|
; VI-NEXT: s_waitcnt vmcnt(0)
|
2019-04-22 12:19:09 +02:00
|
|
|
; VI-NEXT: v_cvt_f32_ubyte0_e32 v0, v0
|
[AMDGPU] Enable carry out ADD/SUB operations divergence driven instruction selection.
Summary: This change enables all kind of carry out ISD opcodes to be selected according to the node divergence.
Reviewers: rampitec, arsenm, vpykhtin
Reviewed By: rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78091
2020-04-23 19:55:36 +02:00
|
|
|
; VI-NEXT: v_cvt_f32_ubyte3_e32 v3, v1
|
|
|
|
; VI-NEXT: v_cvt_f32_ubyte2_e32 v2, v1
|
|
|
|
; VI-NEXT: v_cvt_f32_ubyte2_e32 v1, v5
|
2019-04-22 12:19:09 +02:00
|
|
|
; VI-NEXT: buffer_store_dwordx4 v[0:3], off, s[4:7], 0
|
|
|
|
; VI-NEXT: s_endpgm
|
2021-03-29 11:12:46 +02:00
|
|
|
;
|
|
|
|
; GFX10-LABEL: v4i8_zext_v4i32_to_v4f32:
|
|
|
|
; GFX10: ; %bb.0:
|
|
|
|
; GFX10-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x2c
|
|
|
|
; GFX10-NEXT: v_lshlrev_b32_e32 v0, 2, v0
|
|
|
|
; GFX10-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
|
|
|
|
; GFX10-NEXT: v_mov_b32_e32 v5, 0
|
|
|
|
; GFX10-NEXT: s_waitcnt lgkmcnt(0)
|
|
|
|
; GFX10-NEXT: s_clause 0x3
|
|
|
|
; GFX10-NEXT: global_load_ubyte v1, v0, s[2:3] offset:3
|
|
|
|
; GFX10-NEXT: global_load_ubyte v2, v0, s[2:3] offset:2
|
|
|
|
; GFX10-NEXT: global_load_ubyte v3, v0, s[2:3] offset:1
|
|
|
|
; GFX10-NEXT: global_load_ubyte v4, v0, s[2:3]
|
|
|
|
; GFX10-NEXT: s_waitcnt vmcnt(2)
|
|
|
|
; GFX10-NEXT: v_lshl_or_b32 v0, v1, 8, v2
|
|
|
|
; GFX10-NEXT: s_waitcnt vmcnt(1)
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte2_e32 v1, v3
|
|
|
|
; GFX10-NEXT: v_lshlrev_b32_e32 v0, 16, v0
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte3_e32 v3, v0
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte2_e32 v2, v0
|
|
|
|
; GFX10-NEXT: s_waitcnt vmcnt(0)
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte0_e32 v0, v4
|
|
|
|
; GFX10-NEXT: global_store_dwordx4 v5, v[0:3], s[0:1]
|
|
|
|
; GFX10-NEXT: s_endpgm
|
2017-07-04 19:32:00 +02:00
|
|
|
%tid = call i32 @llvm.amdgcn.workitem.id.x()
|
2017-08-07 16:58:04 +02:00
|
|
|
%gep = getelementptr <4 x i8>, <4 x i8> addrspace(1)* %in, i32 %tid
|
2017-07-04 19:32:00 +02:00
|
|
|
%load = load <4 x i8>, <4 x i8> addrspace(1)* %gep, align 1
|
2014-06-11 19:50:44 +02:00
|
|
|
%ext = zext <4 x i8> %load to <4 x i32>
|
|
|
|
%cvt = uitofp <4 x i32> %ext to <4 x float>
|
|
|
|
store <4 x float> %cvt, <4 x float> addrspace(1)* %out, align 16
|
|
|
|
ret void
|
|
|
|
}
|
2016-05-09 18:29:50 +02:00
|
|
|
|
2017-03-21 22:39:51 +01:00
|
|
|
define amdgpu_kernel void @extract_byte0_to_f32(float addrspace(1)* noalias %out, i32 addrspace(1)* noalias %in) nounwind {
|
2019-04-22 12:19:09 +02:00
|
|
|
; SI-LABEL: extract_byte0_to_f32:
|
|
|
|
; SI: ; %bb.0:
|
|
|
|
; SI-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x9
|
|
|
|
; SI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0xb
|
|
|
|
; SI-NEXT: s_mov_b32 s7, 0xf000
|
|
|
|
; SI-NEXT: s_mov_b32 s2, 0
|
|
|
|
; SI-NEXT: s_mov_b32 s3, s7
|
|
|
|
; SI-NEXT: v_lshlrev_b32_e32 v0, 2, v0
|
|
|
|
; SI-NEXT: v_mov_b32_e32 v1, 0
|
|
|
|
; SI-NEXT: s_waitcnt lgkmcnt(0)
|
|
|
|
; SI-NEXT: buffer_load_dword v0, v[0:1], s[0:3], 0 addr64
|
|
|
|
; SI-NEXT: s_mov_b32 s6, -1
|
|
|
|
; SI-NEXT: s_waitcnt vmcnt(0)
|
|
|
|
; SI-NEXT: v_cvt_f32_ubyte0_e32 v0, v0
|
|
|
|
; SI-NEXT: buffer_store_dword v0, off, s[4:7], 0
|
|
|
|
; SI-NEXT: s_endpgm
|
|
|
|
;
|
|
|
|
; VI-LABEL: extract_byte0_to_f32:
|
|
|
|
; VI: ; %bb.0:
|
|
|
|
; VI-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x24
|
|
|
|
; VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x2c
|
|
|
|
; VI-NEXT: v_lshlrev_b32_e32 v0, 2, v0
|
|
|
|
; VI-NEXT: s_mov_b32 s7, 0xf000
|
|
|
|
; VI-NEXT: s_mov_b32 s6, -1
|
|
|
|
; VI-NEXT: s_waitcnt lgkmcnt(0)
|
|
|
|
; VI-NEXT: v_mov_b32_e32 v1, s1
|
|
|
|
; VI-NEXT: v_add_u32_e32 v0, vcc, s0, v0
|
|
|
|
; VI-NEXT: v_addc_u32_e32 v1, vcc, 0, v1, vcc
|
|
|
|
; VI-NEXT: flat_load_dword v0, v[0:1]
|
2020-10-16 09:09:38 +02:00
|
|
|
; VI-NEXT: s_waitcnt vmcnt(0)
|
2019-04-22 12:19:09 +02:00
|
|
|
; VI-NEXT: v_cvt_f32_ubyte0_e32 v0, v0
|
|
|
|
; VI-NEXT: buffer_store_dword v0, off, s[4:7], 0
|
|
|
|
; VI-NEXT: s_endpgm
|
2021-03-29 11:12:46 +02:00
|
|
|
;
|
|
|
|
; GFX10-LABEL: extract_byte0_to_f32:
|
|
|
|
; GFX10: ; %bb.0:
|
|
|
|
; GFX10-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x2c
|
|
|
|
; GFX10-NEXT: v_lshlrev_b32_e32 v0, 2, v0
|
|
|
|
; GFX10-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
|
|
|
|
; GFX10-NEXT: v_mov_b32_e32 v1, 0
|
|
|
|
; GFX10-NEXT: s_waitcnt lgkmcnt(0)
|
|
|
|
; GFX10-NEXT: global_load_dword v0, v0, s[2:3]
|
|
|
|
; GFX10-NEXT: s_waitcnt vmcnt(0)
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte0_e32 v0, v0
|
|
|
|
; GFX10-NEXT: global_store_dword v1, v0, s[0:1]
|
|
|
|
; GFX10-NEXT: s_endpgm
|
2017-07-04 19:32:00 +02:00
|
|
|
%tid = call i32 @llvm.amdgcn.workitem.id.x()
|
2017-08-07 16:58:04 +02:00
|
|
|
%gep = getelementptr i32, i32 addrspace(1)* %in, i32 %tid
|
2017-07-04 19:32:00 +02:00
|
|
|
%val = load i32, i32 addrspace(1)* %gep
|
2016-05-09 18:29:50 +02:00
|
|
|
%and = and i32 %val, 255
|
|
|
|
%cvt = uitofp i32 %and to float
|
|
|
|
store float %cvt, float addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2017-03-21 22:39:51 +01:00
|
|
|
define amdgpu_kernel void @extract_byte1_to_f32(float addrspace(1)* noalias %out, i32 addrspace(1)* noalias %in) nounwind {
|
2019-04-22 12:19:09 +02:00
|
|
|
; SI-LABEL: extract_byte1_to_f32:
|
|
|
|
; SI: ; %bb.0:
|
|
|
|
; SI-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x9
|
|
|
|
; SI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0xb
|
|
|
|
; SI-NEXT: s_mov_b32 s7, 0xf000
|
|
|
|
; SI-NEXT: s_mov_b32 s2, 0
|
|
|
|
; SI-NEXT: s_mov_b32 s3, s7
|
|
|
|
; SI-NEXT: v_lshlrev_b32_e32 v0, 2, v0
|
|
|
|
; SI-NEXT: v_mov_b32_e32 v1, 0
|
|
|
|
; SI-NEXT: s_waitcnt lgkmcnt(0)
|
|
|
|
; SI-NEXT: buffer_load_dword v0, v[0:1], s[0:3], 0 addr64
|
|
|
|
; SI-NEXT: s_mov_b32 s6, -1
|
|
|
|
; SI-NEXT: s_waitcnt vmcnt(0)
|
|
|
|
; SI-NEXT: v_cvt_f32_ubyte1_e32 v0, v0
|
|
|
|
; SI-NEXT: buffer_store_dword v0, off, s[4:7], 0
|
|
|
|
; SI-NEXT: s_endpgm
|
|
|
|
;
|
|
|
|
; VI-LABEL: extract_byte1_to_f32:
|
|
|
|
; VI: ; %bb.0:
|
|
|
|
; VI-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x24
|
|
|
|
; VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x2c
|
|
|
|
; VI-NEXT: v_lshlrev_b32_e32 v0, 2, v0
|
|
|
|
; VI-NEXT: s_mov_b32 s7, 0xf000
|
|
|
|
; VI-NEXT: s_mov_b32 s6, -1
|
|
|
|
; VI-NEXT: s_waitcnt lgkmcnt(0)
|
|
|
|
; VI-NEXT: v_mov_b32_e32 v1, s1
|
|
|
|
; VI-NEXT: v_add_u32_e32 v0, vcc, s0, v0
|
|
|
|
; VI-NEXT: v_addc_u32_e32 v1, vcc, 0, v1, vcc
|
|
|
|
; VI-NEXT: flat_load_dword v0, v[0:1]
|
2020-10-16 09:09:38 +02:00
|
|
|
; VI-NEXT: s_waitcnt vmcnt(0)
|
2019-04-22 12:19:09 +02:00
|
|
|
; VI-NEXT: v_cvt_f32_ubyte1_e32 v0, v0
|
|
|
|
; VI-NEXT: buffer_store_dword v0, off, s[4:7], 0
|
|
|
|
; VI-NEXT: s_endpgm
|
2021-03-29 11:12:46 +02:00
|
|
|
;
|
|
|
|
; GFX10-LABEL: extract_byte1_to_f32:
|
|
|
|
; GFX10: ; %bb.0:
|
|
|
|
; GFX10-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x2c
|
|
|
|
; GFX10-NEXT: v_lshlrev_b32_e32 v0, 2, v0
|
|
|
|
; GFX10-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
|
|
|
|
; GFX10-NEXT: v_mov_b32_e32 v1, 0
|
|
|
|
; GFX10-NEXT: s_waitcnt lgkmcnt(0)
|
|
|
|
; GFX10-NEXT: global_load_dword v0, v0, s[2:3]
|
|
|
|
; GFX10-NEXT: s_waitcnt vmcnt(0)
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte1_e32 v0, v0
|
|
|
|
; GFX10-NEXT: global_store_dword v1, v0, s[0:1]
|
|
|
|
; GFX10-NEXT: s_endpgm
|
2017-07-04 19:32:00 +02:00
|
|
|
%tid = call i32 @llvm.amdgcn.workitem.id.x()
|
2017-08-07 16:58:04 +02:00
|
|
|
%gep = getelementptr i32, i32 addrspace(1)* %in, i32 %tid
|
2017-07-04 19:32:00 +02:00
|
|
|
%val = load i32, i32 addrspace(1)* %gep
|
2016-05-09 18:29:50 +02:00
|
|
|
%srl = lshr i32 %val, 8
|
|
|
|
%and = and i32 %srl, 255
|
|
|
|
%cvt = uitofp i32 %and to float
|
|
|
|
store float %cvt, float addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2017-03-21 22:39:51 +01:00
|
|
|
define amdgpu_kernel void @extract_byte2_to_f32(float addrspace(1)* noalias %out, i32 addrspace(1)* noalias %in) nounwind {
|
2019-04-22 12:19:09 +02:00
|
|
|
; SI-LABEL: extract_byte2_to_f32:
|
|
|
|
; SI: ; %bb.0:
|
|
|
|
; SI-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x9
|
|
|
|
; SI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0xb
|
|
|
|
; SI-NEXT: s_mov_b32 s7, 0xf000
|
|
|
|
; SI-NEXT: s_mov_b32 s2, 0
|
|
|
|
; SI-NEXT: s_mov_b32 s3, s7
|
|
|
|
; SI-NEXT: v_lshlrev_b32_e32 v0, 2, v0
|
|
|
|
; SI-NEXT: v_mov_b32_e32 v1, 0
|
|
|
|
; SI-NEXT: s_waitcnt lgkmcnt(0)
|
|
|
|
; SI-NEXT: buffer_load_dword v0, v[0:1], s[0:3], 0 addr64
|
|
|
|
; SI-NEXT: s_mov_b32 s6, -1
|
|
|
|
; SI-NEXT: s_waitcnt vmcnt(0)
|
|
|
|
; SI-NEXT: v_cvt_f32_ubyte2_e32 v0, v0
|
|
|
|
; SI-NEXT: buffer_store_dword v0, off, s[4:7], 0
|
|
|
|
; SI-NEXT: s_endpgm
|
|
|
|
;
|
|
|
|
; VI-LABEL: extract_byte2_to_f32:
|
|
|
|
; VI: ; %bb.0:
|
|
|
|
; VI-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x24
|
|
|
|
; VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x2c
|
|
|
|
; VI-NEXT: v_lshlrev_b32_e32 v0, 2, v0
|
|
|
|
; VI-NEXT: s_mov_b32 s7, 0xf000
|
|
|
|
; VI-NEXT: s_mov_b32 s6, -1
|
|
|
|
; VI-NEXT: s_waitcnt lgkmcnt(0)
|
|
|
|
; VI-NEXT: v_mov_b32_e32 v1, s1
|
|
|
|
; VI-NEXT: v_add_u32_e32 v0, vcc, s0, v0
|
|
|
|
; VI-NEXT: v_addc_u32_e32 v1, vcc, 0, v1, vcc
|
|
|
|
; VI-NEXT: flat_load_dword v0, v[0:1]
|
2020-10-16 09:09:38 +02:00
|
|
|
; VI-NEXT: s_waitcnt vmcnt(0)
|
2019-04-22 12:19:09 +02:00
|
|
|
; VI-NEXT: v_cvt_f32_ubyte2_e32 v0, v0
|
|
|
|
; VI-NEXT: buffer_store_dword v0, off, s[4:7], 0
|
|
|
|
; VI-NEXT: s_endpgm
|
2021-03-29 11:12:46 +02:00
|
|
|
;
|
|
|
|
; GFX10-LABEL: extract_byte2_to_f32:
|
|
|
|
; GFX10: ; %bb.0:
|
|
|
|
; GFX10-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x2c
|
|
|
|
; GFX10-NEXT: v_lshlrev_b32_e32 v0, 2, v0
|
|
|
|
; GFX10-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
|
|
|
|
; GFX10-NEXT: v_mov_b32_e32 v1, 0
|
|
|
|
; GFX10-NEXT: s_waitcnt lgkmcnt(0)
|
|
|
|
; GFX10-NEXT: global_load_dword v0, v0, s[2:3]
|
|
|
|
; GFX10-NEXT: s_waitcnt vmcnt(0)
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte2_e32 v0, v0
|
|
|
|
; GFX10-NEXT: global_store_dword v1, v0, s[0:1]
|
|
|
|
; GFX10-NEXT: s_endpgm
|
2017-07-04 19:32:00 +02:00
|
|
|
%tid = call i32 @llvm.amdgcn.workitem.id.x()
|
2017-08-07 16:58:04 +02:00
|
|
|
%gep = getelementptr i32, i32 addrspace(1)* %in, i32 %tid
|
2017-07-04 19:32:00 +02:00
|
|
|
%val = load i32, i32 addrspace(1)* %gep
|
2016-05-09 18:29:50 +02:00
|
|
|
%srl = lshr i32 %val, 16
|
|
|
|
%and = and i32 %srl, 255
|
|
|
|
%cvt = uitofp i32 %and to float
|
|
|
|
store float %cvt, float addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2017-03-21 22:39:51 +01:00
|
|
|
define amdgpu_kernel void @extract_byte3_to_f32(float addrspace(1)* noalias %out, i32 addrspace(1)* noalias %in) nounwind {
|
2019-04-22 12:19:09 +02:00
|
|
|
; SI-LABEL: extract_byte3_to_f32:
|
|
|
|
; SI: ; %bb.0:
|
|
|
|
; SI-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x9
|
|
|
|
; SI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0xb
|
|
|
|
; SI-NEXT: s_mov_b32 s7, 0xf000
|
|
|
|
; SI-NEXT: s_mov_b32 s2, 0
|
|
|
|
; SI-NEXT: s_mov_b32 s3, s7
|
|
|
|
; SI-NEXT: v_lshlrev_b32_e32 v0, 2, v0
|
|
|
|
; SI-NEXT: v_mov_b32_e32 v1, 0
|
|
|
|
; SI-NEXT: s_waitcnt lgkmcnt(0)
|
|
|
|
; SI-NEXT: buffer_load_dword v0, v[0:1], s[0:3], 0 addr64
|
|
|
|
; SI-NEXT: s_mov_b32 s6, -1
|
|
|
|
; SI-NEXT: s_waitcnt vmcnt(0)
|
|
|
|
; SI-NEXT: v_cvt_f32_ubyte3_e32 v0, v0
|
|
|
|
; SI-NEXT: buffer_store_dword v0, off, s[4:7], 0
|
|
|
|
; SI-NEXT: s_endpgm
|
|
|
|
;
|
|
|
|
; VI-LABEL: extract_byte3_to_f32:
|
|
|
|
; VI: ; %bb.0:
|
|
|
|
; VI-NEXT: s_load_dwordx2 s[4:5], s[0:1], 0x24
|
|
|
|
; VI-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x2c
|
|
|
|
; VI-NEXT: v_lshlrev_b32_e32 v0, 2, v0
|
|
|
|
; VI-NEXT: s_mov_b32 s7, 0xf000
|
|
|
|
; VI-NEXT: s_mov_b32 s6, -1
|
|
|
|
; VI-NEXT: s_waitcnt lgkmcnt(0)
|
|
|
|
; VI-NEXT: v_mov_b32_e32 v1, s1
|
|
|
|
; VI-NEXT: v_add_u32_e32 v0, vcc, s0, v0
|
|
|
|
; VI-NEXT: v_addc_u32_e32 v1, vcc, 0, v1, vcc
|
|
|
|
; VI-NEXT: flat_load_dword v0, v[0:1]
|
2020-10-16 09:09:38 +02:00
|
|
|
; VI-NEXT: s_waitcnt vmcnt(0)
|
2019-04-22 12:19:09 +02:00
|
|
|
; VI-NEXT: v_cvt_f32_ubyte3_e32 v0, v0
|
|
|
|
; VI-NEXT: buffer_store_dword v0, off, s[4:7], 0
|
|
|
|
; VI-NEXT: s_endpgm
|
2021-03-29 11:12:46 +02:00
|
|
|
;
|
|
|
|
; GFX10-LABEL: extract_byte3_to_f32:
|
|
|
|
; GFX10: ; %bb.0:
|
|
|
|
; GFX10-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x2c
|
|
|
|
; GFX10-NEXT: v_lshlrev_b32_e32 v0, 2, v0
|
|
|
|
; GFX10-NEXT: s_load_dwordx2 s[0:1], s[0:1], 0x24
|
|
|
|
; GFX10-NEXT: v_mov_b32_e32 v1, 0
|
|
|
|
; GFX10-NEXT: s_waitcnt lgkmcnt(0)
|
|
|
|
; GFX10-NEXT: global_load_dword v0, v0, s[2:3]
|
|
|
|
; GFX10-NEXT: s_waitcnt vmcnt(0)
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte3_e32 v0, v0
|
|
|
|
; GFX10-NEXT: global_store_dword v1, v0, s[0:1]
|
|
|
|
; GFX10-NEXT: s_endpgm
|
2017-07-04 19:32:00 +02:00
|
|
|
%tid = call i32 @llvm.amdgcn.workitem.id.x()
|
2017-08-07 16:58:04 +02:00
|
|
|
%gep = getelementptr i32, i32 addrspace(1)* %in, i32 %tid
|
2017-07-04 19:32:00 +02:00
|
|
|
%val = load i32, i32 addrspace(1)* %gep
|
2016-05-09 18:29:50 +02:00
|
|
|
%srl = lshr i32 %val, 24
|
|
|
|
%and = and i32 %srl, 255
|
|
|
|
%cvt = uitofp i32 %and to float
|
|
|
|
store float %cvt, float addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
2019-01-05 20:20:00 +01:00
|
|
|
|
|
|
|
define amdgpu_kernel void @cvt_ubyte0_or_multiuse(i32 addrspace(1)* %in, float addrspace(1)* %out) {
|
2019-04-22 12:19:09 +02:00
|
|
|
; SI-LABEL: cvt_ubyte0_or_multiuse:
|
|
|
|
; SI: ; %bb.0: ; %bb
|
[AMDGPU] Remove dubious logic in bidirectional list scheduler
Summary:
pickNodeBidirectional tried to compare the best top candidate and the
best bottom candidate by examining TopCand.Reason and BotCand.Reason.
This is unsound because, after calling pickNodeFromQueue, Cand.Reason
does not reflect the most important reason why Cand was chosen. Rather
it reflects the most recent reason why it beat some other potential
candidate, which could have been for some low priority tie breaker
reason.
I have seen this cause problems where TopCand is a good candidate, but
because TopCand.Reason is ORDER (which is very low priority) it is
repeatedly ignored in favour of a mediocre BotCand. This is not how
bidirectional scheduling is supposed to work.
To fix this I changed the code to always compare TopCand and BotCand
directly, like the generic implementation of pickNodeBidirectional does.
This removes some uncommented AMDGPU-specific logic; if this logic turns
out to be important then perhaps it could be moved into an override of
tryCandidate instead.
Graphics shader benchmarking on gfx10 shows a lot more positive than
negative effects from this change.
Reviewers: arsenm, tstellar, rampitec, kzhuravl, vpykhtin, dstuttard, tpr, atrick, MatzeB
Subscribers: jvesely, wdng, nhaehnle, yaxunl, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68338
2019-10-07 16:33:59 +02:00
|
|
|
; SI-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x9
|
|
|
|
; SI-NEXT: s_mov_b32 s3, 0xf000
|
2019-04-22 12:19:09 +02:00
|
|
|
; SI-NEXT: v_lshlrev_b32_e32 v0, 2, v0
|
|
|
|
; SI-NEXT: v_mov_b32_e32 v1, 0
|
[AMDGPU] Remove dubious logic in bidirectional list scheduler
Summary:
pickNodeBidirectional tried to compare the best top candidate and the
best bottom candidate by examining TopCand.Reason and BotCand.Reason.
This is unsound because, after calling pickNodeFromQueue, Cand.Reason
does not reflect the most important reason why Cand was chosen. Rather
it reflects the most recent reason why it beat some other potential
candidate, which could have been for some low priority tie breaker
reason.
I have seen this cause problems where TopCand is a good candidate, but
because TopCand.Reason is ORDER (which is very low priority) it is
repeatedly ignored in favour of a mediocre BotCand. This is not how
bidirectional scheduling is supposed to work.
To fix this I changed the code to always compare TopCand and BotCand
directly, like the generic implementation of pickNodeBidirectional does.
This removes some uncommented AMDGPU-specific logic; if this logic turns
out to be important then perhaps it could be moved into an override of
tryCandidate instead.
Graphics shader benchmarking on gfx10 shows a lot more positive than
negative effects from this change.
Reviewers: arsenm, tstellar, rampitec, kzhuravl, vpykhtin, dstuttard, tpr, atrick, MatzeB
Subscribers: jvesely, wdng, nhaehnle, yaxunl, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68338
2019-10-07 16:33:59 +02:00
|
|
|
; SI-NEXT: s_mov_b32 s2, -1
|
2019-04-22 12:19:09 +02:00
|
|
|
; SI-NEXT: s_waitcnt lgkmcnt(0)
|
[AMDGPU] Remove dubious logic in bidirectional list scheduler
Summary:
pickNodeBidirectional tried to compare the best top candidate and the
best bottom candidate by examining TopCand.Reason and BotCand.Reason.
This is unsound because, after calling pickNodeFromQueue, Cand.Reason
does not reflect the most important reason why Cand was chosen. Rather
it reflects the most recent reason why it beat some other potential
candidate, which could have been for some low priority tie breaker
reason.
I have seen this cause problems where TopCand is a good candidate, but
because TopCand.Reason is ORDER (which is very low priority) it is
repeatedly ignored in favour of a mediocre BotCand. This is not how
bidirectional scheduling is supposed to work.
To fix this I changed the code to always compare TopCand and BotCand
directly, like the generic implementation of pickNodeBidirectional does.
This removes some uncommented AMDGPU-specific logic; if this logic turns
out to be important then perhaps it could be moved into an override of
tryCandidate instead.
Graphics shader benchmarking on gfx10 shows a lot more positive than
negative effects from this change.
Reviewers: arsenm, tstellar, rampitec, kzhuravl, vpykhtin, dstuttard, tpr, atrick, MatzeB
Subscribers: jvesely, wdng, nhaehnle, yaxunl, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68338
2019-10-07 16:33:59 +02:00
|
|
|
; SI-NEXT: s_mov_b32 s0, s6
|
|
|
|
; SI-NEXT: s_mov_b32 s1, s7
|
|
|
|
; SI-NEXT: s_mov_b32 s6, 0
|
|
|
|
; SI-NEXT: s_mov_b32 s7, s3
|
|
|
|
; SI-NEXT: buffer_load_dword v0, v[0:1], s[4:7], 0 addr64
|
2019-04-22 12:19:09 +02:00
|
|
|
; SI-NEXT: s_waitcnt vmcnt(0)
|
|
|
|
; SI-NEXT: v_or_b32_e32 v0, 0x80000001, v0
|
|
|
|
; SI-NEXT: v_cvt_f32_ubyte0_e32 v1, v0
|
|
|
|
; SI-NEXT: v_add_f32_e32 v0, v0, v1
|
[AMDGPU] Remove dubious logic in bidirectional list scheduler
Summary:
pickNodeBidirectional tried to compare the best top candidate and the
best bottom candidate by examining TopCand.Reason and BotCand.Reason.
This is unsound because, after calling pickNodeFromQueue, Cand.Reason
does not reflect the most important reason why Cand was chosen. Rather
it reflects the most recent reason why it beat some other potential
candidate, which could have been for some low priority tie breaker
reason.
I have seen this cause problems where TopCand is a good candidate, but
because TopCand.Reason is ORDER (which is very low priority) it is
repeatedly ignored in favour of a mediocre BotCand. This is not how
bidirectional scheduling is supposed to work.
To fix this I changed the code to always compare TopCand and BotCand
directly, like the generic implementation of pickNodeBidirectional does.
This removes some uncommented AMDGPU-specific logic; if this logic turns
out to be important then perhaps it could be moved into an override of
tryCandidate instead.
Graphics shader benchmarking on gfx10 shows a lot more positive than
negative effects from this change.
Reviewers: arsenm, tstellar, rampitec, kzhuravl, vpykhtin, dstuttard, tpr, atrick, MatzeB
Subscribers: jvesely, wdng, nhaehnle, yaxunl, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68338
2019-10-07 16:33:59 +02:00
|
|
|
; SI-NEXT: buffer_store_dword v0, off, s[0:3], 0
|
2019-04-22 12:19:09 +02:00
|
|
|
; SI-NEXT: s_endpgm
|
|
|
|
;
|
|
|
|
; VI-LABEL: cvt_ubyte0_or_multiuse:
|
|
|
|
; VI: ; %bb.0: ; %bb
|
[AMDGPU] Remove dubious logic in bidirectional list scheduler
Summary:
pickNodeBidirectional tried to compare the best top candidate and the
best bottom candidate by examining TopCand.Reason and BotCand.Reason.
This is unsound because, after calling pickNodeFromQueue, Cand.Reason
does not reflect the most important reason why Cand was chosen. Rather
it reflects the most recent reason why it beat some other potential
candidate, which could have been for some low priority tie breaker
reason.
I have seen this cause problems where TopCand is a good candidate, but
because TopCand.Reason is ORDER (which is very low priority) it is
repeatedly ignored in favour of a mediocre BotCand. This is not how
bidirectional scheduling is supposed to work.
To fix this I changed the code to always compare TopCand and BotCand
directly, like the generic implementation of pickNodeBidirectional does.
This removes some uncommented AMDGPU-specific logic; if this logic turns
out to be important then perhaps it could be moved into an override of
tryCandidate instead.
Graphics shader benchmarking on gfx10 shows a lot more positive than
negative effects from this change.
Reviewers: arsenm, tstellar, rampitec, kzhuravl, vpykhtin, dstuttard, tpr, atrick, MatzeB
Subscribers: jvesely, wdng, nhaehnle, yaxunl, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68338
2019-10-07 16:33:59 +02:00
|
|
|
; VI-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x24
|
2019-04-22 12:19:09 +02:00
|
|
|
; VI-NEXT: v_lshlrev_b32_e32 v0, 2, v0
|
[AMDGPU] Remove dubious logic in bidirectional list scheduler
Summary:
pickNodeBidirectional tried to compare the best top candidate and the
best bottom candidate by examining TopCand.Reason and BotCand.Reason.
This is unsound because, after calling pickNodeFromQueue, Cand.Reason
does not reflect the most important reason why Cand was chosen. Rather
it reflects the most recent reason why it beat some other potential
candidate, which could have been for some low priority tie breaker
reason.
I have seen this cause problems where TopCand is a good candidate, but
because TopCand.Reason is ORDER (which is very low priority) it is
repeatedly ignored in favour of a mediocre BotCand. This is not how
bidirectional scheduling is supposed to work.
To fix this I changed the code to always compare TopCand and BotCand
directly, like the generic implementation of pickNodeBidirectional does.
This removes some uncommented AMDGPU-specific logic; if this logic turns
out to be important then perhaps it could be moved into an override of
tryCandidate instead.
Graphics shader benchmarking on gfx10 shows a lot more positive than
negative effects from this change.
Reviewers: arsenm, tstellar, rampitec, kzhuravl, vpykhtin, dstuttard, tpr, atrick, MatzeB
Subscribers: jvesely, wdng, nhaehnle, yaxunl, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68338
2019-10-07 16:33:59 +02:00
|
|
|
; VI-NEXT: s_mov_b32 s3, 0xf000
|
|
|
|
; VI-NEXT: s_mov_b32 s2, -1
|
2019-04-22 12:19:09 +02:00
|
|
|
; VI-NEXT: s_waitcnt lgkmcnt(0)
|
[AMDGPU] Remove dubious logic in bidirectional list scheduler
Summary:
pickNodeBidirectional tried to compare the best top candidate and the
best bottom candidate by examining TopCand.Reason and BotCand.Reason.
This is unsound because, after calling pickNodeFromQueue, Cand.Reason
does not reflect the most important reason why Cand was chosen. Rather
it reflects the most recent reason why it beat some other potential
candidate, which could have been for some low priority tie breaker
reason.
I have seen this cause problems where TopCand is a good candidate, but
because TopCand.Reason is ORDER (which is very low priority) it is
repeatedly ignored in favour of a mediocre BotCand. This is not how
bidirectional scheduling is supposed to work.
To fix this I changed the code to always compare TopCand and BotCand
directly, like the generic implementation of pickNodeBidirectional does.
This removes some uncommented AMDGPU-specific logic; if this logic turns
out to be important then perhaps it could be moved into an override of
tryCandidate instead.
Graphics shader benchmarking on gfx10 shows a lot more positive than
negative effects from this change.
Reviewers: arsenm, tstellar, rampitec, kzhuravl, vpykhtin, dstuttard, tpr, atrick, MatzeB
Subscribers: jvesely, wdng, nhaehnle, yaxunl, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68338
2019-10-07 16:33:59 +02:00
|
|
|
; VI-NEXT: v_mov_b32_e32 v1, s5
|
|
|
|
; VI-NEXT: v_add_u32_e32 v0, vcc, s4, v0
|
2019-04-22 12:19:09 +02:00
|
|
|
; VI-NEXT: v_addc_u32_e32 v1, vcc, 0, v1, vcc
|
|
|
|
; VI-NEXT: flat_load_dword v0, v[0:1]
|
[AMDGPU] Remove dubious logic in bidirectional list scheduler
Summary:
pickNodeBidirectional tried to compare the best top candidate and the
best bottom candidate by examining TopCand.Reason and BotCand.Reason.
This is unsound because, after calling pickNodeFromQueue, Cand.Reason
does not reflect the most important reason why Cand was chosen. Rather
it reflects the most recent reason why it beat some other potential
candidate, which could have been for some low priority tie breaker
reason.
I have seen this cause problems where TopCand is a good candidate, but
because TopCand.Reason is ORDER (which is very low priority) it is
repeatedly ignored in favour of a mediocre BotCand. This is not how
bidirectional scheduling is supposed to work.
To fix this I changed the code to always compare TopCand and BotCand
directly, like the generic implementation of pickNodeBidirectional does.
This removes some uncommented AMDGPU-specific logic; if this logic turns
out to be important then perhaps it could be moved into an override of
tryCandidate instead.
Graphics shader benchmarking on gfx10 shows a lot more positive than
negative effects from this change.
Reviewers: arsenm, tstellar, rampitec, kzhuravl, vpykhtin, dstuttard, tpr, atrick, MatzeB
Subscribers: jvesely, wdng, nhaehnle, yaxunl, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68338
2019-10-07 16:33:59 +02:00
|
|
|
; VI-NEXT: s_mov_b32 s0, s6
|
|
|
|
; VI-NEXT: s_mov_b32 s1, s7
|
2020-10-16 09:09:38 +02:00
|
|
|
; VI-NEXT: s_waitcnt vmcnt(0)
|
2019-04-22 12:19:09 +02:00
|
|
|
; VI-NEXT: v_or_b32_e32 v0, 0x80000001, v0
|
|
|
|
; VI-NEXT: v_cvt_f32_ubyte0_e32 v1, v0
|
|
|
|
; VI-NEXT: v_add_f32_e32 v0, v0, v1
|
[AMDGPU] Remove dubious logic in bidirectional list scheduler
Summary:
pickNodeBidirectional tried to compare the best top candidate and the
best bottom candidate by examining TopCand.Reason and BotCand.Reason.
This is unsound because, after calling pickNodeFromQueue, Cand.Reason
does not reflect the most important reason why Cand was chosen. Rather
it reflects the most recent reason why it beat some other potential
candidate, which could have been for some low priority tie breaker
reason.
I have seen this cause problems where TopCand is a good candidate, but
because TopCand.Reason is ORDER (which is very low priority) it is
repeatedly ignored in favour of a mediocre BotCand. This is not how
bidirectional scheduling is supposed to work.
To fix this I changed the code to always compare TopCand and BotCand
directly, like the generic implementation of pickNodeBidirectional does.
This removes some uncommented AMDGPU-specific logic; if this logic turns
out to be important then perhaps it could be moved into an override of
tryCandidate instead.
Graphics shader benchmarking on gfx10 shows a lot more positive than
negative effects from this change.
Reviewers: arsenm, tstellar, rampitec, kzhuravl, vpykhtin, dstuttard, tpr, atrick, MatzeB
Subscribers: jvesely, wdng, nhaehnle, yaxunl, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68338
2019-10-07 16:33:59 +02:00
|
|
|
; VI-NEXT: buffer_store_dword v0, off, s[0:3], 0
|
2019-04-22 12:19:09 +02:00
|
|
|
; VI-NEXT: s_endpgm
|
2021-03-29 11:12:46 +02:00
|
|
|
;
|
|
|
|
; GFX10-LABEL: cvt_ubyte0_or_multiuse:
|
|
|
|
; GFX10: ; %bb.0: ; %bb
|
|
|
|
; GFX10-NEXT: s_load_dwordx4 s[0:3], s[0:1], 0x24
|
|
|
|
; GFX10-NEXT: v_lshlrev_b32_e32 v0, 2, v0
|
|
|
|
; GFX10-NEXT: v_mov_b32_e32 v2, 0
|
|
|
|
; GFX10-NEXT: s_waitcnt lgkmcnt(0)
|
|
|
|
; GFX10-NEXT: global_load_dword v0, v0, s[0:1]
|
|
|
|
; GFX10-NEXT: s_waitcnt vmcnt(0)
|
|
|
|
; GFX10-NEXT: v_or_b32_e32 v0, 0x80000001, v0
|
|
|
|
; GFX10-NEXT: v_cvt_f32_ubyte0_e32 v1, v0
|
|
|
|
; GFX10-NEXT: v_add_f32_e32 v0, v0, v1
|
|
|
|
; GFX10-NEXT: global_store_dword v2, v0, s[2:3]
|
|
|
|
; GFX10-NEXT: s_endpgm
|
2019-01-05 20:20:00 +01:00
|
|
|
bb:
|
|
|
|
%lid = tail call i32 @llvm.amdgcn.workitem.id.x()
|
|
|
|
%gep = getelementptr inbounds i32, i32 addrspace(1)* %in, i32 %lid
|
|
|
|
%load = load i32, i32 addrspace(1)* %gep
|
|
|
|
%or = or i32 %load, -2147483647
|
|
|
|
%and = and i32 %or, 255
|
|
|
|
%uitofp = uitofp i32 %and to float
|
|
|
|
%cast = bitcast i32 %or to float
|
|
|
|
%add = fadd float %cast, %uitofp
|
|
|
|
store float %add, float addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|