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

Consider renaming le16, le32, le64 #354

Closed
riptl opened this issue Jul 7, 2022 · 0 comments
Closed

Consider renaming le16, le32, le64 #354

riptl opened this issue Jul 7, 2022 · 0 comments

Comments

@riptl
Copy link

riptl commented Jul 7, 2022

The LE/BE instructions are a remnant from the Linux eBPF ISA lineage. They used to allow endianness conversions given unknown host endianness.

Solana mainnet is always little-endian however, regardless of host endianness. Therefore an LE opcode doesn't make much sense.

In practice,

  • le16 <reg> is and <reg>, 0xffff
  • le32 <reg> is and <reg>, 0xffffffff or mov32 <reg>, <reg>
  • le64 does nothing

Therefore I propose renaming the LE mnemonics to avoid confusion.

  • le16 into mask16
  • le32 into mask32
  • le64 into nop
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

2 participants