Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bitfields should be described in a more generic way #266

Open
kito-cheng opened this issue Apr 21, 2022 · 2 comments
Open

Bitfields should be described in a more generic way #266

kito-cheng opened this issue Apr 21, 2022 · 2 comments
Milestone

Comments

@kito-cheng
Copy link
Collaborator

Review comment come from @anderslindgren-iar and Anders Berg(IAR) https://lists.riscv.org/g/tech-toolchain-runtime/message/344

Bitfields are packed in little-endian fashion. A bitfield that would span the alignment boundary of its integer type is padded to begin at the next alignment boundary. For example, struct { int x : 10; int y : 12; } is a 32-bit type with x in bits 9-0, y in bits 21-10, and bits 31-22 undefined. By contrast, struct { short x : 10; short y : 12; } is a 32-bit type with x in bits 9-0, y in bits 27-16, and bits 31-28 and 15-10 undefined.

Anders: Bitfields should be described in a more generic way as it is not only a matter of a calling convention.

@kito-cheng kito-cheng added this to the Public Review for 1.0 milestone Apr 21, 2022
@kito-cheng
Copy link
Collaborator Author

I think we should improve that, and I am working on that.

@kito-cheng
Copy link
Collaborator Author

Moving target to post 1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant