Skip to content

Commit f847700

Browse files
committed
WIP on movsx
1 parent 11b2302 commit f847700

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/Assembly/Symbolic.v

+8
Original file line numberDiff line numberDiff line change
@@ -4202,6 +4202,14 @@ Definition SymexNormalInstruction {opts : symbolic_options_computed_opt} {descr:
42024202
| (mov | movzx | movabs | movdqa | movdqu | movq | movd | movups), [dst; src] => (* Note: unbundle when switching from N to Z *)
42034203
v <- GetOperand src;
42044204
SetOperand dst v
4205+
| movsx, [dst; src] => (* Move with Sign-Extend *)
4206+
v <- GetOperand src;
4207+
src_size <- match standalone_operand_size src with
4208+
| Some s => ret s
4209+
| None => err (error.ambiguous_operation_size instr)
4210+
end;
4211+
let v := signed src_size v in
4212+
SetOperand dst v
42054213
| xchg, [a; b] => (* Note: unbundle when switching from N to Z *)
42064214
va <- GetOperand a;
42074215
vb <- GetOperand b;

src/Assembly/WithBedrock/Semantics.v

+5
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,11 @@ Definition DenoteNormalInstruction (st : machine_state) (instr : NormalInstructi
168168
| (mov | movzx | movabs | movdqa | movdqu | movq | movd | movups), [dst; src] => (* Note: unbundle when switching from N to Z *)
169169
v <- DenoteOperand sa s st src;
170170
SetOperand sa s st dst v
171+
| movsx, [dst; src] => (* Move with Sign-Extend *)
172+
v <- DenoteOperand sa s st src;
173+
src_size <- standalone_operand_size src ;
174+
let v := signed src_size v in
175+
SetOperand sa s st dst v
171176
| xchg, [a; b] => (* Flags Affected: None *)
172177
va <- DenoteOperand sa s st a;
173178
vb <- DenoteOperand sa s st b;

0 commit comments

Comments
 (0)