@@ -38,16 +38,15 @@ void MipsTargetAsmStreamer::emitMipsHackELFFlags(unsigned Flags) {
38
38
OS.write_hex (Flags);
39
39
OS << ' \n ' ;
40
40
}
41
- void MipsTargetAsmStreamer::emitMipsHackSTOCG (MCSymbol *Sym, unsigned Val) {
42
- if (!PrintHackDirectives)
43
- return ;
44
41
45
- OS << " \t .mips_hack_stocg " ;
46
- OS << Sym->getName ();
47
- OS << " , " ;
48
- OS << Val;
49
- OS << ' \n ' ;
42
+ void MipsTargetAsmStreamer::emitDirectiveSetMicroMips () {
43
+ OS << " \t .set\t micromips\n " ;
44
+ }
45
+
46
+ void MipsTargetAsmStreamer::emitDirectiveSetNoMicroMips () {
47
+ OS << " \t .set\t nomicromips\n " ;
50
48
}
49
+
51
50
void MipsTargetAsmStreamer::emitDirectiveAbiCalls () { OS << " \t .abicalls\n " ; }
52
51
void MipsTargetAsmStreamer::emitDirectiveOptionPic0 () {
53
52
OS << " \t .option\t pic0\n " ;
@@ -56,6 +55,15 @@ void MipsTargetAsmStreamer::emitDirectiveOptionPic0() {
56
55
// This part is for ELF object output.
57
56
MipsTargetELFStreamer::MipsTargetELFStreamer () {}
58
57
58
+ void MipsTargetELFStreamer::emitLabel (MCSymbol *Symbol) {
59
+ MCSymbolData &Data = getStreamer ().getOrCreateSymbolData (Symbol);
60
+ // The "other" values are stored in the last 6 bits of the second byte
61
+ // The traditional defines for STO values assume the full byte and thus
62
+ // the shift to pack it.
63
+ if (isMicroMipsEnabled ())
64
+ MCELF::setOther (Data, ELF::STO_MIPS_MICROMIPS >> 2 );
65
+ }
66
+
59
67
MCELFStreamer &MipsTargetELFStreamer::getStreamer () {
60
68
return static_cast <MCELFStreamer &>(*Streamer);
61
69
}
@@ -65,14 +73,14 @@ void MipsTargetELFStreamer::emitMipsHackELFFlags(unsigned Flags) {
65
73
MCA.setELFHeaderEFlags (Flags);
66
74
}
67
75
68
- // Set a symbol's STO flags.
69
- void MipsTargetELFStreamer::emitMipsHackSTOCG (MCSymbol *Sym, unsigned Val) {
70
- MCSymbolData &Data = getStreamer ().getOrCreateSymbolData (Sym);
71
- // The "other" values are stored in the last 6 bits of the second byte
72
- // The traditional defines for STO values assume the full byte and thus
73
- // the shift to pack it.
74
- MCELF::setOther (Data, Val >> 2 );
76
+ void MipsTargetELFStreamer::emitDirectiveSetMicroMips () {
77
+ MicroMipsEnabled = true ;
78
+ }
79
+
80
+ void MipsTargetELFStreamer::emitDirectiveSetNoMicroMips () {
81
+ MicroMipsEnabled = false ;
75
82
}
83
+
76
84
void MipsTargetELFStreamer::emitDirectiveAbiCalls () {
77
85
MCAssembler &MCA = getStreamer ().getAssembler ();
78
86
unsigned Flags = MCA.getELFHeaderEFlags ();
0 commit comments