Rotate Left/Right xarch instructions don't set ZF and ZF flag.
authorsivarv <sivarv@microsoft.com>
Wed, 2 Nov 2016 00:00:32 +0000 (17:00 -0700)
committersivarv <sivarv@microsoft.com>
Wed, 2 Nov 2016 00:16:43 +0000 (17:16 -0700)
Commit migrated from https://github.com/dotnet/coreclr/commit/b82ba8b2940673d4ca61bc3407eb022e32153e5a

src/coreclr/src/jit/lowerxarch.cpp

index a98cc8e..e7af9f0 100644 (file)
@@ -1176,8 +1176,12 @@ void Lowering::TreeNodeInfoInitShiftRotate(GenTree* tree)
         MakeSrcContained(tree, shiftBy);
     }
 
-    // Codegen of this tree node sets ZF and SF flags.
-    tree->gtFlags |= GTF_ZSF_SET;
+    // Codegen of shift oper sets ZF and SF flags.
+    // Note that Rotate Left/Right instructions don't set ZF and SF flags.
+    if (tree->OperIsShift())
+    {
+        tree->gtFlags |= GTF_ZSF_SET;
+    }
 }
 
 //------------------------------------------------------------------------