From 836cdd97fe698b12deddb5364a0e4efcb19586a6 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Tue, 5 Feb 2013 17:09:10 +0000 Subject: [PATCH] R600/SI: Add patterns for fcos and fsin. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fixes 37 piglit tests and allows e.g. FlightGear to run with radeonsi. Patch by: Michel Dänzer Signed-off-by: Michel Dänzer Reviewed-by: Tom Stellard llvm-svn: 174391 --- llvm/lib/Target/R600/SIInstructions.td | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/llvm/lib/Target/R600/SIInstructions.td b/llvm/lib/Target/R600/SIInstructions.td index 4164c55..85bb73a 100644 --- a/llvm/lib/Target/R600/SIInstructions.td +++ b/llvm/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), -- 2.7.4