how to rewrite the result of sizeof operator

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

how to rewrite the result of sizeof operator

David Blaikie via cfe-dev
Hi, there

I met some problem about sizeof operator. I am implementing a new backend.
The backend has two kind of registers which have the same data format.
so we designed the following two type, v16i32 and va16i32.
typedef int __attribute__((__vector_size__(64), aligned(128))) v16i32;
typedef int __attribute__((__vector_size__(16), aligned(128))) va4i32;
typedef va4i32 va16i32;
v16i32 for one kind of register and va16i32 for the other kind.
va16i32 borrows the type v4i32 for IR.
There is a problem.sizeof(v16i32) == 64. that's OK. But sizeof(va16i32) ==16, that's not what we expect.
We need the result of sizeof(va16i32) to be 64.
How can I rewrite the result of sizeof operator on va16i32?  Could anyone help?
Much Thanks in advance! 

Best Regards,


cfe-dev mailing list
[hidden email]