This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 5/5][testsuite] Use stdint.h when needing int of exact size


On 7/24/07, Rask Ingemann Lambertsen <rask@sygehus.dk> wrote:
On Tue, Jul 24, 2007 at 11:50:07AM -0700, Andrew Pinski wrote:
> On 7/24/07, Rask Ingemann Lambertsen <rask@sygehus.dk> wrote:

> >2007-07-24  Rask Ingemann Lambertsen  <rask@sygehus.dk>
> >
> >        * gcc.dg/torture/pr27743.c (bar): Use an integer of exactly 32 bits
> >        where required.
> >        * gcc.c-torture/execute/simd-1.c: Likewise.
> >        * gcc.c-torture/execute/pr23135.c: Likewise.
> >        * gcc.c-torture/execute/simd-4.c (__ev_convert_s64)(main):
> >        Likewise.
> >        Use an integer of exactly 64 bits where required.
>
> Why did you change the simd ones from using SImode?

   Simd-1.c and pr23135.c want a 16 byte vector with four elements. This
means four bytes per element. I don't know what the size of SImode is (or if
it even exists). For example, if you try this

Index: gcc.c-torture/execute/simd-1.c
===================================================================
--- gcc.c-torture/execute/simd-1.c      (revision 126653)
+++ gcc.c-torture/execute/simd-1.c      (working copy)
@@ -4,7 +4,7 @@
    regardless of if the target has SIMD instructions.
 */

-typedef int __attribute__((vector_size (16))) vecint;
+typedef int __attribute__((mode(SI))) __attribute__((vector_size (16))) vecint;
 typedef int __attribute__((mode(SI))) siint;

vecint i = { 150, 100, 150, 200 };

on c4x-unknown-coff, you get

$ ./xgcc -B./ ~/simd-1.c -S -o /dev/null
/home/rask/simd-1.c:7: error: unable to emulate SI
/home/rask/simd-1.c:8: error: unable to emulate SI

and SImode would be 128-bits on that target. Simd-4.c makes an endianess test
and wants an 8 byte vector with two elements, each of which can hold at most
0xffffffff. All three testcases use a union for type conversion. Suggestions
are welcome.

SImode is always 4 bytes and it is required to "exist". So


typedef int __attribute__((mode(SI))) __attribute__((vector_size (16)))

cannot work.

Richard.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]