Skip to content

Commit

Permalink
Add pollution for mul, div, imul, idiv, and cpuid
Browse files Browse the repository at this point in the history
  • Loading branch information
cetio committed Apr 25, 2024
1 parent 4311121 commit 4f54348
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions source/fern/x86.d
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ public enum OpCode : ubyte
FSUBR,
FSUBRP,
FISUBR,
FCMOV
FCMOV,
SBB,
}

public enum Detail
Expand Down Expand Up @@ -363,10 +364,6 @@ final:
{
case ADD:
case SUB:
case MUL:
case DIV:
case IMUL:
case IDIV:
case ROL:
case ROR:
case SHL:
Expand All @@ -384,6 +381,12 @@ final:
case TEST:
detail = Detail.READ1 | Detail.READ2;
break;
case MUL:
case DIV:
case IMUL:
case IDIV:
detail = Detail.READ1 | Detail.READ2 | POLLUTE_AX | POLLUTE_DX;
break;
case NOT:
case NEG:
case PUSH:
Expand All @@ -408,6 +411,10 @@ final:
case LEA:
detail = Detail.WRITE1 | Detail.READ2;
break;
case CPUID:
// Reads from EAX, which I'm considering pollution.
detail = POLLUTE_AX;
break;
default:
break;
}
Expand Down

0 comments on commit 4f54348

Please sign in to comment.