From 4f54348d6e7d5401b8fa24f92c6aeab65ea492d3 Mon Sep 17 00:00:00 2001 From: cetio Date: Thu, 25 Apr 2024 14:50:33 -0400 Subject: [PATCH] Add pollution for mul, div, imul, idiv, and cpuid --- source/fern/x86.d | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/source/fern/x86.d b/source/fern/x86.d index fc0d465..e45c100 100644 --- a/source/fern/x86.d +++ b/source/fern/x86.d @@ -179,7 +179,8 @@ public enum OpCode : ubyte FSUBR, FSUBRP, FISUBR, - FCMOV + FCMOV, + SBB, } public enum Detail @@ -363,10 +364,6 @@ final: { case ADD: case SUB: - case MUL: - case DIV: - case IMUL: - case IDIV: case ROL: case ROR: case SHL: @@ -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: @@ -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; }