From 1c5c4243c9c10666280a540fb2789c2d09e095b3 Mon Sep 17 00:00:00 2001 From: Vadim Girlin Date: Fri, 25 May 2012 17:27:46 +0400 Subject: [PATCH] radeon/llvm: add FLT_TO_UINT, UINT_TO_FLT instructions Signed-off-by: Vadim Girlin Reviewed-by: Tom Stellard --- .../drivers/radeon/R600Instructions.td | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/gallium/drivers/radeon/R600Instructions.td b/src/gallium/drivers/radeon/R600Instructions.td index 04f49cd2875..b6b9fe002ad 100644 --- a/src/gallium/drivers/radeon/R600Instructions.td +++ b/src/gallium/drivers/radeon/R600Instructions.td @@ -618,6 +618,16 @@ class INT_TO_FLT_Common inst> : R600_1OP < [(set R600_Reg32:$dst, (sint_to_fp R600_Reg32:$src))] >; +class FLT_TO_UINT_Common inst> : R600_1OP < + inst, "FLT_TO_UINT", + [(set R600_Reg32:$dst, (fp_to_uint R600_Reg32:$src))] +>; + +class UINT_TO_FLT_Common inst> : R600_1OP < + inst, "UINT_TO_FLT", + [(set R600_Reg32:$dst, (uint_to_fp R600_Reg32:$src))] +>; + class LOG_CLAMPED_Common inst> : R600_1OP < inst, "LOG_CLAMPED", [] @@ -740,6 +750,8 @@ let Predicates = [isR600] in { def RECIPSQRT_IEEE_r600 : RECIPSQRT_IEEE_Common<0x69>; def FLT_TO_INT_r600 : FLT_TO_INT_Common<0x6b>; def INT_TO_FLT_r600 : INT_TO_FLT_Common<0x6c>; + def FLT_TO_UINT_r600 : FLT_TO_UINT_Common<0x79>; + def UINT_TO_FLT_r600 : UINT_TO_FLT_Common<0x6d>; def SIN_r600 : SIN_Common<0x6E>; def COS_r600 : COS_Common<0x6F>; def ASHR_r600 : ASHR_Common<0x70>; @@ -932,9 +944,17 @@ class TRIG_eg : Pat< def INT_TO_FLT_eg : INT_TO_FLT_Common<0x9B>; + def FLT_TO_UINT_eg : FLT_TO_UINT_Common<0x9A> { + let Pattern = []; + } + + def UINT_TO_FLT_eg : UINT_TO_FLT_Common<0x9C>; + def : Pat<(fp_to_sint R600_Reg32:$src), (FLT_TO_INT_eg (TRUNC R600_Reg32:$src))>; + def : Pat<(fp_to_uint R600_Reg32:$src), + (FLT_TO_UINT_eg (TRUNC R600_Reg32:$src))>; } let Predicates = [isCayman] in { -- 2.30.2