RFA: fix execute/simd-4 for little endian

Aldy Hernandez aldyh@redhat.com
Thu Jun 19 13:04:00 GMT 2003


I may be going out on a limb here, but I think this is obviously ok.

Aldy

> 	* gcc.c-torture/execute/simd-4.c (main): Make expected value
> 	endian-dependent.
> 
> Index: simd-4.c
> ===================================================================
> RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.c-torture/execute/simd-4.c,v
> retrieving revision 1.1
> diff -p -r1.1 simd-4.c
> *** simd-4.c	17 Jun 2003 00:02:06 -0000	1.1
> --- simd-4.c	19 Jun 2003 12:31:49 -0000
> *************** __ev_convert_s64 (v2si a)
> *** 9,16 ****
>   
>   int main()
>   {
>     s64 = __ev_convert_s64 ((v2si){1,0xffffffff});
> !   if (s64 != 0x1ffffffffLL)
>       abort ();
>     return 0;
>   }
> --- 9,19 ----
>   
>   int main()
>   {
> +   union { long long ll; int i[2] } endianness_test;
> +   endianness_test.ll = 1;
> +   int little_endian = endianness_test.i[0];
>     s64 = __ev_convert_s64 ((v2si){1,0xffffffff});
> !   if (s64 != (little_endian ? 0xffffffff00000001LL : 0x1ffffffffLL))
>       abort ();
>     return 0;
>   }



More information about the Gcc-patches mailing list