openrisc / or1ksim

The OpenRISC 1000 architectural simulator
GNU General Public License v3.0
69 stars 43 forks source link

[RFC] Abstract the target endianness with a macro #21

Open smaeul opened 2 years ago

smaeul commented 2 years ago

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