Skip to content

Commit

Permalink
WIP on movsx
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonGross committed Mar 7, 2025
1 parent 11b2302 commit f847700
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Assembly/Symbolic.v
Original file line number Diff line number Diff line change
Expand Up @@ -4202,6 +4202,14 @@ Definition SymexNormalInstruction {opts : symbolic_options_computed_opt} {descr:
| (mov | movzx | movabs | movdqa | movdqu | movq | movd | movups), [dst; src] => (* Note: unbundle when switching from N to Z *)
v <- GetOperand src;
SetOperand dst v
| movsx, [dst; src] => (* Move with Sign-Extend *)
v <- GetOperand src;
src_size <- match standalone_operand_size src with
| Some s => ret s
| None => err (error.ambiguous_operation_size instr)
end;
let v := signed src_size v in
SetOperand dst v
| xchg, [a; b] => (* Note: unbundle when switching from N to Z *)
va <- GetOperand a;
vb <- GetOperand b;
Expand Down
5 changes: 5 additions & 0 deletions src/Assembly/WithBedrock/Semantics.v
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,11 @@ Definition DenoteNormalInstruction (st : machine_state) (instr : NormalInstructi
| (mov | movzx | movabs | movdqa | movdqu | movq | movd | movups), [dst; src] => (* Note: unbundle when switching from N to Z *)
v <- DenoteOperand sa s st src;
SetOperand sa s st dst v
| movsx, [dst; src] => (* Move with Sign-Extend *)
v <- DenoteOperand sa s st src;
src_size <- standalone_operand_size src ;
let v := signed src_size v in
SetOperand sa s st dst v
| xchg, [a; b] => (* Flags Affected: None *)
va <- DenoteOperand sa s st a;
vb <- DenoteOperand sa s st b;
Expand Down

0 comments on commit f847700

Please sign in to comment.