This is an archive of the discontinued LLVM Phabricator instance.

[mips] [IAS] Refactor the emitDirectiveModuleFP() functions. NFC.
ClosedPublic

Authored by tomatabacu on Jun 23 2015, 2:41 AM.

Details

Summary

Simplify emitDirectiveModuleFP() by having it just print the current information
from MipsABIFlagsSection and doing an updateABIInfo() before such calls.

This prevents us from forgetting to update the STI.FeatureBits,
because updateABIInfo() uses those to update the MipsABIFlagsSection object,
and also makes sure we use the update mechanism from MipsABIFlagsSection.

Diff Detail

Event Timeline

tomatabacu updated this revision to Diff 28211.Jun 23 2015, 2:41 AM
tomatabacu retitled this revision from to [mips] [IAS] Refactor the emitDirectiveModuleFP() functions..
tomatabacu updated this object.
tomatabacu edited the test plan for this revision. (Show Details)
tomatabacu added a reviewer: dsanders.
tomatabacu added subscribers: mpf, Unknown Object (MLST).
tomatabacu added inline comments.Jun 23 2015, 2:45 AM
lib/Target/Mips/MipsTargetStreamer.h
87

This is an intentional newline, for a better visual separation of the functions.
I won't really mind if you want it removed, though.

dsanders accepted this revision.Jun 23 2015, 7:02 AM
dsanders edited edge metadata.

LGTM with an appropriate commit message. This is really a non-functional change (see below).

However, it looks like we weren't changing the STI.FeatureBits at all before. That doesn't seem right to me.

It's probably best to update the feature bits for the sake of consistency with other .module directives but for FPXX it doesn't really matter to the assembler at the moment. The only assembler level effect of FPXX on IAS is a bit in the ABI flags section. That said, we will want the odd-numbered register warning at some point which will probably need the FPXX flag to be correct.

The fp64 bit is more important since it may select the wrong instruction at the moment. However, despite picking the wrong instruction, it will still get the correct encoding/relocs.

Overall, I think we should update these bits even though the effect is currently non-functional.

This might need a test case, but I don't know what to put in it, as I'm not very knowledgeable about fpxx.
I would appreciate some help with this. I was thinking of something like this:

Set -mfp32 on the command line.
Use .module fp=xx.
At this point, we should be in fpxx mode, but actually we're still in fp32 mode, because we didn't change the STI.FeatureBits, we just updated the flags information.

test/MC/Mips/mips_abi_flags_xx.s covers this.

This revision is now accepted and ready to land.Jun 23 2015, 7:02 AM

That said, we will want the odd-numbered register warning at some point which will probably need the FPXX flag to be correct.

Sorry, I forgot that we already have this warning. It's driven by the nooddspreg flag.

tomatabacu retitled this revision from [mips] [IAS] Refactor the emitDirectiveModuleFP() functions. to [mips] [IAS] Refactor the emitDirectiveModuleFP() functions. NFC..Jun 25 2015, 4:12 AM
tomatabacu updated this object.
tomatabacu edited edge metadata.
tomatabacu closed this revision.Jun 25 2015, 5:44 AM