AMDGPU: Make getTgtMemIntrinsic table-driven for resource-based intrinsics
Summary:
Avoids having to list all intrinsics manually.
This is in preparation for the new dimension-aware image intrinsics,
which I'd rather not have to list here by hand.
Change-Id: If7ced04998397ef68c4cb8f7de66b5050fb767e5
Reviewers: arsenm, rampitec, b-sumner
Subscribers: kzhuravl, wdng, mgorny, yaxunl, dstuttard, tpr, llvm-commits, t-tye
Differential Revision: https://reviews.llvm.org/D44937
llvm-svn: 328938
2018-04-02 01:09:07 +08:00
|
|
|
//===-- AMDGPUSearchableTables.td - ------------------------*- tablegen -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
include "llvm/TableGen/SearchableTable.td"
|
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Resource intrinsics table.
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
class RsrcIntrinsic<AMDGPURsrcIntrinsic intr> : SearchableTable {
|
|
|
|
let SearchableFields = ["Intr"];
|
|
|
|
let EnumNameField = ?;
|
|
|
|
|
|
|
|
Intrinsic Intr = !cast<Intrinsic>(intr);
|
|
|
|
bits<8> RsrcArg = intr.RsrcArg;
|
|
|
|
bit IsImage = intr.IsImage;
|
|
|
|
}
|
|
|
|
|
|
|
|
foreach intr = !listconcat(AMDGPUBufferIntrinsics,
|
AMDGPU: Dimension-aware image intrinsics
Summary:
These new image intrinsics contain the texture type as part of
their name and have each component of the address/coordinate as
individual parameters.
This is a preparatory step for implementing the A16 feature, where
coordinates are passed as half-floats or -ints, but the Z compare
value and texel offsets are still full dwords, making it difficult
or impossible to distinguish between A16 on or off in the old-style
intrinsics.
Additionally, these intrinsics pass the 'texfailpolicy' and
'cachectrl' as i32 bit fields to reduce operand clutter and allow
for future extensibility.
v2:
- gather4 supports 2darray images
- fix a bug with 1D images on SI
Change-Id: I099f309e0a394082a5901ea196c3967afb867f04
Reviewers: arsenm, rampitec, b-sumner
Subscribers: kzhuravl, wdng, yaxunl, dstuttard, tpr, llvm-commits, t-tye
Differential Revision: https://reviews.llvm.org/D44939
llvm-svn: 329166
2018-04-04 18:58:54 +08:00
|
|
|
AMDGPUImageIntrinsics,
|
|
|
|
AMDGPUImageDimIntrinsics,
|
|
|
|
AMDGPUImageDimGatherIntrinsics,
|
|
|
|
AMDGPUImageDimGetResInfoIntrinsics,
|
|
|
|
AMDGPUImageDimAtomicIntrinsics) in {
|
AMDGPU: Make getTgtMemIntrinsic table-driven for resource-based intrinsics
Summary:
Avoids having to list all intrinsics manually.
This is in preparation for the new dimension-aware image intrinsics,
which I'd rather not have to list here by hand.
Change-Id: If7ced04998397ef68c4cb8f7de66b5050fb767e5
Reviewers: arsenm, rampitec, b-sumner
Subscribers: kzhuravl, wdng, mgorny, yaxunl, dstuttard, tpr, llvm-commits, t-tye
Differential Revision: https://reviews.llvm.org/D44937
llvm-svn: 328938
2018-04-02 01:09:07 +08:00
|
|
|
def : RsrcIntrinsic<!cast<AMDGPURsrcIntrinsic>(intr)>;
|
|
|
|
}
|
2018-04-02 01:09:14 +08:00
|
|
|
|
|
|
|
class SourceOfDivergence<Intrinsic intr> : SearchableTable {
|
|
|
|
let SearchableFields = ["Intr"];
|
|
|
|
let EnumNameField = ?;
|
|
|
|
|
|
|
|
Intrinsic Intr = intr;
|
|
|
|
}
|
|
|
|
|
|
|
|
def : SourceOfDivergence<int_amdgcn_workitem_id_x>;
|
|
|
|
def : SourceOfDivergence<int_amdgcn_workitem_id_y>;
|
|
|
|
def : SourceOfDivergence<int_amdgcn_workitem_id_z>;
|
|
|
|
def : SourceOfDivergence<int_amdgcn_interp_mov>;
|
|
|
|
def : SourceOfDivergence<int_amdgcn_interp_p1>;
|
|
|
|
def : SourceOfDivergence<int_amdgcn_interp_p2>;
|
|
|
|
def : SourceOfDivergence<int_amdgcn_mbcnt_hi>;
|
|
|
|
def : SourceOfDivergence<int_amdgcn_mbcnt_lo>;
|
|
|
|
def : SourceOfDivergence<int_r600_read_tidig_x>;
|
|
|
|
def : SourceOfDivergence<int_r600_read_tidig_y>;
|
|
|
|
def : SourceOfDivergence<int_r600_read_tidig_z>;
|
|
|
|
def : SourceOfDivergence<int_amdgcn_atomic_inc>;
|
|
|
|
def : SourceOfDivergence<int_amdgcn_atomic_dec>;
|
|
|
|
def : SourceOfDivergence<int_amdgcn_ds_fadd>;
|
|
|
|
def : SourceOfDivergence<int_amdgcn_ds_fmin>;
|
|
|
|
def : SourceOfDivergence<int_amdgcn_ds_fmax>;
|
|
|
|
def : SourceOfDivergence<int_amdgcn_image_atomic_swap>;
|
|
|
|
def : SourceOfDivergence<int_amdgcn_image_atomic_add>;
|
|
|
|
def : SourceOfDivergence<int_amdgcn_image_atomic_sub>;
|
|
|
|
def : SourceOfDivergence<int_amdgcn_image_atomic_smin>;
|
|
|
|
def : SourceOfDivergence<int_amdgcn_image_atomic_umin>;
|
|
|
|
def : SourceOfDivergence<int_amdgcn_image_atomic_smax>;
|
|
|
|
def : SourceOfDivergence<int_amdgcn_image_atomic_umax>;
|
|
|
|
def : SourceOfDivergence<int_amdgcn_image_atomic_and>;
|
|
|
|
def : SourceOfDivergence<int_amdgcn_image_atomic_or>;
|
|
|
|
def : SourceOfDivergence<int_amdgcn_image_atomic_xor>;
|
|
|
|
def : SourceOfDivergence<int_amdgcn_image_atomic_inc>;
|
|
|
|
def : SourceOfDivergence<int_amdgcn_image_atomic_dec>;
|
|
|
|
def : SourceOfDivergence<int_amdgcn_image_atomic_cmpswap>;
|
|
|
|
def : SourceOfDivergence<int_amdgcn_buffer_atomic_swap>;
|
|
|
|
def : SourceOfDivergence<int_amdgcn_buffer_atomic_add>;
|
|
|
|
def : SourceOfDivergence<int_amdgcn_buffer_atomic_sub>;
|
|
|
|
def : SourceOfDivergence<int_amdgcn_buffer_atomic_smin>;
|
|
|
|
def : SourceOfDivergence<int_amdgcn_buffer_atomic_umin>;
|
|
|
|
def : SourceOfDivergence<int_amdgcn_buffer_atomic_smax>;
|
|
|
|
def : SourceOfDivergence<int_amdgcn_buffer_atomic_umax>;
|
|
|
|
def : SourceOfDivergence<int_amdgcn_buffer_atomic_and>;
|
|
|
|
def : SourceOfDivergence<int_amdgcn_buffer_atomic_or>;
|
|
|
|
def : SourceOfDivergence<int_amdgcn_buffer_atomic_xor>;
|
|
|
|
def : SourceOfDivergence<int_amdgcn_buffer_atomic_cmpswap>;
|
|
|
|
def : SourceOfDivergence<int_amdgcn_ps_live>;
|
|
|
|
def : SourceOfDivergence<int_amdgcn_ds_swizzle>;
|
AMDGPU: Dimension-aware image intrinsics
Summary:
These new image intrinsics contain the texture type as part of
their name and have each component of the address/coordinate as
individual parameters.
This is a preparatory step for implementing the A16 feature, where
coordinates are passed as half-floats or -ints, but the Z compare
value and texel offsets are still full dwords, making it difficult
or impossible to distinguish between A16 on or off in the old-style
intrinsics.
Additionally, these intrinsics pass the 'texfailpolicy' and
'cachectrl' as i32 bit fields to reduce operand clutter and allow
for future extensibility.
v2:
- gather4 supports 2darray images
- fix a bug with 1D images on SI
Change-Id: I099f309e0a394082a5901ea196c3967afb867f04
Reviewers: arsenm, rampitec, b-sumner
Subscribers: kzhuravl, wdng, yaxunl, dstuttard, tpr, llvm-commits, t-tye
Differential Revision: https://reviews.llvm.org/D44939
llvm-svn: 329166
2018-04-04 18:58:54 +08:00
|
|
|
|
|
|
|
foreach intr = AMDGPUImageDimAtomicIntrinsics in
|
|
|
|
def : SourceOfDivergence<intr>;
|
|
|
|
|
|
|
|
class D16ImageDimIntrinsic<AMDGPUImageDimIntrinsic intr> : SearchableTable {
|
|
|
|
let SearchableFields = ["Intr"];
|
|
|
|
let EnumNameField = ?;
|
|
|
|
|
|
|
|
Intrinsic Intr = intr;
|
|
|
|
code D16HelperIntr =
|
|
|
|
!cast<code>("AMDGPUIntrinsic::SI_image_d16helper_" # intr.P.OpMod # intr.P.Dim.Name);
|
|
|
|
}
|
|
|
|
|
|
|
|
foreach intr = !listconcat(AMDGPUImageDimIntrinsics,
|
|
|
|
AMDGPUImageDimGatherIntrinsics) in {
|
|
|
|
def : D16ImageDimIntrinsic<intr>;
|
|
|
|
}
|