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

Wang, Rander rander.wang at intel.com
Mon Jul 3 01:32:31 UTC 2017


For D + UD,   D is considered as UD by HW.

-----Original Message-----
From: Ivan Shapovalov [mailto:intelfx at intelfx.name] 
Sent: Saturday, July 1, 2017 2:26 AM
To: Wang, Rander <rander.wang at intel.com>; beignet at lists.freedesktop.org
Cc: Song, Ruiling <ruiling.song at intel.com>
Subject: Re: [Beignet] [PATCH V4] backend: add global immediate optimization

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 /


More information about the Beignet mailing list