blob: 826887ea5ebece7fde9fee0ac900aa0e4e132bf7 [file] [log] [blame]
Reed Kotler46090912013-05-10 22:25:39 +00001//===---- Mips16HardFloat.h for Mips16 Hard Float --------===//
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//
10// This file defines a phase which implements part of the floating point
11// interoperability between Mips16 and Mips32 code.
12//
13//===----------------------------------------------------------------------===//
14
15#include "MCTargetDesc/MipsMCTargetDesc.h"
16#include "MipsTargetMachine.h"
17#include "llvm/Pass.h"
18#include "llvm/Target/TargetMachine.h"
19
20
21#ifndef MIPS16HARDFLOAT_H
22#define MIPS16HARDFLOAT_H
23
24using namespace llvm;
25
26namespace llvm {
27
28class Mips16HardFloat : public ModulePass {
29
30public:
31 static char ID;
32
33 Mips16HardFloat(MipsTargetMachine &TM_) : ModulePass(ID),
34 TM(TM_), Subtarget(TM.getSubtarget<MipsSubtarget>()) {
35 }
36
Stephen Hinesdce4a402014-05-29 02:49:00 -070037 const char *getPassName() const override {
Reed Kotler46090912013-05-10 22:25:39 +000038 return "MIPS16 Hard Float Pass";
39 }
40
Stephen Hinesdce4a402014-05-29 02:49:00 -070041 bool runOnModule(Module &M) override;
Reed Kotler46090912013-05-10 22:25:39 +000042
43protected:
44 /// Keep a pointer to the MipsSubtarget around so that we can make the right
45 /// decision when generating code for different targets.
46 const TargetMachine &TM;
47 const MipsSubtarget &Subtarget;
48
49};
50
51ModulePass *createMips16HardFloat(MipsTargetMachine &TM);
52
53}
54#endif