[PATCH] R600: Add intrinsics for mad24

Tom Stellard tom at stellard.net
Thu May 15 12:09:07 PDT 2014


On Thu, May 15, 2014 at 09:34:03AM -0700, Matt Arsenault wrote:
> 
> On May 15, 2014, at 6:17 AM, Tom Stellard <tom at stellard.net> wrote:
> 
> >> let Predicates = [isCayman] in {
> >> 
> >> def MULADD_INT24_cm : R600_3OP <0x08, "MULADD_INT24",
> >> -  [(set i32:$dst, (add (AMDGPUmul_i24 i32:$src0, i32:$src1), i32:$src2))], VecALU
> >> +  [(set i32:$dst, (AMDGPUmad_i24 i32:$src0, i32:$src1, i32:$src2))], VecALU
> >>> ;
> >> def MUL_INT24_cm : R600_2OP <0x5B, "MUL_INT24",
> >>   [(set i32:$dst, (AMDGPUmul_i24 i32:$src0, i32:$src1))], VecALU
> >>> ;
> >> 
> >> +def : IMad24Pat<MULADD_INT24_cm>;
> >> +
> > 
> > We need to add a fall-back pattern for targets that don't support 24-bit
> > ops.  Pre-Evergreen doesn't have 24-bit ops and Evergreen only supports 24-bit
> > unsigned operations.
> > 
> > -Tom
> 
> Why? The pattern matching the multiply pattern is under the isCayman predicate, so it won’t be matched. I’m also not sure it’s expected that intrinsics for a feature will work for subtargets without it. However, I have been thinking it would be easier to handle feature nodes like this by expanding them on targets without these features in ISelDAGToDAG::PreprocessISelDAG
> 

Because if someone tries to use the intrinsic on unsupported platform.  The compiler will crash.
In this case it is easy to support the intrinsic on all platforms, so I think we should.

-Tom

> -Matt




More information about the llvm-commits mailing list