Added a unique register metadata to asmjit's instruction database

This commit is contained in:
kobalicek
2023-04-26 22:00:56 +02:00
parent 4163483b36
commit 5635cf463a
6 changed files with 133 additions and 93 deletions

View File

@@ -2193,15 +2193,30 @@ class InstRWInfoTable extends core.Task {
if (op.consecutiveLeadCount)
d.clc = op.consecutiveLeadCount;
const instName = dbInst.name;
// NOTE: Avoid push/pop here as PUSH/POP has many variations for segment registers,
// which would set 'd.fixed' field even for GP variation of the instuction.
if (dbInst.name !== "push" && dbInst.name !== "pop") {
if (instName !== "push" && instName !== "pop") {
if (op.isReg())
d.fixed = GenUtils.fixedRegOf(op.reg);
else
d.fixed = GenUtils.fixedRegOf(op.mem);
}
switch (instName) {
case "vfcmaddcph":
case "vfmaddcph":
case "vfcmaddcsh":
case "vfmaddcsh":
case "vfcmulcsh":
case "vfmulcsh":
case "vfcmulcph":
case "vfmulcph":
if (j === 0)
d.flags.Unique = true;
break;
}
if (op.zext)
d.flags.ZExt = true;