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 -*-===//
|
|
|
|
//
|
2019-01-19 16:50:56 +08:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
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
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Resource intrinsics table.
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2018-06-21 21:36:33 +08:00
|
|
|
class RsrcIntrinsic<AMDGPURsrcIntrinsic intr> {
|
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
|
|
|
Intrinsic Intr = !cast<Intrinsic>(intr);
|
|
|
|
bits<8> RsrcArg = intr.RsrcArg;
|
|
|
|
bit IsImage = intr.IsImage;
|
|
|
|
}
|
|
|
|
|
2018-06-21 21:36:33 +08:00
|
|
|
def RsrcIntrinsics : GenericTable {
|
|
|
|
let FilterClass = "RsrcIntrinsic";
|
|
|
|
let Fields = ["Intr", "RsrcArg", "IsImage"];
|
|
|
|
|
|
|
|
let PrimaryKey = ["Intr"];
|
|
|
|
let PrimaryKeyName = "lookupRsrcIntrinsic";
|
|
|
|
}
|
|
|
|
|
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
|
|
|
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
|
|
|
AMDGPUImageDimIntrinsics,
|
|
|
|
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
|
|
|
|
2018-06-21 21:36:33 +08:00
|
|
|
class SourceOfDivergence<Intrinsic intr> {
|
2018-04-02 01:09:14 +08:00
|
|
|
Intrinsic Intr = intr;
|
|
|
|
}
|
|
|
|
|
2018-06-21 21:36:33 +08:00
|
|
|
def SourcesOfDivergence : GenericTable {
|
|
|
|
let FilterClass = "SourceOfDivergence";
|
|
|
|
let Fields = ["Intr"];
|
|
|
|
|
|
|
|
let PrimaryKey = ["Intr"];
|
|
|
|
let PrimaryKeyName = "lookupSourceOfDivergence";
|
|
|
|
}
|
|
|
|
|
2018-04-02 01:09:14 +08:00
|
|
|
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_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>;
|
2019-01-16 23:43:53 +08:00
|
|
|
def : SourceOfDivergence<int_amdgcn_ds_ordered_add>;
|
|
|
|
def : SourceOfDivergence<int_amdgcn_ds_ordered_swap>;
|
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>;
|