[Mesa-dev] [PATCH 11/14] R600/SI: add OMOD patterns

Michel Dänzer michel at daenzer.net
Thu Feb 21 00:54:47 PST 2013


On Don, 2013-02-21 at 09:44 +0100, Christian König wrote: 
> Am 21.02.2013 09:26, schrieb Michel Dänzer:
> > On Mit, 2013-02-20 at 18:46 +0100, Christian König wrote:
> >>   
> >> diff --git a/lib/Target/R600/SIInstructions.td b/lib/Target/R600/SIInstructions.td
> >> index 833e6cd..7c157e9 100644
> >> --- a/lib/Target/R600/SIInstructions.td
> >> +++ b/lib/Target/R600/SIInstructions.td
> >> @@ -1232,6 +1232,24 @@ def : Pat <
> >>      0 /* ABS */, 0 /* CLAMP */, 0 /* OMOD */, 1 /* NEG */)
> >>   >;
> >>   
> >> +def : Pat <
> >> +  (fmul VReg_32:$src, (f32 FP_0_5)),
> >> +  (V_ADD_F32_e64 VReg_32:$src, (i32 0x80 /* SRC1 */),
> >> +   0 /* ABS */, 0 /* CLAMP */, 3 /* OMOD */, 0 /* NEG */)
> >> +>;
> >> +
> >> +def : Pat <
> >> +  (fmul VReg_32:$src, (f32 FP_TWO)),
> >> +  (V_ADD_F32_e64 VReg_32:$src, (i32 0x80 /* SRC1 */),
> >> +   0 /* ABS */, 0 /* CLAMP */, 1 /* OMOD */, 0 /* NEG */)
> >> +>;
> >> +
> >> +def : Pat <
> >> +  (fmul VReg_32:$src, (f32 FP_FOUR)),
> >> +  (V_ADD_F32_e64 VReg_32:$src, (i32 0x80 /* SRC1 */),
> >> +   0 /* ABS */, 0 /* CLAMP */, 2 /* OMOD */, 0 /* NEG */)
> >> +>;
> > Is there any advantage to doing it like this as opposed to using
> > V_MUL_F32_e32 with the corresponding inline constant source operands? I
> > guess it could work for SGPRs as the source as well, if the patterns
> > used VSrc instead of VReg, but otherwise MUL would result in more
> > compact code.
> 
> Good question, I don't see any advantage right now. I just wanted to 
> make sure that it's working as expected by doing a full piglit test run.

piglit quick-driver.tests only takes about 10 minutes. :)


> Going to change my folding to use V_MUL instead and dropping this patch 
> from the patchset.
> 
> Do I have your Rb for the rest?

Apart from the question about dealing with implicit operands in the asm
strings, yes.


> If yes I really want to commit this, cause patch 12 is fixing 40
> piglit tests for me.

That's great, but please don't rush it. Remember, we cannot commit
changes without prior approval by Tom (or another LLVM developer).


-- 
Earthling Michel Dänzer           |                   http://www.amd.com
Libre software enthusiast         |          Debian, X and DRI developer


More information about the mesa-dev mailing list