llvm.org GIT mirror llvm / 1c3e47c
Fix a low hanging use of hasRawTextSupport. This also fixes the placement of the function label comment. It was being placed next to the mips16 directive instead of next to the label. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199245 91177308-0d34-0410-b5e6-96231b3b80d8 Rafael Espindola 6 years ago
16 changed file(s) with 100 addition(s) and 67 deletion(s). Raw diff Collapse all Expand all
4646 OS << "\t.set\tnomicromips\n";
4747 }
4848
49 void MipsTargetAsmStreamer::emitDirectiveSetMips16() {
50 OS << "\t.set\tmips16\n";
51 }
52
53 void MipsTargetAsmStreamer::emitDirectiveSetNoMips16() {
54 OS << "\t.set\tnomips16\n";
55 }
56
57 void MipsTargetAsmStreamer::emitDirectiveEnt(const MCSymbol &Symbol) {
58 OS << "\t.ent\t" << Symbol.getName() << '\n';
59 }
60
4961 void MipsTargetAsmStreamer::emitDirectiveAbiCalls() { OS << "\t.abicalls\n"; }
5062 void MipsTargetAsmStreamer::emitDirectiveOptionPic0() {
5163 OS << "\t.option\tpic0\n";
8092 MicroMipsEnabled = false;
8193 }
8294
95 void MipsTargetELFStreamer::emitDirectiveSetMips16() {
96 // FIXME: implement.
97 }
98
99 void MipsTargetELFStreamer::emitDirectiveSetNoMips16() {
100 // FIXME: implement.
101 }
102
103 void MipsTargetELFStreamer::emitDirectiveEnt(const MCSymbol &Symbol) {
104 // FIXME: implement.
105 }
106
83107 void MipsTargetELFStreamer::emitDirectiveAbiCalls() {
84108 MCAssembler &MCA = getStreamer().getAssembler();
85109 unsigned Flags = MCA.getELFHeaderEFlags();
264264 }
265265
266266 void MipsAsmPrinter::EmitFunctionEntryLabel() {
267 MipsTargetStreamer &TS = getTargetStreamer();
267268 if (Subtarget->inMicroMipsMode())
268 getTargetStreamer().emitDirectiveSetMicroMips();
269
270 if (OutStreamer.hasRawTextSupport()) {
271 if (Subtarget->inMips16Mode())
272 OutStreamer.EmitRawText(StringRef("\t.set\tmips16"));
273 else
274 OutStreamer.EmitRawText(StringRef("\t.set\tnomips16"));
275 // leave out until FSF available gas has micromips changes
276 // OutStreamer.EmitRawText(StringRef("\t.set\tnomicromips"));
277 OutStreamer.EmitRawText("\t.ent\t" + Twine(CurrentFnSym->getName()));
278 }
279
269 TS.emitDirectiveSetMicroMips();
270 // leave out until FSF available gas has micromips changes
271 // else
272 // TS.emitDirectiveSetNoMicroMips();
273
274 if (Subtarget->inMips16Mode())
275 TS.emitDirectiveSetMips16();
276 else
277 TS.emitDirectiveSetNoMips16();
278
279 TS.emitDirectiveEnt(*CurrentFnSym);
280280 OutStreamer.EmitLabel(CurrentFnSym);
281281 }
282282
2020 virtual void emitMipsHackELFFlags(unsigned Flags) = 0;
2121 virtual void emitDirectiveSetMicroMips() = 0;
2222 virtual void emitDirectiveSetNoMicroMips() = 0;
23 virtual void emitDirectiveSetMips16() = 0;
24 virtual void emitDirectiveSetNoMips16() = 0;
25 virtual void emitDirectiveEnt(const MCSymbol &Symbol) = 0;
2326 virtual void emitDirectiveAbiCalls() = 0;
2427 virtual void emitDirectiveOptionPic0() = 0;
2528 };
3336 virtual void emitMipsHackELFFlags(unsigned Flags);
3437 virtual void emitDirectiveSetMicroMips();
3538 virtual void emitDirectiveSetNoMicroMips();
39 virtual void emitDirectiveSetMips16();
40 virtual void emitDirectiveSetNoMips16();
41 virtual void emitDirectiveEnt(const MCSymbol &Symbol);
3642 virtual void emitDirectiveAbiCalls();
3743 virtual void emitDirectiveOptionPic0();
3844 };
5157 virtual void emitMipsHackELFFlags(unsigned Flags);
5258 virtual void emitDirectiveSetMicroMips();
5359 virtual void emitDirectiveSetNoMicroMips();
60 virtual void emitDirectiveSetMips16();
61 virtual void emitDirectiveSetNoMips16();
62 virtual void emitDirectiveEnt(const MCSymbol &Symbol);
5463 virtual void emitDirectiveAbiCalls();
5564 virtual void emitDirectiveOptionPic0();
5665 };
99 ret float 1.000000e+00
1010 }
1111
12 ; 32: .set nomips16 # @fv
12 ; 32: .set nomips16
1313 ; 32: .ent fv
1414 ; 32: .set noreorder
1515 ; 32: .set nomacro
2525 ret double 2.000000e+00
2626 }
2727
28 ; 32: .set nomips16 # @dv
28 ; 32: .set nomips16
2929 ; 32: .ent dv
3030 ; 32: .set noreorder
3131 ; 32: .set nomacro
4343 ret void
4444 }
4545
46 ; 32: .set nomips16 # @vf
46 ; 32: .set nomips16
4747 ; 32: .ent vf
4848 ; 32: .set noreorder
4949 ; 32: .set nomacro
6161 ret void
6262 }
6363
64 ; 32: .set nomips16 # @vd
64 ; 32: .set nomips16
6565 ; 32: .ent vd
6666 ; 32: .set noreorder
6767 ; 32: .set nomacro
8282 ret void
8383 }
8484
85 ; 32: .set nomips16 # @foo1
85 ; 32: .set nomips16
8686 ; 32: .ent foo1
8787 ; 32: .set noreorder
8888 ; 32: .set nomacro
101101 }
102102
103103
104 ; 32: .set nomips16 # @foo2
104 ; 32: .set nomips16
105105 ; 32: .ent foo2
106106 ; 32: .set noreorder
107107 ; 32: .set nomacro
119119 ret void
120120 }
121121
122 ; 32: .set nomips16 # @foo3
122 ; 32: .set nomips16
123123 ; 32: .ent foo3
124124 ; 32: .set noreorder
125125 ; 32: .set nomacro
137137 ret void
138138 }
139139
140 ; 32: .set mips16 # @vv
140 ; 32: .set mips16
141141 ; 32: .ent vv
142142
143143 ; 32: save {{.+}}
99 ret void
1010 }
1111
12 ; 32: .set mips16 # @vv
12 ; 32: .set mips16
1313 ; 32: .ent vv
1414
1515 ; 32: save {{.+}}
2222 ret i32 %0
2323 }
2424
25 ; 32: .set mips16 # @iv
25 ; 32: .set mips16
2626 ; 32: .ent iv
2727
2828 ; 32: save {{.+}}
3838 ret void
3939 }
4040
41 ; 32: .set mips16 # @vif
41 ; 32: .set mips16
4242 ; 32: .ent vif
4343
4444 ; 32: save {{.+}}
5151 ret void
5252 }
5353
54 ; 32: .set mips16 # @foo
54 ; 32: .set mips16
5555 ; 32: .ent foo
5656
5757 ; 32: save {{.+}}
6868 ret float 1.000000e+00
6969 }
7070
71 ; 32: .set nomips16 # @fv
71 ; 32: .set nomips16
7272 ; 32: .ent fv
7373 ; 32: .set noreorder
7474 ; 32: .set nomacro
1414 %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([13 x i8]* @.str, i32 0, i32 0))
1515 ret i32 0
1616
17 ; SR: .set mips16 # @main
17 ; SR: .set mips16
1818
1919 ; SR32: .set nomips16
2020 ; SR32: .ent main
55 ret void
66 }
77
8 ; CHECK: .set mips16 # @foo
8 ; CHECK: .set mips16
99 ; CHECK: .ent foo
1010 ; CHECK: jrc $ra
1111 ; CHECK: .end foo
33 entry:
44 ret void
55 }
6 ; 16: .set nomips16 # @foo
6 ; 16: .set nomips16
77 ; 16: .ent foo
88 ; 16: .set noreorder
99 ; 16: .set nomacro
2020 ret void
2121 }
2222
23 ; 16: .set mips16 # @nofoo
23 ; 16: .set mips16
2424 ; 16: .ent nofoo
2525
2626 ; 16: jrc $ra
3131 ret i32 0
3232 }
3333
34 ; 16: .set nomips16 # @main
34 ; 16: .set nomips16
3535 ; 16: .ent main
3636 ; 16: .set noreorder
3737 ; 16: .set nomacro
55 ret void
66 }
77
8 ; 16: .set mips16 # @foo
8 ; 16: .set mips16
99 ; 16: .ent foo
1010 ; 16: jrc $ra
1111 ; 16: .end foo
12 ; 32: .set mips16 # @foo
12 ; 32: .set mips16
1313 ; 32: .ent foo
1414 ; 32: jrc $ra
1515 ; 32: .end foo
1818 ret void
1919 }
2020
21 ; 16: .set nomips16 # @nofoo
21 ; 16: .set nomips16
2222 ; 16: .ent nofoo
2323 ; 16: .set noreorder
2424 ; 16: .set nomacro
2929 ; 16: .set macro
3030 ; 16: .set reorder
3131 ; 16: .end nofoo
32 ; 32: .set nomips16 # @nofoo
32 ; 32: .set nomips16
3333 ; 32: .ent nofoo
3434 ; 32: .set noreorder
3535 ; 32: .set nomacro
4545 ret i32 0
4646 }
4747
48 ; 16: .set mips16 # @main
48 ; 16: .set mips16
4949 ; 16: .ent main
5050 ; 16: jrc $ra
5151 ; 16: .end main
52 ; 32: .set nomips16 # @main
52 ; 32: .set nomips16
5353 ; 32: .ent main
5454 ; 32: .set noreorder
5555 ; 32: .set nomacro
55 ret void
66 }
77
8 ; 16: .set mips16 # @foo
8 ; 16: .set mips16
99 ; 16: .ent foo
1010 ; 16: jrc $ra
1111 ; 16: .end foo
12 ; 32: .set mips16 # @foo
12 ; 32: .set mips16
1313 ; 32: .ent foo
1414 ; 32: jrc $ra
1515 ; 32: .end foo
1818 ret void
1919 }
2020
21 ; 16: .set nomips16 # @nofoo
21 ; 16: .set nomips16
2222 ; 16: .ent nofoo
2323 ; 16: .set noreorder
2424 ; 16: .set nomacro
2929 ; 16: .set macro
3030 ; 16: .set reorder
3131 ; 16: .end nofoo
32 ; 32: .set nomips16 # @nofoo
32 ; 32: .set nomips16
3333 ; 32: .ent nofoo
3434 ; 32: .set noreorder
3535 ; 32: .set nomacro
4545 ret i32 0
4646 }
4747
48 ; 16: .set mips16 # @main
48 ; 16: .set mips16
4949 ; 16: .ent main
5050 ; 16: jrc $ra
5151 ; 16: .end main
52 ; 32: .set mips16 # @main
52 ; 32: .set mips16
5353 ; 32: .ent main
5454 ; 32: jrc $ra
5555 ; 32: .end main
55 ret void
66 }
77
8 ; 16: .set mips16 # @foo
8 ; 16: .set mips16
99 ; 16: .ent foo
1010 ; 16: jrc $ra
1111 ; 16: .end foo
12 ; 32: .set mips16 # @foo
12 ; 32: .set mips16
1313 ; 32: .ent foo
1414 ; 32: jrc $ra
1515 ; 32: .end foo
1818 ret void
1919 }
2020
21 ; 16: .set nomips16 # @nofoo
21 ; 16: .set nomips16
2222 ; 16: .ent nofoo
2323 ; 16: .set noreorder
2424 ; 16: .set nomacro
2929 ; 16: .set macro
3030 ; 16: .set reorder
3131 ; 16: .end nofoo
32 ; 32: .set nomips16 # @nofoo
32 ; 32: .set nomips16
3333 ; 32: .ent nofoo
3434 ; 32: .set noreorder
3535 ; 32: .set nomacro
4545 ret i32 0
4646 }
4747
48 ; 16: .set nomips16 # @main
48 ; 16: .set nomips16
4949 ; 16: .ent main
5050 ; 16: .set noreorder
5151 ; 16: .set nomacro
5757 ; 16: .set reorder
5858 ; 16: .end main
5959
60 ; 32: .set nomips16 # @main
60 ; 32: .set nomips16
6161 ; 32: .ent main
6262 ; 32: .set noreorder
6363 ; 32: .set nomacro
55 ret void
66 }
77
8 ; 16: .set mips16 # @foo
8 ; 16: .set mips16
99 ; 16: .ent foo
1010 ; 16: jrc $ra
1111 ; 16: .end foo
12 ; 32: .set nomips16 # @foo
12 ; 32: .set nomips16
1313 ; 32: .ent foo
1414 ; 32: .set noreorder
1515 ; 32: .set nomacro
2525 ret void
2626 }
2727
28 ; 16: .set nomips16 # @nofoo
28 ; 16: .set nomips16
2929 ; 16: .ent nofoo
3030 ; 16: .set noreorder
3131 ; 16: .set nomacro
3636 ; 16: .set macro
3737 ; 16: .set reorder
3838 ; 16: .end nofoo
39 ; 32: .set nomips16 # @nofoo
39 ; 32: .set nomips16
4040 ; 32: .ent nofoo
4141 ; 32: .set noreorder
4242 ; 32: .set nomacro
5252 ret i32 0
5353 }
5454
55 ; 16: .set nomips16 # @main
55 ; 16: .set nomips16
5656 ; 16: .ent main
5757 ; 16: .set noreorder
5858 ; 16: .set nomacro
6464 ; 16: .set reorder
6565 ; 16: .end main
6666
67 ; 32: .set nomips16 # @main
67 ; 32: .set nomips16
6868 ; 32: .ent main
6969 ; 32: .set noreorder
7070 ; 32: .set nomacro
55 ret void
66 }
77
8 ; 16: .set mips16 # @foo
8 ; 16: .set mips16
99 ; 16: .ent foo
1010 ; 16: jrc $ra
1111 ; 16: .end foo
12 ; 32: .set nomips16 # @foo
12 ; 32: .set nomips16
1313 ; 32: .ent foo
1414 ; 32: .set noreorder
1515 ; 32: .set nomacro
2525 ret void
2626 }
2727
28 ; 16: .set nomips16 # @nofoo
28 ; 16: .set nomips16
2929 ; 16: .ent nofoo
3030 ; 16: .set noreorder
3131 ; 16: .set nomacro
3636 ; 16: .set macro
3737 ; 16: .set reorder
3838 ; 16: .end nofoo
39 ; 32: .set nomips16 # @nofoo
39 ; 32: .set nomips16
4040 ; 32: .ent nofoo
4141 ; 32: .set noreorder
4242 ; 32: .set nomacro
5252 ret i32 0
5353 }
5454
55 ; 16: .set mips16 # @main
55 ; 16: .set mips16
5656 ; 16: .ent main
5757 ; 16: jrc $ra
5858 ; 16: .end main
5959
60 ; 32: .set mips16 # @main
60 ; 32: .set mips16
6161 ; 32: .ent main
6262 ; 32: jrc $ra
6363 ; 32: .end main
1313 ret void
1414 }
1515
16 ; 32: .set mips16 # @foo
16 ; 32: .set mips16
1717 ; 32: .ent foo
1818 ; 32: jrc $ra
1919 ; 32: .end foo
3131 ret void
3232 }
3333
34 ; 32: .set nomips16 # @nofoo
34 ; 32: .set nomips16
3535 ; 32: .ent nofoo
3636 ; 32: .set noreorder
3737 ; 32: .set nomacro
5555 ret i32 0
5656 }
5757
58 ; 32: .set nomips16 # @main
58 ; 32: .set nomips16
5959 ; 32: .ent main
6060 ; 32: .set noreorder
6161 ; 32: .set nomacro
44 ret void
55 }
66
7 ; 32: .set mips16 # @foo
7 ; 32: .set mips16
88 ; 32: .ent foo
99 ; 32: jrc $ra
1010 ; 32: .end foo
1313 ret void
1414 }
1515
16 ; 32: .set nomips16 # @nofoo
16 ; 32: .set nomips16
1717 ; 32: .ent nofoo
1818 ; 32: .set noreorder
1919 ; 32: .set nomacro
2929 ret i32 0
3030 }
3131
32 ; 32: .set mips16 # @main
32 ; 32: .set mips16
3333 ; 32: .ent main
3434 ; 32: jrc $ra
3535 ; 32: .end main
44 entry:
55 ret i32 0
66
7 ; 16: .set mips16 # @main
7 ; 16: .set mips16
88
99
1010 ; 16: jrc $ra