[Beignet] [PATCH V4] backend: add global immediate optimization

Ivan Shapovalov intelfx at intelfx.name
Fri Jun 30 18:25:39 UTC 2017


On 2017-06-30 at 15:36 +0300, Ivan Shapovalov wrote:
> On 2017-06-30 at 01:46 +0000, Wang, Rander wrote:
> > Hi,
> > 
> > 	The abs of UD has to be done if it is encoded in instruction no
> > matter it make sense or not.
> >     And I have discussed with my collage and refine it.
> >     First we inspect the HW behavior of ABS(UD), -(UD) and find
> > that
> > ABS(UD) = UD,
> >     -(UD) = the result of -(UD) on CPU.
> > 
> > 	So the abs calculation can be removed and this will make it
> > compiled pass.
> > 
> > Rander 
> 
> Hi,
> 
> OK, but what about reading from .value.ud if the corresponding .type
> is
> not GEN_TYPE_UD? Is this a concern? Which operand type combinations
> are
> possible?
> 

I mean, due to an || in the conditional it looks like it is possible
for either of the operands to not be a GEN_TYPE_D. Suppose the first
operand is a signed dword (GEN_TYPE_D) that holds a negative value and
has the ABS flag. In this case the new code will yield a significantly
wrong result. Is this possible?

-- 
Ivan Shapovalov / intelfx /
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/beignet/attachments/20170630/9b9e17f8/attachment.sig>


More information about the Beignet mailing list