Clement Courbet | 44b4c54 | 2018-06-19 11:28:59 +0000 | [diff] [blame] | 1 | //===-- Target.cpp ----------------------------------------------*- C++ -*-===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | #include "../Target.h" |
| 10 | |
Clement Courbet | 6fd00e3 | 2018-06-20 11:54:35 +0000 | [diff] [blame^] | 11 | #include "X86.h" |
| 12 | |
Clement Courbet | 44b4c54 | 2018-06-19 11:28:59 +0000 | [diff] [blame] | 13 | namespace exegesis { |
| 14 | |
| 15 | namespace { |
| 16 | |
| 17 | class ExegesisX86Target : public ExegesisTarget { |
Clement Courbet | 6fd00e3 | 2018-06-20 11:54:35 +0000 | [diff] [blame^] | 18 | void addTargetSpecificPasses(llvm::PassManagerBase &PM) const override { |
| 19 | // Lowers FP pseudo-instructions, e.g. ABS_Fp32 -> ABS_F. |
| 20 | // FIXME: Enable when the exegesis assembler no longer does |
| 21 | // Properties.reset(TracksLiveness); |
| 22 | // PM.add(llvm::createX86FloatingPointStackifierPass()); |
| 23 | } |
| 24 | |
Clement Courbet | 44b4c54 | 2018-06-19 11:28:59 +0000 | [diff] [blame] | 25 | bool matchesArch(llvm::Triple::ArchType Arch) const override { |
| 26 | return Arch == llvm::Triple::x86_64 || Arch == llvm::Triple::x86; |
| 27 | } |
| 28 | }; |
| 29 | |
| 30 | } // namespace |
| 31 | |
| 32 | static ExegesisTarget* getTheExegesisX86Target() { |
| 33 | static ExegesisX86Target Target; |
| 34 | return &Target; |
| 35 | } |
| 36 | |
| 37 | void InitializeX86ExegesisTarget() { |
| 38 | ExegesisTarget::registerTarget(getTheExegesisX86Target()); |
| 39 | } |
| 40 | |
| 41 | } // namespace exegesis |