AMDGPU: Dimension-aware image intrinsics
authorNicolai Haehnle <nhaehnle@gmail.com>
Wed, 4 Apr 2018 10:58:54 +0000 (10:58 +0000)
committerNicolai Haehnle <nhaehnle@gmail.com>
Wed, 4 Apr 2018 10:58:54 +0000 (10:58 +0000)
commit2f5a73820c1ef6fbc687608deee56fa9c8c711b7
treeca638113e1f851b7568e1d294ef1119cfddd00e5
parenteb7311ffb126282c9b131b2fa3d541eb0f0321ca
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
16 files changed:
llvm/include/llvm/IR/Intrinsics.td
llvm/include/llvm/IR/IntrinsicsAMDGPU.td
llvm/lib/Target/AMDGPU/AMDGPUInstrInfo.cpp
llvm/lib/Target/AMDGPU/AMDGPUInstrInfo.h
llvm/lib/Target/AMDGPU/AMDGPUSearchableTables.td
llvm/lib/Target/AMDGPU/MIMGInstructions.td
llvm/lib/Target/AMDGPU/SIISelLowering.cpp
llvm/lib/Target/AMDGPU/SIInstrInfo.td
llvm/test/Analysis/DivergenceAnalysis/AMDGPU/llvm.amdgcn.image.atomic.ll
llvm/test/CodeGen/AMDGPU/llvm.amdgcn.image.atomic.dim.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/llvm.amdgcn.image.d16.dim.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/llvm.amdgcn.image.dim.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/llvm.amdgcn.image.gather4.d16.dim.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/llvm.amdgcn.image.gather4.dim.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/llvm.amdgcn.image.sample.d16.dim.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/llvm.amdgcn.image.sample.dim.ll [new file with mode: 0644]