OSDN Git Service

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)
commit83bfebdaca87a3504ee31b3d2bc55bb0dc08397c
treeaa87ab69b07b2fffda8724f404b14b8b736dba64
parent036d645a4c89d27e4b36e702d11ad5dca98aa940
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329166 91177308-0d34-0410-b5e6-96231b3b80d8
16 files changed:
include/llvm/IR/Intrinsics.td
include/llvm/IR/IntrinsicsAMDGPU.td
lib/Target/AMDGPU/AMDGPUInstrInfo.cpp
lib/Target/AMDGPU/AMDGPUInstrInfo.h
lib/Target/AMDGPU/AMDGPUSearchableTables.td
lib/Target/AMDGPU/MIMGInstructions.td
lib/Target/AMDGPU/SIISelLowering.cpp
lib/Target/AMDGPU/SIInstrInfo.td
test/Analysis/DivergenceAnalysis/AMDGPU/llvm.amdgcn.image.atomic.ll
test/CodeGen/AMDGPU/llvm.amdgcn.image.atomic.dim.ll [new file with mode: 0644]
test/CodeGen/AMDGPU/llvm.amdgcn.image.d16.dim.ll [new file with mode: 0644]
test/CodeGen/AMDGPU/llvm.amdgcn.image.dim.ll [new file with mode: 0644]
test/CodeGen/AMDGPU/llvm.amdgcn.image.gather4.d16.dim.ll [new file with mode: 0644]
test/CodeGen/AMDGPU/llvm.amdgcn.image.gather4.dim.ll [new file with mode: 0644]
test/CodeGen/AMDGPU/llvm.amdgcn.image.sample.d16.dim.ll [new file with mode: 0644]
test/CodeGen/AMDGPU/llvm.amdgcn.image.sample.dim.ll [new file with mode: 0644]