-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[AMDGPU] Add s_setprio_inc_wg gfx1250 instruction #145152
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
base: users/rampitec/06-20-_amdgpu_rename_call_instructions_from_b64_to_i64
Are you sure you want to change the base?
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// REQUIRES: amdgpu-registered-target | ||
|
||
// RUN: %clang_cc1 -cl-std=CL2.0 -triple amdgcn-unknown-unknown -target-cpu gfx1250 -verify -emit-llvm -o - %s | ||
|
||
void test_setprio_inc_wg(short a) { | ||
__builtin_amdgcn_s_setprio_inc_wg(a); // expected-error {{'__builtin_amdgcn_s_setprio_inc_wg' must be a constant integer}} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py | ||
// RUN: %clang_cc1 -cl-std=CL2.0 -O0 -triple amdgcn-unknown-unknown -target-cpu gfx1250 -emit-llvm -o - %s | FileCheck %s | ||
// REQUIRES: amdgpu-registered-target | ||
|
||
// CHECK-LABEL: @test_setprio_inc_wg( | ||
// CHECK-NEXT: entry: | ||
// CHECK-NEXT: call void @llvm.amdgcn.s.setprio.inc.wg(i16 10) | ||
// CHECK-NEXT: ret void | ||
// | ||
void test_setprio_inc_wg() { | ||
__builtin_amdgcn_s_setprio_inc_wg(10); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9575,7 +9575,8 @@ static unsigned subtargetEncodingFamily(const GCNSubtarget &ST) { | |
case AMDGPUSubtarget::GFX11: | ||
return SIEncodingFamily::GFX11; | ||
case AMDGPUSubtarget::GFX12: | ||
return SIEncodingFamily::GFX12; | ||
return ST.hasGFX1250Insts() ? SIEncodingFamily::GFX1250 | ||
: SIEncodingFamily::GFX12; | ||
} | ||
llvm_unreachable("Unknown subtarget generation!"); | ||
} | ||
|
@@ -9669,6 +9670,9 @@ int SIInstrInfo::pseudoToMCOpcode(int Opcode) const { | |
|
||
int MCOp = AMDGPU::getMCOpcode(Opcode, Gen); | ||
|
||
if (MCOp == (uint16_t)-1 && ST.hasGFX1250Insts()) | ||
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. So we want a 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. 0xffffffff means it is already a real opcode. 0xffff means it is not found in the subtarget column. |
||
MCOp = AMDGPU::getMCOpcode(Opcode, SIEncodingFamily::GFX12); | ||
|
||
// -1 means that Opcode is already a native instruction. | ||
if (MCOp == -1) | ||
return Opcode; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py | ||
; RUN: llc -march=amdgcn -mcpu=gfx1250 -show-mc-encoding -verify-machineinstrs < %s | FileCheck -check-prefix=GFX1250 %s | ||
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. I think it is recommended to use 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. Will do. This is a very old test of course. |
||
; RUN: llc -global-isel -march=amdgcn -mcpu=gfx1250 -show-mc-encoding -verify-machineinstrs < %s | FileCheck -check-prefix=GFX1250 %s | ||
|
||
declare void @llvm.amdgcn.s.setprio.inc.wg(i16) #0 | ||
|
||
define void @test_llvm.amdgcn.s.setprio.inc.wg() #0 { | ||
; GFX1250-LABEL: test_llvm.amdgcn.s.setprio.inc.wg: | ||
; GFX1250: ; %bb.0: | ||
; GFX1250-NEXT: s_wait_loadcnt_dscnt 0x0 ; encoding: [0x00,0x00,0xc8,0xbf] | ||
; GFX1250-NEXT: s_wait_kmcnt 0x0 ; encoding: [0x00,0x00,0xc7,0xbf] | ||
; GFX1250-NEXT: s_setprio_inc_wg 0 ; encoding: [0x00,0x00,0xbe,0xbf] | ||
; GFX1250-NEXT: s_setprio_inc_wg 1 ; encoding: [0x01,0x00,0xbe,0xbf] | ||
; GFX1250-NEXT: s_setprio_inc_wg 2 ; encoding: [0x02,0x00,0xbe,0xbf] | ||
; GFX1250-NEXT: s_setprio_inc_wg 3 ; encoding: [0x03,0x00,0xbe,0xbf] | ||
; GFX1250-NEXT: s_setprio_inc_wg 10 ; encoding: [0x0a,0x00,0xbe,0xbf] | ||
; GFX1250-NEXT: s_setprio_inc_wg -1 ; encoding: [0xff,0xff,0xbe,0xbf] | ||
; GFX1250-NEXT: s_setprio_inc_wg 0 ; encoding: [0x00,0x00,0xbe,0xbf] | ||
; GFX1250-NEXT: s_setprio_inc_wg 1 ; encoding: [0x01,0x00,0xbe,0xbf] | ||
; GFX1250-NEXT: s_setprio_inc_wg -1 ; encoding: [0xff,0xff,0xbe,0xbf] | ||
; GFX1250-NEXT: s_set_pc_i64 s[30:31] ; encoding: [0x1e,0x48,0x80,0xbe] | ||
call void @llvm.amdgcn.s.setprio.inc.wg(i16 0) | ||
call void @llvm.amdgcn.s.setprio.inc.wg(i16 1) | ||
call void @llvm.amdgcn.s.setprio.inc.wg(i16 2) | ||
call void @llvm.amdgcn.s.setprio.inc.wg(i16 3) | ||
call void @llvm.amdgcn.s.setprio.inc.wg(i16 10) | ||
call void @llvm.amdgcn.s.setprio.inc.wg(i16 65535) | ||
call void @llvm.amdgcn.s.setprio.inc.wg(i16 65536) | ||
call void @llvm.amdgcn.s.setprio.inc.wg(i16 65537) | ||
call void @llvm.amdgcn.s.setprio.inc.wg(i16 -1) | ||
ret void | ||
} | ||
|
||
attributes #0 = { nounwind } |
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.
Missing the sema tests for the supported subtarget, and non-immediate input errors