BImode and STORE_VALUE_FLAG

Paulo J. Matos paulo@matos-sorge.com
Wed May 8 21:02:00 GMT 2013


On 08/05/13 21:29, Andreas Schwab wrote:
> "Paulo J. Matos" <paulo@matos-sorge.com> writes:
>
>> As I expected. That doesn't sound good
>
> In which way is it not good?
>
> Andreas.
>

Shouldn't we expect ires to be -1 (STORE_FLAG_VALUE) and therefore the 
condition of the if be false if everything is fine?

Otherwise if, independently of STORE_FLAG_VALUE results of comparisons 
are 0 or 1, can you explain the gcc test vector-compare-1.c 
(http://repo.or.cz/w/official-gcc.git/blob/gcc-4_7-branch:/gcc/testsuite/gcc.c-torture/execute/vector-compare-1.c)?

This compares two vectors and then checks that each of the elements obey 
the comparison. If you, like me, have no builtin vector comparisons then 
the vector comparison is exploded into the comparison of each of the 
elements and respective assignment into the comparison result vector.

Then, what worries me is:
  8       if ((res)[__i] != ((i0)[__i] op (i1)[__i] ? -1 : 0)) \

Can you explain the reasoning behind this?
[it just occurred to me that what I might be missing is that scalar 
comparisons returns 0 or 1 and vector comparisons returns a vector with 
all zeros or a vector with all -1]

Let me add that I just noticed that this test disappeared from HEAD, so 
there might be a reason for that. I don't have a cloned rep here so I 
can't see why it was removed (or even it was just moved, instead of 
removed).

-- 
PMatos



More information about the Gcc mailing list