[cfe-dev] how to rewrite the result of sizeof operator

林政宗 via cfe-dev cfe-dev at lists.llvm.org
Wed Nov 18 18:53:42 PST 2020


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,
Jerry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20201119/8a84abc2/attachment.html>


More information about the cfe-dev mailing list