| OLD | NEW |
| 1 //===-- SystemZMCTargetDesc.cpp - SystemZ target descriptions -------------===// | 1 //===-- SystemZMCTargetDesc.cpp - SystemZ target descriptions -------------===// |
| 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 #include "SystemZMCTargetDesc.h" | 10 #include "SystemZMCTargetDesc.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 static MCSubtargetInfo *createSystemZMCSubtargetInfo(StringRef TT, | 50 static MCSubtargetInfo *createSystemZMCSubtargetInfo(StringRef TT, |
| 51 StringRef CPU, | 51 StringRef CPU, |
| 52 StringRef FS) { | 52 StringRef FS) { |
| 53 MCSubtargetInfo *X = new MCSubtargetInfo(); | 53 MCSubtargetInfo *X = new MCSubtargetInfo(); |
| 54 InitSystemZMCSubtargetInfo(X, TT, CPU, FS); | 54 InitSystemZMCSubtargetInfo(X, TT, CPU, FS); |
| 55 return X; | 55 return X; |
| 56 } | 56 } |
| 57 | 57 |
| 58 static MCCodeGenInfo *createSystemZMCCodeGenInfo(StringRef TT, Reloc::Model RM, | 58 static MCCodeGenInfo *createSystemZMCCodeGenInfo(StringRef TT, Reloc::Model RM, |
| 59 CodeModel::Model CM, | 59 CodeModel::Model CM, |
| 60 CodeGenOpt::Level OL) { | 60 CodeGenOpt::Level) { |
| 61 MCCodeGenInfo *X = new MCCodeGenInfo(); | 61 MCCodeGenInfo *X = new MCCodeGenInfo(); |
| 62 | 62 |
| 63 // Static code is suitable for use in a dynamic executable; there is no | 63 // Static code is suitable for use in a dynamic executable; there is no |
| 64 // separate DynamicNoPIC model. | 64 // separate DynamicNoPIC model. |
| 65 if (RM == Reloc::Default || RM == Reloc::DynamicNoPIC) | 65 if (RM == Reloc::Default || RM == Reloc::DynamicNoPIC) |
| 66 RM = Reloc::Static; | 66 RM = Reloc::Static; |
| 67 | 67 |
| 68 // For SystemZ we define the models as follows: | 68 // For SystemZ we define the models as follows: |
| 69 // | 69 // |
| 70 // Small: BRASL can call any function and will use a stub if necessary. | 70 // Small: BRASL can call any function and will use a stub if necessary. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 91 // | 91 // |
| 92 // - When creating JIT code, stubs will be in range of BRASL if the | 92 // - When creating JIT code, stubs will be in range of BRASL if the |
| 93 // image is less than 4GB in size. GOT entries will likewise be | 93 // image is less than 4GB in size. GOT entries will likewise be |
| 94 // in range of LARL. However, the JIT environment has no equivalent | 94 // in range of LARL. However, the JIT environment has no equivalent |
| 95 // of copy relocs, so locally-binding data symbols might not be in | 95 // of copy relocs, so locally-binding data symbols might not be in |
| 96 // the range of LARL. We need the Medium model in that case. | 96 // the range of LARL. We need the Medium model in that case. |
| 97 if (CM == CodeModel::Default) | 97 if (CM == CodeModel::Default) |
| 98 CM = CodeModel::Small; | 98 CM = CodeModel::Small; |
| 99 else if (CM == CodeModel::JITDefault) | 99 else if (CM == CodeModel::JITDefault) |
| 100 CM = RM == Reloc::PIC_ ? CodeModel::Small : CodeModel::Medium; | 100 CM = RM == Reloc::PIC_ ? CodeModel::Small : CodeModel::Medium; |
| 101 X->InitMCCodeGenInfo(RM, CM, OL); | 101 X->InitMCCodeGenInfo(RM, CM); |
| 102 return X; | 102 return X; |
| 103 } | 103 } |
| 104 | 104 |
| 105 static MCInstPrinter *createSystemZMCInstPrinter(const Target &T, | 105 static MCInstPrinter *createSystemZMCInstPrinter(const Target &T, |
| 106 unsigned SyntaxVariant, | 106 unsigned SyntaxVariant, |
| 107 const MCAsmInfo &MAI, | 107 const MCAsmInfo &MAI, |
| 108 const MCInstrInfo &MII, | 108 const MCInstrInfo &MII, |
| 109 const MCRegisterInfo &MRI, | 109 const MCRegisterInfo &MRI, |
| 110 const MCSubtargetInfo &STI) { | 110 const MCSubtargetInfo &STI) { |
| 111 return new SystemZInstPrinter(MAI, MII, MRI); | 111 return new SystemZInstPrinter(MAI, MII, MRI); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 createSystemZMCAsmBackend); | 151 createSystemZMCAsmBackend); |
| 152 | 152 |
| 153 // Register the MCInstPrinter. | 153 // Register the MCInstPrinter. |
| 154 TargetRegistry::RegisterMCInstPrinter(TheSystemZTarget, | 154 TargetRegistry::RegisterMCInstPrinter(TheSystemZTarget, |
| 155 createSystemZMCInstPrinter); | 155 createSystemZMCInstPrinter); |
| 156 | 156 |
| 157 // Register the MCObjectStreamer; | 157 // Register the MCObjectStreamer; |
| 158 TargetRegistry::RegisterMCObjectStreamer(TheSystemZTarget, | 158 TargetRegistry::RegisterMCObjectStreamer(TheSystemZTarget, |
| 159 createSystemZMCObjectStreamer); | 159 createSystemZMCObjectStreamer); |
| 160 } | 160 } |
| OLD | NEW |