OpcodeDispatcher: optimize rotate flags

introduce an IR op for it so we can reason about flags across rotate
instructions easily.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
This commit is contained in:
Alyssa Rosenzweig committed 2024-08-19 10:40:53 -04:00
1 parent e06b3a4186
commit 7de6a5cb07
4 files changed
+102 -47

No files matched your search

@@ -165,6 +165,14 @@ FlagInfo DeadFlagCalculationEliminination::Classify(IROp_Header* IROp) {
.CanEliminate = true,
};
case OP_ROTATEFLAGS:
// _RotateFlags conditionally sets CV, again modeled as RMW.
return {
.Read = FLAG_C | FLAG_V,
.Write = FLAG_C | FLAG_V,
.CanEliminate = true,
};
case OP_RDRAND: return {.Write = FLAG_NZCV};
case OP_ADDNZCV: