| OLD | NEW |
| 1 //===-- X86MCInstLower.cpp - Convert X86 MachineInstr to an MCInst --------===// | 1 //===-- X86MCInstLower.cpp - Convert X86 MachineInstr to an MCInst --------===// |
| 2 // | 2 // |
| 3 // The LLVM Compiler Infrastructure | 3 // The LLVM Compiler Infrastructure |
| 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 contains code to lower X86 MachineInstrs to their corresponding | 10 // This file contains code to lower X86 MachineInstrs to their corresponding |
| (...skipping 880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 891 // This is a pseudo op for a two instruction sequence with a label, which | 891 // This is a pseudo op for a two instruction sequence with a label, which |
| 892 // looks like: | 892 // looks like: |
| 893 // call "L1$pb" | 893 // call "L1$pb" |
| 894 // "L1$pb": | 894 // "L1$pb": |
| 895 // popl %esi | 895 // popl %esi |
| 896 | 896 |
| 897 // Emit the call. | 897 // Emit the call. |
| 898 MCSymbol *PICBase = MF->getPICBaseSymbol(); | 898 MCSymbol *PICBase = MF->getPICBaseSymbol(); |
| 899 // FIXME: We would like an efficient form for this, so we don't have to do a | 899 // FIXME: We would like an efficient form for this, so we don't have to do a |
| 900 // lot of extra uniquing. | 900 // lot of extra uniquing. |
| 901 // LOCALMOD: For NaCl, the call should be aligned to the end of a bundle. Si
nce the | 901 OutStreamer.EmitInstruction(MCInstBuilder(X86::CALLpcrel32) |
| 902 // call is at the end of the bundle, there should be no padding between | |
| 903 // the call and the next instruction (the label should still make sense). | |
| 904 | |
| 905 OutStreamer.EmitInstruction(MCInstBuilder( | |
| 906 getSubtarget().isTargetNaCl() ? X86::NACL_CALL32d : X86::CALLpcrel32) //
@LOCALMOD | |
| 907 .addExpr(MCSymbolRefExpr::Create(PICBase, OutContext))); | 902 .addExpr(MCSymbolRefExpr::Create(PICBase, OutContext))); |
| 908 | 903 |
| 909 // Emit the label. | 904 // Emit the label. |
| 910 OutStreamer.EmitLabel(PICBase); | 905 OutStreamer.EmitLabel(PICBase); |
| 911 | 906 |
| 912 // popl $reg | 907 // popl $reg |
| 913 OutStreamer.EmitInstruction(MCInstBuilder(X86::POP32r) | 908 OutStreamer.EmitInstruction(MCInstBuilder(X86::POP32r) |
| 914 .addReg(MI->getOperand(0).getReg())); | 909 .addReg(MI->getOperand(0).getReg())); |
| 915 return; | 910 return; |
| 916 } | 911 } |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 964 OutStreamer.EmitInstruction(MCInstBuilder(X86::MOV64rr) | 959 OutStreamer.EmitInstruction(MCInstBuilder(X86::MOV64rr) |
| 965 .addReg(X86::R10) | 960 .addReg(X86::R10) |
| 966 .addReg(X86::RAX)); | 961 .addReg(X86::RAX)); |
| 967 return; | 962 return; |
| 968 } | 963 } |
| 969 | 964 |
| 970 MCInst TmpInst; | 965 MCInst TmpInst; |
| 971 MCInstLowering.Lower(MI, TmpInst); | 966 MCInstLowering.Lower(MI, TmpInst); |
| 972 OutStreamer.EmitInstruction(TmpInst); | 967 OutStreamer.EmitInstruction(TmpInst); |
| 973 } | 968 } |
| OLD | NEW |