[Mesa-dev] [PATCH] R600/SI: Add patterns for fcos and fsin.
Michel Dänzer
michel at daenzer.net
Tue Jan 22 11:14:42 PST 2013
From: Michel Dänzer <michel.daenzer at amd.com>
Fixes 37 piglit tests and allows e.g. FlightGear to run with radeonsi.
Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---
lib/Target/R600/SIInstructions.td | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/lib/Target/R600/SIInstructions.td b/lib/Target/R600/SIInstructions.td
index 4164c55..85bb73a 100644
--- a/lib/Target/R600/SIInstructions.td
+++ b/lib/Target/R600/SIInstructions.td
@@ -1326,6 +1326,16 @@ def : Pat<
>;
def : Pat <
+ (fcos AllReg_32:$src0),
+ (V_COS_F32_e32 (V_MUL_F32_e32 AllReg_32:$src0, (V_MOV_IMM_I32 CONST.TWO_PI_INV)))
+>;
+
+def : Pat <
+ (fsin AllReg_32:$src0),
+ (V_SIN_F32_e32 (V_MUL_F32_e32 AllReg_32:$src0, (V_MOV_IMM_I32 CONST.TWO_PI_INV)))
+>;
+
+def : Pat <
(int_AMDGPU_cube VReg_128:$src),
(INSERT_SUBREG (INSERT_SUBREG (INSERT_SUBREG (INSERT_SUBREG (v4f32 (IMPLICIT_DEF)),
(V_CUBETC_F32 (EXTRACT_SUBREG VReg_128:$src, sel_x),
--
1.7.10.4
More information about the mesa-dev
mailing list