-
Notifications
You must be signed in to change notification settings - Fork 14.4k
[AMDGPU][True16][MC][CodeGen] true16 for v_alignbyte_b32 #119750
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,48 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5 | ||
; RUN: llc -mtriple=amdgcn -verify-machineinstrs < %s | FileCheck -check-prefix=GCN %s | ||
; RUN: llc -mtriple=amdgcn -mcpu=gfx1100 -mattr=+real-true16 -verify-machineinstrs < %s | FileCheck -check-prefixes=GFX11-TRUE16 %s | ||
; RUN: llc -mtriple=amdgcn -mcpu=gfx1100 -mattr=-real-true16 -verify-machineinstrs < %s | FileCheck -check-prefixes=GFX11-FAKE16 %s | ||
|
||
declare i32 @llvm.amdgcn.alignbyte(i32, i32, i32) #0 | ||
|
||
; GCN-LABEL: {{^}}v_alignbyte_b32: | ||
; GCN: v_alignbyte_b32 {{[vs][0-9]+}}, {{[vs][0-9]+}}, {{[vs][0-9]+}} | ||
define amdgpu_kernel void @v_alignbyte_b32(ptr addrspace(1) %out, i32 %src1, i32 %src2, i32 %src3) #1 { | ||
; GCN-LABEL: v_alignbyte_b32: | ||
; GCN: ; %bb.0: | ||
; GCN-NEXT: s_load_dwordx4 s[0:3], s[4:5], 0xb | ||
; GCN-NEXT: s_load_dwordx2 s[4:5], s[4:5], 0x9 | ||
; GCN-NEXT: s_mov_b32 s7, 0xf000 | ||
; GCN-NEXT: s_mov_b32 s6, -1 | ||
; GCN-NEXT: s_waitcnt lgkmcnt(0) | ||
; GCN-NEXT: v_mov_b32_e32 v0, s1 | ||
; GCN-NEXT: v_mov_b32_e32 v1, s2 | ||
; GCN-NEXT: v_alignbyte_b32 v0, s0, v0, v1 | ||
; GCN-NEXT: buffer_store_dword v0, off, s[4:7], 0 | ||
; GCN-NEXT: s_endpgm | ||
; | ||
; GFX11-TRUE16-LABEL: v_alignbyte_b32: | ||
; GFX11-TRUE16: ; %bb.0: | ||
; GFX11-TRUE16-NEXT: s_clause 0x1 | ||
; GFX11-TRUE16-NEXT: s_load_b128 s[0:3], s[4:5], 0x2c | ||
; GFX11-TRUE16-NEXT: s_load_b64 s[4:5], s[4:5], 0x24 | ||
; GFX11-TRUE16-NEXT: v_mov_b32_e32 v1, 0 | ||
; GFX11-TRUE16-NEXT: s_waitcnt lgkmcnt(0) | ||
; GFX11-TRUE16-NEXT: v_mov_b16_e32 v0.l, s2 | ||
; GFX11-TRUE16-NEXT: s_delay_alu instid0(VALU_DEP_1) | ||
; GFX11-TRUE16-NEXT: v_alignbyte_b32 v0, s0, s1, v0.l | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: Can you add another test in this file where s0 and s1 are vgpr arguments instead, so we can see if s2 can be folded into src2 of alignbyte? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added the test. It seems still there is additional I guess we might need to address the RA first? |
||
; GFX11-TRUE16-NEXT: global_store_b32 v1, v0, s[4:5] | ||
; GFX11-TRUE16-NEXT: s_endpgm | ||
; | ||
; GFX11-FAKE16-LABEL: v_alignbyte_b32: | ||
; GFX11-FAKE16: ; %bb.0: | ||
; GFX11-FAKE16-NEXT: s_clause 0x1 | ||
; GFX11-FAKE16-NEXT: s_load_b128 s[0:3], s[4:5], 0x2c | ||
; GFX11-FAKE16-NEXT: s_load_b64 s[4:5], s[4:5], 0x24 | ||
; GFX11-FAKE16-NEXT: s_waitcnt lgkmcnt(0) | ||
; GFX11-FAKE16-NEXT: v_dual_mov_b32 v1, 0 :: v_dual_mov_b32 v0, s2 | ||
; GFX11-FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_1) | ||
; GFX11-FAKE16-NEXT: v_alignbyte_b32 v0, s0, s1, v0 | ||
; GFX11-FAKE16-NEXT: global_store_b32 v1, v0, s[4:5] | ||
; GFX11-FAKE16-NEXT: s_endpgm | ||
%val = call i32 @llvm.amdgcn.alignbyte(i32 %src1, i32 %src2, i32 %src3) #0 | ||
store i32 %val, ptr addrspace(1) %out | ||
ret void | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: you can do
string asmName = !tolower(NAME)
in the multiclass.