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

word_to_bytes #972

Merged
merged 6 commits into from Sep 14, 2023
Merged

word_to_bytes #972

merged 6 commits into from Sep 14, 2023

Conversation

mktnk3
Copy link
Contributor

@mktnk3 mktnk3 commented Sep 1, 2023

This PR adds word_to_bytes to byteTheory. It converts w:’a word to a list of length bytes_in_word, consisting of word8 segments of w. Also includes several related lemmas.

- "word_to_bytes o word_of_bytes" is id
- word_slice_alt <-> word_slice conversion
- the above two defined as shift operations
- and some more
@mktnk3
Copy link
Contributor Author

mktnk3 commented Sep 7, 2023

I should mention that word_to_bytes_aux is what I am currently using to take “sub-word” information out of a word (as part of an argument to call_FFI to write to the external memory, in this particular case). For the time being we only need to read out a byte (for byte-access), but if we want 16bit-access, etc., we can use this function to get a byte-list of part of a word. So, we could rename this to make it seem less aux if that’s better.
But it is also entirely possible not to use this aux function. We can always convert the whole word to a byte list (of length bytes_in_word) and take only the elements needed.

@myreen myreen merged commit 9e4e7ac into master Sep 14, 2023
@myreen myreen deleted the byte branch September 14, 2023 08:45
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.

None yet

2 participants