[x64] check sahf correctly
authorweiliang.lin <weiliang.lin@intel.com>
Thu, 4 Dec 2014 10:13:13 +0000 (02:13 -0800)
committerCommit bot <commit-bot@chromium.org>
Thu, 4 Dec 2014 10:13:20 +0000 (10:13 +0000)
BUG=

Review URL: https://codereview.chromium.org/777173002

Cr-Commit-Position: refs/heads/master@{#25653}

src/compiler/x64/code-generator-x64.cc

index 95cd3af..4a96fe8 100644 (file)
@@ -502,7 +502,8 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
       __ fprem();
       // The following 2 instruction implicitly use rax.
       __ fnstsw_ax();
-      if (CpuFeatures::IsSupported(SAHF) && masm()->IsEnabled(SAHF)) {
+      if (CpuFeatures::IsSupported(SAHF)) {
+        CpuFeatureScope sahf_scope(masm(), SAHF);
         __ sahf();
       } else {
         __ shrl(rax, Immediate(8));