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

Data packing #49

Open
douggilliland opened this issue Jul 28, 2019 · 2 comments
Open

Data packing #49

douggilliland opened this issue Jul 28, 2019 · 2 comments

Comments

@douggilliland
Copy link
Owner

Unnecessary enhancement. All values use a long location regardless of their length. Could use space more efficiently (unnecessary enhancement). Just noting for possible future enhancements.

If we implement better packing we still need to make sure that when we go to a new data type that we long word align the addresses.

firstLong: .long 0x00000001
secondLong: .long 0x00000002
firstShort: .short 0x1234
secondShort: .short 0x5678
firstByte: .byte 0x99
secondByte: .byte 0x88
thirdByte: .byte 0x77
fourthByte: .byte 0x66

start:
00000000 42800000 lix r8,firstLong.lower
00000001 42800004 lix r8,secondLong.lower
00000002 42800008 lix r8,firstShort.lower
00000003 4280000C lix r8,secondShort.lower
00000004 42800010 lix r8,firstByte.lower
00000005 42800014 lix r8,secondByte.lower
00000006 42800018 lix r8,thirdByte.lower
00000007 4280001C lix r8,fourthByte.lower

@douggilliland
Copy link
Owner Author

Optimizing above would be:

00000002 42800008 lix r8,firstShort.lower
00000003 4280000A lix r8,secondShort.lower
00000004 4280000C lix r8,firstByte.lower
00000005 4280000D lix r8,secondByte.lower
00000006 4280000E lix r8,thirdByte.lower
00000007 4280000F lix r8,fourthByte.lower

@douggilliland
Copy link
Owner Author

It would be a bit tricky to test and make sure the address is long word aligned.
.long has to always be long word aligned.
.short has to always be short word aligned.
.byte can be any aligned.

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