]> granicus.if.org Git - llvm/commitdiff
Move commentary on opcode translation for code16 mov instructions
authorEric Christopher <echristo@gmail.com>
Fri, 14 Jun 2019 04:51:55 +0000 (04:51 +0000)
committerEric Christopher <echristo@gmail.com>
Fri, 14 Jun 2019 04:51:55 +0000 (04:51 +0000)
to segment registers closer to the segment register check for when
we add further optimizations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363355 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/AsmParser/X86AsmParser.cpp

index 8387b9549c1682ea784feedeb3a8a45f28ed816e..95cbf46d37ed69779809adfe3d4af99035e9f11b 100644 (file)
@@ -2678,13 +2678,13 @@ bool X86AsmParser::ParseInstruction(ParseInstructionInfo &Info, StringRef Name,
     static_cast<X86Operand &>(*Operands[0]).setTokenValue(Repl);
   }
 
-  // Moving a 32 or 16 bit value into a segment register has the same
-  // behavior. Modify such instructions to always take shorter form.
   if ((Name == "mov" || Name == "movw" || Name == "movl") &&
       (Operands.size() == 3)) {
     X86Operand &Op1 = (X86Operand &)*Operands[1];
     X86Operand &Op2 = (X86Operand &)*Operands[2];
     SMLoc Loc = Op1.getEndLoc();
+    // Moving a 32 or 16 bit value into a segment register has the same
+    // behavior. Modify such instructions to always take shorter form.
     if (Op1.isReg() && Op2.isReg() &&
         X86MCRegisterClasses[X86::SEGMENT_REGRegClassID].contains(
             Op2.getReg()) &&