[Mesa-dev] [PATCH 12/12] R600/SI: Add pattern to simplify i64 loading

Tom Stellard tom at stellard.net
Wed Feb 13 08:24:24 PST 2013


On Tue, Feb 12, 2013 at 06:13:24PM +0100, Christian König wrote:
> From: Christian König <christian.koenig at amd.com>
> 
> Signed-off-by: Christian König <christian.koenig at amd.com>
> ---
>  lib/Target/R600/SIInstrInfo.td    |    4 ++++
>  lib/Target/R600/SIInstructions.td |    5 +++++
>  2 files changed, 9 insertions(+)
> 
> diff --git a/lib/Target/R600/SIInstrInfo.td b/lib/Target/R600/SIInstrInfo.td
> index efc6015..8c4e5af 100644
> --- a/lib/Target/R600/SIInstrInfo.td
> +++ b/lib/Target/R600/SIInstrInfo.td
> @@ -40,6 +40,10 @@ def IMM12bit : ImmLeaf <
>    [{return isUInt<12>(Imm);}]
>  >;
>  
> +class InlineImm <ValueType vt> : ImmLeaf <vt, [{
> +  return -16 <= Imm && Imm <= 64;
> +}]>;
> +

I don't understand what this is checking for:

-16 <= Imm && Imm <= 64

Can you explain this?

>  class InstSI <dag outs, dag ins, string asm, list<dag> pattern> :
>      AMDGPUInst<outs, ins, asm, pattern> {
>  
> diff --git a/lib/Target/R600/SIInstructions.td b/lib/Target/R600/SIInstructions.td
> index f7d5cbf..19ea414 100644
> --- a/lib/Target/R600/SIInstructions.td
> +++ b/lib/Target/R600/SIInstructions.td
> @@ -1290,6 +1290,11 @@ def : Pat <
>    (S_MOV_B32 fpimm:$imm)
>  >;
>  
> +def : Pat <
> +  (i64 InlineImm<i64>:$imm),
> +  (S_MOV_B64 InlineImm<i64>:$imm)
> +>;
> +
>  // i64 immediates aren't supported in hardware, split it into two 32bit values
>  def : Pat <
>    (i64 imm:$imm),
> -- 
> 1.7.9.5
> 


More information about the mesa-dev mailing list