Skip to content

Conversation

@tomeksowi
Copy link
Contributor

@tomeksowi tomeksowi commented May 22, 2025

Clarification for languages that allow structs with arbitrary user-defined field offsets.

In Ada, GCC (gnat) passes this struct with a representation clause in two FP registers assigned in memory order (B in fa0, A in fa1) so I went with that.

   type My_Struct is record
      A : Float;
      B : Float;
   end record;

   -- Reverse layout: B at 0, A at 4
   for My_Struct use record
      A at 4 range 0 .. 31;
      B at 0 range 0 .. 31;
   end record;

Copy link
Collaborator

@kito-cheng kito-cheng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks :)

@kito-cheng kito-cheng merged commit ee1eefc into riscv-non-isa:master Jun 11, 2025
4 checks passed
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

Successfully merging this pull request may close these issues.

2 participants