R600/SI: Use unnormalized coordinates for sampling with the RECT target.
authorTom Stellard <thomas.stellard@amd.com>
Mon, 21 Jan 2013 15:40:48 +0000 (15:40 +0000)
committerTom Stellard <thomas.stellard@amd.com>
Mon, 21 Jan 2013 15:40:48 +0000 (15:40 +0000)
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>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173053 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/R600/R600Instructions.td
lib/Target/R600/SIInstructions.td

index 64bab18fa6c097445bde7aba8b598285deae7ee4..b15ea762bfdce652182b01da7f3881f61cd340ec 100644 (file)
@@ -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> {
index 0f9d572c4ada5941baa39425f5b6662f4df6d620..4164c558378edba1702f7779838b88e36bb4c5fc 100644 (file)
@@ -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),