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

Allow 8 octets input signed extension function (64bit) #151

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

emielsebastiaan
Copy link
Contributor

@emielsebastiaan emielsebastiaan commented Nov 22, 2024

Suggested changes (32bit -> 64bit)

  1. In GP-0.5.0-eq:A.11: Allow 8 input octets for the signed extension function as a consequence of the change to a 64bit architecture. Direct evidence of this requirement in instructions 141 & 142.
  2. In GP-0.5.0-eq:A.20: add mod2^32 to instruction 72.

Allow up to 8 input octets for the signed extension function as a consequence of the change to a 64bit architecture. Direct evidence of this requirement in instructions 140 & 141.
Allow `L_Y` to be up to (value) 8 and thus allow the `signed extension`-function up to 8 bytes of input to determine `V_Y`.
In GP-0.5.0-eq:A.20: Allow `L_Y` to be up to (value) 8 and thus allow the `signed extension`-function up to 8 bytes of input to determine `V_Y`. And add mod2^32 to instruction 72.
In GP-0.5.0-eq:A.21: Allow `L_X` to be up to (value) 8 and thus allow the `signed extension`-function up to 8 bytes of input to determine `V_X`.
In GP-0.5.0-eq:A.23: Allow `L_X` to be up to (value) 8 and thus allow the `signed extension`-function up to 8 bytes of input to determine `V_X`. Required for instructions: 126, 127, 132, 133, 137, 138, 139, 140, 141, 142, 144, 145, 146, 147.
@koute
Copy link
Contributor

koute commented Nov 25, 2024

The limit of immediates being at most 4 bytes is a deliberate design decision. We don't want 8 byte immediates; it just makes recompilation into native code slower and more complex without any real benefit.

@emielsebastiaan
Copy link
Contributor Author

@koute could you explain instruction 33 (GP-0.5.0) store_imm_u64.
If 8 byte immediates are not allowed (by design) how is this instruction different from instruction 32 store_imm_u32?

@koute
Copy link
Contributor

koute commented Nov 25, 2024

8 byte physical (as encoded in the code blob) immediates are not allowed (except the load_imm_64 instruction). The immediate value (as encoded in the code blob) can be at most 4 bytes, but if necessary it is sign extended to full 64-bit. The difference between store_imm_u32 and store_imm_u64 is that store_imm_u32 will write the lower four bytes of the sign extended immediate to memory, and store_imm_u64 will write the full 8 bytes of the sign extended immediate.

Corrections
@emielsebastiaan
Copy link
Contributor Author

Thank you for the comments @koute
I changed this PR.
Two small suggestions remain.

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