OLD | NEW |
1 //===- subzero/src/IceInstX8632.cpp - X86-32 instruction implementation ---===// | 1 //===- subzero/src/IceInstX8632.cpp - X86-32 instruction implementation ---===// |
2 // | 2 // |
3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 // | 9 // |
10 // This file implements the InstX8632 and OperandX8632 classes, | 10 // This file implements the InstX8632 and OperandX8632 classes, |
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 Asm->jmp(RegX8632::getEncodedGPR(Var->getRegNum())); | 473 Asm->jmp(RegX8632::getEncodedGPR(Var->getRegNum())); |
474 } else { | 474 } else { |
475 // The jmp instruction with a memory operand should be possible | 475 // The jmp instruction with a memory operand should be possible |
476 // to encode, but it isn't a valid sandboxed instruction, and | 476 // to encode, but it isn't a valid sandboxed instruction, and |
477 // there shouldn't be a register allocation issue to jump | 477 // there shouldn't be a register allocation issue to jump |
478 // through a scratch register, so we don't really need to bother | 478 // through a scratch register, so we don't really need to bother |
479 // implementing it. | 479 // implementing it. |
480 llvm::report_fatal_error("Assembler can't jmp to memory operand"); | 480 llvm::report_fatal_error("Assembler can't jmp to memory operand"); |
481 } | 481 } |
482 } else if (const auto Mem = llvm::dyn_cast<OperandX8632Mem>(Target)) { | 482 } else if (const auto Mem = llvm::dyn_cast<OperandX8632Mem>(Target)) { |
| 483 (void)Mem; |
483 assert(Mem->getSegmentRegister() == OperandX8632Mem::DefaultSegment); | 484 assert(Mem->getSegmentRegister() == OperandX8632Mem::DefaultSegment); |
484 llvm::report_fatal_error("Assembler can't jmp to memory operand"); | 485 llvm::report_fatal_error("Assembler can't jmp to memory operand"); |
485 } else if (const auto CR = llvm::dyn_cast<ConstantRelocatable>(Target)) { | 486 } else if (const auto CR = llvm::dyn_cast<ConstantRelocatable>(Target)) { |
486 assert(CR->getOffset() == 0 && "We only support jumping to a function"); | 487 assert(CR->getOffset() == 0 && "We only support jumping to a function"); |
487 Asm->jmp(CR); | 488 Asm->jmp(CR); |
488 } else if (const auto Imm = llvm::dyn_cast<ConstantInteger32>(Target)) { | 489 } else if (const auto Imm = llvm::dyn_cast<ConstantInteger32>(Target)) { |
489 // NaCl trampoline calls refer to an address within the sandbox directly. | 490 // NaCl trampoline calls refer to an address within the sandbox directly. |
490 // This is usually only needed for non-IRT builds and otherwise not | 491 // This is usually only needed for non-IRT builds and otherwise not |
491 // very portable or stable. For this, we would use the 0xE8 opcode | 492 // very portable or stable. For this, we would use the 0xE8 opcode |
492 // (relative version of call) and there should be a PC32 reloc too. | 493 // (relative version of call) and there should be a PC32 reloc too. |
(...skipping 2452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2945 } | 2946 } |
2946 Str << "("; | 2947 Str << "("; |
2947 if (Func) | 2948 if (Func) |
2948 Var->dump(Func); | 2949 Var->dump(Func); |
2949 else | 2950 else |
2950 Var->dump(Str); | 2951 Var->dump(Str); |
2951 Str << ")"; | 2952 Str << ")"; |
2952 } | 2953 } |
2953 | 2954 |
2954 } // end of namespace Ice | 2955 } // end of namespace Ice |
OLD | NEW |