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

fix stp #42

Merged
merged 1 commit into from
Jan 12, 2022
Merged

fix stp #42

merged 1 commit into from
Jan 12, 2022

Conversation

6293
Copy link
Contributor

@6293 6293 commented Jan 12, 2022

Partial #36

@@ -469,14 +469,9 @@ impl InstructionSet for ArithmeticOp {
reg,
idx,
regs.get(reg, idx).and_then(|val| {
if step.as_i16() < 0 {
val.int_sub(Number::from(-step.as_i16()), IntFlags {
Copy link
Contributor Author

@6293 6293 Jan 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When applying Stp to A8 register, we are not sure that the step value (which is stored as i16) is within the scope of 8 bits. Maybe we should make Step i8, or add a method on Number that check if a number is representable in target bits (reshape method does not check that. it always returns false if a target bits are less than current bits)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good point! I think we need to reduce step down to u8 - but we need to make sure that the byte command is updated correspondingly. Let's do it as a separate PR (or pls open an issue for that just not to forget)

@6293
Copy link
Contributor Author

6293 commented Jan 12, 2022

@dr-orlovsky btw have you checked DM from me on Twitter?

@dr-orlovsky dr-orlovsky merged commit 02d2fa5 into AluVM:master Jan 12, 2022
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