[Mesa-dev] [PATCH 1/2] nir: Add inverted bitwise ops

Alyssa Rosenzweig alyssa at rosenzweig.io
Fri Apr 26 02:24:45 UTC 2019


> We can support all of these with source modifiers because the above three
> aren't really "dest invertable"...  For us, they'd be
> 
> ~src0 | ~src1
> ~src0 & ~src1
> ~src0 ^ ~src1
> 
> Is it really dest_invertable or both_srcs_invertable? :-)

Sure, I wasn't sure how other drivers would want to handle this, if at
all. I'm rather regretting not slapping an "RFC" tag on this, oh well :)

> Also worth noting that I've considered adding a not modifier to NIR (if
> source modifiers are a thing we actually want at that level).  Over-all,
> I'm a little uncertain if these need to be their own ops or not...

It's worth noting that, as far as I know, the instructions added here
are the _only_ ones that Midgard can do -- our source modifiers only
apply to floating-point ops (int ops use the bits to distinguish
sign-ext/zero-ext). The not's in these ops is baked right into the
instruction.

It'd be a simple lowering pass either way, of course.


More information about the mesa-dev mailing list