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

-----Original Message-----
From: Ivan Shapovalov [mailto:[email protected]] 
Sent: Saturday, July 1, 2017 2:26 AM
To: Wang, Rander <[email protected]>; [email protected]
Cc: Song, Ruiling <[email protected]>
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 /
_______________________________________________
Beignet mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/beignet

Reply via email to