Skip to content

Commit 4f54348

Browse files
committed
Add pollution for mul, div, imul, idiv, and cpuid
1 parent 4311121 commit 4f54348

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

source/fern/x86.d

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,8 @@ public enum OpCode : ubyte
179179
FSUBR,
180180
FSUBRP,
181181
FISUBR,
182-
FCMOV
182+
FCMOV,
183+
SBB,
183184
}
184185

185186
public enum Detail
@@ -363,10 +364,6 @@ final:
363364
{
364365
case ADD:
365366
case SUB:
366-
case MUL:
367-
case DIV:
368-
case IMUL:
369-
case IDIV:
370367
case ROL:
371368
case ROR:
372369
case SHL:
@@ -384,6 +381,12 @@ final:
384381
case TEST:
385382
detail = Detail.READ1 | Detail.READ2;
386383
break;
384+
case MUL:
385+
case DIV:
386+
case IMUL:
387+
case IDIV:
388+
detail = Detail.READ1 | Detail.READ2 | POLLUTE_AX | POLLUTE_DX;
389+
break;
387390
case NOT:
388391
case NEG:
389392
case PUSH:
@@ -408,6 +411,10 @@ final:
408411
case LEA:
409412
detail = Detail.WRITE1 | Detail.READ2;
410413
break;
414+
case CPUID:
415+
// Reads from EAX, which I'm considering pollution.
416+
detail = POLLUTE_AX;
417+
break;
411418
default:
412419
break;
413420
}

0 commit comments

Comments
 (0)