Skip to content

Conversation

smaeul
Copy link
Contributor

@smaeul smaeul commented Jun 19, 2022

In addition to running code on the AR100 in little-endian mode, this is how I tested my little-endian toolchain patches. I'm not sure if this is worth merging in its current state, but at least it documents what parts of the code would need to be changed.


Only a few changes are needed to swap the target instruction endianness.
Most of these places are already conditional on the host endianness, but
the changes are not completely overlapping. Add a macro for the target
endianness so it can be swapped out.

In the future, this choice could come from the config file, but that
requires more refactoring.

Signed-off-by: Samuel Holland samuel@sholland.org

Only a few changes are needed to swap the target instruction endianness.
Most of these places are already conditional on the host endianness, but
the changes are not completely overlapping. Add a macro for the target
endianness so it can be swapped out.

In the future, this choice could come from the config file, but that
requires more refactoring.

Signed-off-by: Samuel Holland <samuel@sholland.org>
#endif /* ULONGEST */

/* Endianness convenience macros */
#define TARGET_BIG_ENDIAN
Copy link
Member

Choose a reason for hiding this comment

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

To switch this to little endian you just remove this line? I think just adding a comment explaining the purpose of the TARGET_BIG_ENDIAN macro should be good enough.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, that's right.

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