mirror of
https://github.com/FEX-Emu/FEX.git
synced 2024-12-15 09:59:28 +00:00
IR: add SETF8/SETF16 ir ops
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
This commit is contained in:
parent
cb5644cf81
commit
72edee7c6f
@ -311,6 +311,20 @@ DEF_OP(RmifNZCV) {
|
|||||||
rmif(GetReg(Op->Src.ID()).X(), Op->Rotate, Op->Mask);
|
rmif(GetReg(Op->Src.ID()).X(), Op->Rotate, Op->Mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DEF_OP(SetSmallNZV) {
|
||||||
|
auto Op = IROp->C<IR::IROp_SetSmallNZV>();
|
||||||
|
LOGMAN_THROW_A_FMT(CTX->HostFeatures.SupportsFlagM, "Unsupported flagm op");
|
||||||
|
|
||||||
|
const uint8_t OpSize = IROp->Size;
|
||||||
|
LOGMAN_THROW_AA_FMT(OpSize == 1 || OpSize == 2, "Unsupported {} size: {}", __func__, OpSize);
|
||||||
|
|
||||||
|
if (OpSize == 1) {
|
||||||
|
setf8(GetReg(Op->Src.ID()).W());
|
||||||
|
} else {
|
||||||
|
setf16(GetReg(Op->Src.ID()).W());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
DEF_OP(AXFlag) {
|
DEF_OP(AXFlag) {
|
||||||
LOGMAN_THROW_A_FMT(CTX->HostFeatures.SupportsFlagM2, "Unsupported flagm2 op");
|
LOGMAN_THROW_A_FMT(CTX->HostFeatures.SupportsFlagM2, "Unsupported flagm2 op");
|
||||||
axflag();
|
axflag();
|
||||||
|
@ -992,6 +992,14 @@
|
|||||||
"HasSideEffects": true,
|
"HasSideEffects": true,
|
||||||
"DestSize": "Size"
|
"DestSize": "Size"
|
||||||
},
|
},
|
||||||
|
"SetSmallNZV OpSize:#Size, GPR:$Src": {
|
||||||
|
"Desc": ["Set NZV with a SETF instruction. Preserves CF."],
|
||||||
|
"HasSideEffects": true,
|
||||||
|
"DestSize": "Size",
|
||||||
|
"EmitValidation": [
|
||||||
|
"Size == FEXCore::IR::OpSize::i8Bit || Size == FEXCore::IR::OpSize::i16Bit"
|
||||||
|
]
|
||||||
|
},
|
||||||
"CarryInvert": {
|
"CarryInvert": {
|
||||||
"Desc": ["Invert carry flag in NZCV"],
|
"Desc": ["Invert carry flag in NZCV"],
|
||||||
"HasSideEffects": true
|
"HasSideEffects": true
|
||||||
|
@ -183,6 +183,12 @@ DeadFlagCalculationEliminination::Classify(IROp_Header *IROp)
|
|||||||
.CanEliminate = true,
|
.CanEliminate = true,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
case OP_SETSMALLNZV:
|
||||||
|
return {
|
||||||
|
.Write = FLAG_N | FLAG_Z | FLAG_V,
|
||||||
|
.CanEliminate = true,
|
||||||
|
};
|
||||||
|
|
||||||
case OP_LOADNZCV:
|
case OP_LOADNZCV:
|
||||||
return {.Read = FLAG_NZCV};
|
return {.Read = FLAG_NZCV};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user