summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2013-01-21 15:40:48 +0000
committerTom Stellard <thomas.stellard@amd.com>2013-01-21 15:40:48 +0000
commitc9b903138d8a3db151e90e8c3099ff005a4a5244 (patch)
tree61efe90978fe8d497e069eb20900b77a32985f36 /llvm/lib
parent14421a793f69eccc34cc675f06ec065a86ebd6be (diff)
downloadbcm5719-llvm-c9b903138d8a3db151e90e8c3099ff005a4a5244.tar.gz
bcm5719-llvm-c9b903138d8a3db151e90e8c3099ff005a4a5244.zip
R600/SI: Use unnormalized coordinates for sampling with the RECT target.
Patch by: Michel Dänzer Reviewed-by: Tom Stellard <thomas.stellard@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> llvm-svn: 173053
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/R600/R600Instructions.td7
-rw-r--r--llvm/lib/Target/R600/SIInstructions.td6
2 files changed, 13 insertions, 0 deletions
diff --git a/llvm/lib/Target/R600/R600Instructions.td b/llvm/lib/Target/R600/R600Instructions.td
index 64bab18fa6c..b15ea762bfd 100644
--- a/llvm/lib/Target/R600/R600Instructions.td
+++ b/llvm/lib/Target/R600/R600Instructions.td
@@ -342,6 +342,13 @@ def TEX_SHADOW : PatLeaf<
}]
>;
+def TEX_RECT : PatLeaf<
+ (imm),
+ [{uint32_t TType = (uint32_t)N->getZExtValue();
+ return TType == 5;
+ }]
+>;
+
class EG_CF_RAT <bits <8> cf_inst, bits <6> rat_inst, bits<4> rat_id, dag outs,
dag ins, string asm, list<dag> pattern> :
InstR600ISA <outs, ins, asm, pattern> {
diff --git a/llvm/lib/Target/R600/SIInstructions.td b/llvm/lib/Target/R600/SIInstructions.td
index 0f9d572c4ad..4164c558378 100644
--- a/llvm/lib/Target/R600/SIInstructions.td
+++ b/llvm/lib/Target/R600/SIInstructions.td
@@ -1191,6 +1191,12 @@ def : Pat <
SReg_256:$rsrc, SReg_128:$sampler)
>;
+def : Pat <
+ (int_SI_sample imm:$writemask, VReg_128:$coord, SReg_256:$rsrc, SReg_128:$sampler, TEX_RECT),
+ (IMAGE_SAMPLE imm:$writemask, 1, 0, 0, 0, 0, 0, 0, VReg_128:$coord,
+ SReg_256:$rsrc, SReg_128:$sampler)
+>;
+
/* int_SI_sample_lod */
def : Pat <
(int_SI_sample_lod imm:$writemask, VReg_128:$coord, SReg_256:$rsrc, SReg_128:$sampler, imm),
OpenPOWER on IntegriCloud