Skip to content

Commit

Permalink
Fix flags on imul and shifts
Browse files Browse the repository at this point in the history
  • Loading branch information
tbodt committed May 25, 2018
1 parent 2593132 commit ab81122
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion emu/gadgets-x86/bits.S
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
pushq %rcx
movb (%_ip), %cl
.endif
testb %cl, %cl
testb $(\size - 1), %cl
jz 1f
\type\()l %cl, %_tmp
setf_oc
Expand Down
3 changes: 2 additions & 1 deletion emu/gadgets-x86/math.S
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
btw $0, CPU_cf(%_cpu)
.endifin
\op\ss \arg, %tmp\s
.ifin(\op, add,sub,adc,sbb)
.ifin(\op, add,sub,adc,sbb,imul)
setf_oc
.endifin
.ifin(\op, add,sub,adc,sbb,and,or,xor)
Expand Down Expand Up @@ -147,6 +147,7 @@ do_op_size imul, 32
.endm
.macro do_imul1 size, s, ss
imul\ss %tmp\s
setf_oc
.endm
.macro do_neg size, s, ss
setf_a src=$0 dst=%tmp\s ss=\ss
Expand Down
2 changes: 0 additions & 2 deletions tools/undefined-flags.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ int undefined_flags_mask(int pid, struct cpu_state *cpu) {
shift_count = cpu->cl;
else
pt_readn(pid, ip++, &shift_count, sizeof(shift_count));
if (shift_count % 32 == 0)
return O|P; // please delete this as soon as you can
if (shift_count > 1)
return O;
break;
Expand Down

0 comments on commit ab81122

Please sign in to comment.