2013-10-08 13:08:17 +00:00
|
|
|
//===-- MipsTargetStreamer.h - Mips Target Streamer ------------*- C++ -*--===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef MIPSTARGETSTREAMER_H
|
|
|
|
#define MIPSTARGETSTREAMER_H
|
|
|
|
|
2013-11-18 23:55:27 +00:00
|
|
|
#include "llvm/MC/MCELFStreamer.h"
|
2013-10-08 13:08:17 +00:00
|
|
|
#include "llvm/MC/MCStreamer.h"
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
class MipsTargetStreamer : public MCTargetStreamer {
|
2013-11-18 23:55:27 +00:00
|
|
|
virtual void anchor();
|
2013-11-19 02:01:07 +00:00
|
|
|
|
2013-10-08 13:08:17 +00:00
|
|
|
public:
|
2014-01-26 06:06:37 +00:00
|
|
|
MipsTargetStreamer(MCStreamer &S);
|
2014-01-14 04:25:13 +00:00
|
|
|
virtual void emitDirectiveSetMicroMips() = 0;
|
|
|
|
virtual void emitDirectiveSetNoMicroMips() = 0;
|
2014-01-14 18:57:12 +00:00
|
|
|
virtual void emitDirectiveSetMips16() = 0;
|
|
|
|
virtual void emitDirectiveSetNoMips16() = 0;
|
2014-01-26 05:06:48 +00:00
|
|
|
|
|
|
|
virtual void emitDirectiveSetReorder() = 0;
|
|
|
|
virtual void emitDirectiveSetNoReorder() = 0;
|
|
|
|
virtual void emitDirectiveSetMacro() = 0;
|
|
|
|
virtual void emitDirectiveSetNoMacro() = 0;
|
|
|
|
virtual void emitDirectiveSetAt() = 0;
|
|
|
|
virtual void emitDirectiveSetNoAt() = 0;
|
|
|
|
virtual void emitDirectiveEnd(StringRef Name) = 0;
|
|
|
|
|
2014-01-14 18:57:12 +00:00
|
|
|
virtual void emitDirectiveEnt(const MCSymbol &Symbol) = 0;
|
2014-01-06 23:27:31 +00:00
|
|
|
virtual void emitDirectiveAbiCalls() = 0;
|
|
|
|
virtual void emitDirectiveOptionPic0() = 0;
|
2014-03-26 13:40:29 +00:00
|
|
|
virtual void emitDirectiveOptionPic2() = 0;
|
2014-01-27 03:53:56 +00:00
|
|
|
virtual void emitFrame(unsigned StackReg, unsigned StackSize,
|
|
|
|
unsigned ReturnReg) = 0;
|
2014-01-27 04:33:11 +00:00
|
|
|
virtual void emitMask(unsigned CPUBitmask, int CPUTopSavedRegOff) = 0;
|
|
|
|
virtual void emitFMask(unsigned FPUBitmask, int FPUTopSavedRegOff) = 0;
|
2014-03-04 09:54:09 +00:00
|
|
|
|
|
|
|
virtual void emitDirectiveSetMips32R2() = 0;
|
2014-03-26 15:14:32 +00:00
|
|
|
virtual void emitDirectiveSetMips64() = 0;
|
2014-03-26 14:52:22 +00:00
|
|
|
virtual void emitDirectiveSetMips64R2() = 0;
|
2014-03-05 11:05:09 +00:00
|
|
|
virtual void emitDirectiveSetDsp() = 0;
|
2013-10-08 13:08:17 +00:00
|
|
|
};
|
2013-11-18 23:55:27 +00:00
|
|
|
|
|
|
|
// This part is for ascii assembly output
|
|
|
|
class MipsTargetAsmStreamer : public MipsTargetStreamer {
|
2013-11-19 20:53:28 +00:00
|
|
|
formatted_raw_ostream &OS;
|
|
|
|
|
2013-11-18 23:55:27 +00:00
|
|
|
public:
|
2014-01-26 06:06:37 +00:00
|
|
|
MipsTargetAsmStreamer(MCStreamer &S, formatted_raw_ostream &OS);
|
2014-01-14 04:25:13 +00:00
|
|
|
virtual void emitDirectiveSetMicroMips();
|
|
|
|
virtual void emitDirectiveSetNoMicroMips();
|
2014-01-14 18:57:12 +00:00
|
|
|
virtual void emitDirectiveSetMips16();
|
|
|
|
virtual void emitDirectiveSetNoMips16();
|
2014-01-26 05:06:48 +00:00
|
|
|
|
|
|
|
virtual void emitDirectiveSetReorder();
|
|
|
|
virtual void emitDirectiveSetNoReorder();
|
|
|
|
virtual void emitDirectiveSetMacro();
|
|
|
|
virtual void emitDirectiveSetNoMacro();
|
|
|
|
virtual void emitDirectiveSetAt();
|
|
|
|
virtual void emitDirectiveSetNoAt();
|
|
|
|
virtual void emitDirectiveEnd(StringRef Name);
|
|
|
|
|
2014-01-14 18:57:12 +00:00
|
|
|
virtual void emitDirectiveEnt(const MCSymbol &Symbol);
|
2014-01-06 23:27:31 +00:00
|
|
|
virtual void emitDirectiveAbiCalls();
|
|
|
|
virtual void emitDirectiveOptionPic0();
|
2014-03-26 13:40:29 +00:00
|
|
|
virtual void emitDirectiveOptionPic2();
|
2014-01-27 03:53:56 +00:00
|
|
|
virtual void emitFrame(unsigned StackReg, unsigned StackSize,
|
|
|
|
unsigned ReturnReg);
|
2014-01-27 04:33:11 +00:00
|
|
|
virtual void emitMask(unsigned CPUBitmask, int CPUTopSavedRegOff);
|
|
|
|
virtual void emitFMask(unsigned FPUBitmask, int FPUTopSavedRegOff);
|
2014-03-04 09:54:09 +00:00
|
|
|
|
|
|
|
virtual void emitDirectiveSetMips32R2();
|
2014-03-26 15:14:32 +00:00
|
|
|
virtual void emitDirectiveSetMips64();
|
2014-03-26 14:52:22 +00:00
|
|
|
virtual void emitDirectiveSetMips64R2();
|
2014-03-05 11:05:09 +00:00
|
|
|
virtual void emitDirectiveSetDsp();
|
2013-11-18 23:55:27 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// This part is for ELF object output
|
|
|
|
class MipsTargetELFStreamer : public MipsTargetStreamer {
|
2014-01-14 04:25:13 +00:00
|
|
|
bool MicroMipsEnabled;
|
2014-01-31 23:10:26 +00:00
|
|
|
const MCSubtargetInfo &STI;
|
2014-03-26 13:40:29 +00:00
|
|
|
bool Pic;
|
2014-01-22 23:08:42 +00:00
|
|
|
|
2013-11-18 23:55:27 +00:00
|
|
|
public:
|
2014-01-14 04:25:13 +00:00
|
|
|
bool isMicroMipsEnabled() const { return MicroMipsEnabled; }
|
2013-11-18 23:55:27 +00:00
|
|
|
MCELFStreamer &getStreamer();
|
2014-01-26 06:57:13 +00:00
|
|
|
MipsTargetELFStreamer(MCStreamer &S, const MCSubtargetInfo &STI);
|
2014-01-14 04:25:13 +00:00
|
|
|
|
2014-03-02 09:09:27 +00:00
|
|
|
virtual void emitLabel(MCSymbol *Symbol) override;
|
2014-03-20 09:44:49 +00:00
|
|
|
virtual void emitAssignment(MCSymbol *Symbol, const MCExpr *Value) override;
|
2014-03-02 09:09:27 +00:00
|
|
|
void finish() override;
|
2014-01-14 04:25:13 +00:00
|
|
|
|
|
|
|
virtual void emitDirectiveSetMicroMips();
|
|
|
|
virtual void emitDirectiveSetNoMicroMips();
|
2014-01-14 18:57:12 +00:00
|
|
|
virtual void emitDirectiveSetMips16();
|
|
|
|
virtual void emitDirectiveSetNoMips16();
|
2014-01-26 05:06:48 +00:00
|
|
|
|
|
|
|
virtual void emitDirectiveSetReorder();
|
|
|
|
virtual void emitDirectiveSetNoReorder();
|
|
|
|
virtual void emitDirectiveSetMacro();
|
|
|
|
virtual void emitDirectiveSetNoMacro();
|
|
|
|
virtual void emitDirectiveSetAt();
|
|
|
|
virtual void emitDirectiveSetNoAt();
|
|
|
|
virtual void emitDirectiveEnd(StringRef Name);
|
|
|
|
|
2014-01-14 18:57:12 +00:00
|
|
|
virtual void emitDirectiveEnt(const MCSymbol &Symbol);
|
2014-01-06 23:27:31 +00:00
|
|
|
virtual void emitDirectiveAbiCalls();
|
|
|
|
virtual void emitDirectiveOptionPic0();
|
2014-03-26 13:40:29 +00:00
|
|
|
virtual void emitDirectiveOptionPic2();
|
2014-01-27 03:53:56 +00:00
|
|
|
virtual void emitFrame(unsigned StackReg, unsigned StackSize,
|
|
|
|
unsigned ReturnReg);
|
2014-01-27 04:33:11 +00:00
|
|
|
virtual void emitMask(unsigned CPUBitmask, int CPUTopSavedRegOff);
|
|
|
|
virtual void emitFMask(unsigned FPUBitmask, int FPUTopSavedRegOff);
|
2014-03-04 09:54:09 +00:00
|
|
|
|
|
|
|
virtual void emitDirectiveSetMips32R2();
|
2014-03-26 15:14:32 +00:00
|
|
|
virtual void emitDirectiveSetMips64();
|
2014-03-26 14:52:22 +00:00
|
|
|
virtual void emitDirectiveSetMips64R2();
|
2014-03-05 11:05:09 +00:00
|
|
|
virtual void emitDirectiveSetDsp();
|
2013-11-18 23:55:27 +00:00
|
|
|
};
|
2013-10-08 13:08:17 +00:00
|
|
|
}
|
|
|
|
#endif
|