[Mesa-dev] [PATCH 2/3] R600/SI: Take target parameter for sample intrinsics.

Michel Dänzer michel at daenzer.net
Wed Jan 16 01:42:32 PST 2013


From: Michel Dänzer <michel.daenzer at amd.com>


Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---

This is a prerequisite for patch 3 (and probably more similar changes in the
future). Unfortunately, it introduces a couple of (non-fatal) error messages
such as below during the R600 target build. Tom or anyone, any ideas for
silencing these?

anonymous.105: 	(intrinsic_w_chain:v4f32 2651:iPTR, (imm:i32):$writemask, VReg_128:v4f32:$coord, SReg_256:v8i32:$rsrc, SReg_128:v4i32:$sampler, (imm:i32):$textureTarget)
Included from /home/daenzer/src/llvm-git/llvm/lib/Target/R600/AMDGPU.td:40:
Included from /home/daenzer/src/llvm-git/llvm/lib/Target/R600/AMDGPUInstructions.td:189:
Included from /home/daenzer/src/llvm-git/llvm/lib/Target/R600/SIInstrInfo.td:591:
/home/daenzer/src/llvm-git/llvm/lib/Target/R600/SIInstructions.td:1188:1: error: In anonymous.105: Pattern has dead named input: $textureTarget
def : Pat <
^

 lib/Target/R600/SIInstructions.td |    6 +++---
 lib/Target/R600/SIIntrinsics.td   |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/Target/R600/SIInstructions.td b/lib/Target/R600/SIInstructions.td
index cac42da..01c6ec1 100644
--- a/lib/Target/R600/SIInstructions.td
+++ b/lib/Target/R600/SIInstructions.td
@@ -1186,21 +1186,21 @@ def : Pat <
 
 /* int_SI_sample */
 def : Pat <
-  (int_SI_sample imm:$writemask, VReg_128:$coord, SReg_256:$rsrc, SReg_128:$sampler),
+  (int_SI_sample imm:$writemask, VReg_128:$coord, SReg_256:$rsrc, SReg_128:$sampler, imm:$textureTarget),
   (IMAGE_SAMPLE imm:$writemask, 0, 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),
+  (int_SI_sample_lod imm:$writemask, VReg_128:$coord, SReg_256:$rsrc, SReg_128:$sampler, imm:$textureTarget),
   (IMAGE_SAMPLE_L imm:$writemask, 0, 0, 0, 0, 0, 0, 0, VReg_128:$coord,
                   SReg_256:$rsrc, SReg_128:$sampler)
 >;
 
 /* int_SI_sample_bias */
 def : Pat <
-  (int_SI_sample_bias imm:$writemask, VReg_128:$coord, SReg_256:$rsrc, SReg_128:$sampler),
+  (int_SI_sample_bias imm:$writemask, VReg_128:$coord, SReg_256:$rsrc, SReg_128:$sampler, imm:$textureTarget),
   (IMAGE_SAMPLE_B imm:$writemask, 0, 0, 0, 0, 0, 0, 0, VReg_128:$coord,
                   SReg_256:$rsrc, SReg_128:$sampler)
 >;
diff --git a/lib/Target/R600/SIIntrinsics.td b/lib/Target/R600/SIIntrinsics.td
index 0d1064e..4393144 100644
--- a/lib/Target/R600/SIIntrinsics.td
+++ b/lib/Target/R600/SIIntrinsics.td
@@ -22,7 +22,7 @@ let TargetPrefix = "SI", isTarget = 1 in {
   def int_SI_vs_load_input : Intrinsic <[llvm_v4f32_ty], [llvm_v4i32_ty, llvm_i16_ty, llvm_i32_ty], [IntrReadMem]> ;
   def int_SI_wqm : Intrinsic <[], [], []>;
 
-  class Sample : Intrinsic <[llvm_v4f32_ty], [llvm_i32_ty, llvm_v4f32_ty, llvm_v8i32_ty, llvm_v4i32_ty], [IntrReadMem]>;
+  class Sample : Intrinsic <[llvm_v4f32_ty], [llvm_i32_ty, llvm_v4f32_ty, llvm_v8i32_ty, llvm_v4i32_ty, llvm_i32_ty], [IntrReadMem]>;
 
   def int_SI_sample : Sample;
   def int_SI_sample_bias : Sample;
-- 
1.7.10.4



More information about the mesa-dev mailing list