From 50786d399b8aa90febec2ddb8e423d61f8842f55 Mon Sep 17 00:00:00 2001 From: Kunal Pathak Date: Fri, 2 Dec 2022 12:59:48 -0800 Subject: [PATCH 1/2] Map fmt for mov instruction --- src/coreclr/jit/emitxarch.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/coreclr/jit/emitxarch.cpp b/src/coreclr/jit/emitxarch.cpp index 6d654f115ff48..f6168a193cc5f 100644 --- a/src/coreclr/jit/emitxarch.cpp +++ b/src/coreclr/jit/emitxarch.cpp @@ -4010,6 +4010,15 @@ void emitter::emitIns(instruction ins, emitAttr attr) // emitter::insFormat emitter::emitMapFmtForIns(insFormat fmt, instruction ins) { + if (IsMovInstruction(ins)) + { + // A `mov` instruction is always "write" + // and not "read/write". + if (fmt == IF_RRW_ARD) + { + return IF_RWR_ARD; + } + } switch (ins) { case INS_rol_N: @@ -4034,7 +4043,6 @@ emitter::insFormat emitter::emitMapFmtForIns(insFormat fmt, instruction ins) unreached(); } } - default: return fmt; } From 7e604f1cc05387ba061db613c17372626961b815 Mon Sep 17 00:00:00 2001 From: Kunal Pathak Date: Fri, 2 Dec 2022 13:15:01 -0800 Subject: [PATCH 2/2] Move it to default --- src/coreclr/jit/emitxarch.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/coreclr/jit/emitxarch.cpp b/src/coreclr/jit/emitxarch.cpp index f6168a193cc5f..f7b9df9f0c02c 100644 --- a/src/coreclr/jit/emitxarch.cpp +++ b/src/coreclr/jit/emitxarch.cpp @@ -4010,15 +4010,6 @@ void emitter::emitIns(instruction ins, emitAttr attr) // emitter::insFormat emitter::emitMapFmtForIns(insFormat fmt, instruction ins) { - if (IsMovInstruction(ins)) - { - // A `mov` instruction is always "write" - // and not "read/write". - if (fmt == IF_RRW_ARD) - { - return IF_RWR_ARD; - } - } switch (ins) { case INS_rol_N: @@ -4044,6 +4035,15 @@ emitter::insFormat emitter::emitMapFmtForIns(insFormat fmt, instruction ins) } } default: + if (IsMovInstruction(ins)) + { + // A `mov` instruction is always "write" + // and not "read/write". + if (fmt == IF_RRW_ARD) + { + return IF_RWR_ARD; + } + } return fmt; } }