This is an archive of the discontinued LLVM Phabricator instance.

[mips] [IAS] Add support for the .module softfloat/hardfloat directives.
ClosedPublic

Authored by tomatabacu on Apr 17 2015, 3:18 AM.

Details

Summary

These directives are used to set the default value of the SoftFloat feature.
They have the same effect as setting -m{soft, hard}-float from the command line.

Diff Detail

Event Timeline

tomatabacu updated this revision to Diff 23906.Apr 17 2015, 3:18 AM
tomatabacu retitled this revision from to [mips] [IAS] Add support for the .module softfloat/hardfloat directives..
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).
mpf added inline comments.Apr 17 2015, 6:05 AM
lib/Target/Mips/MipsTargetStreamer.h
104

This looks fishy, the FPABI should return to whatever hard-float ABI is in force due to other options. I.e. you need to know which fp=32|xx|64 was set and/or if oddspreg is in force and/or if single float is in force.

'Any' is generally used to describe a no-float ABI which is very different from hard-float.

tomatabacu updated this revision to Diff 28230.Jun 23 2015, 5:56 AM

Fixed restoration of previous hardfloat settings:

  • The settings aren't actually changed, it's just that when in soft-float they are ignored.
  • emitDirectiveModule{SoftFloat,HardFloat}() doesn't change the MipsABIFlagsSection data anymore, it only prints it.
  • That data is changed by setting/clearing the soft-float bit in STI.FeatureBits and then calling updateABIInfo().
  • updateABIInfo() uses the update mechanism from MipsABIFlagsSection to properly update.

Changed test to use -mips-abi-flags feature of llvm-readobj.
Made the module-hardfloat.s test more thorough.
Rebased on top of D10641, D10642, and D10643, which fix the other .module directives.

dsanders accepted this revision.Jun 29 2015, 3:12 AM
dsanders edited edge metadata.

@mpf: Should the ODDSPREG flag be clear for softfloat?
@tomatabacu: If Matthew says 'yes', then please add an appropriate CHECK-NOT to module-softfloat.s then it will LGTM. If he says 'no' or "doesn't matter", then LGTM.

This revision is now accepted and ready to land.Jun 29 2015, 3:12 AM
mpf added a comment.Jun 29 2015, 4:08 AM

@mpf: Should the ODDSPREG flag be clear for softfloat?
@tomatabacu: If Matthew says 'yes', then please add an appropriate
CHECK-NOT to module-softfloat.s then it will LGTM. If he says 'no' or
"doesn't matter", then LGTM.

Hoping I can just email a reply...

The flag is undefined for soft-float and since it has 'or' semantics
for merging then it doesn't matter what it is set to for soft-float.
I don't actually know how it will be set for GNU tools and I mask
it out for most assembler tests that are not checking for the flag
specifically.

Matthew

Thanks. In that case LGTM as-is.

This revision was automatically updated to reflect the committed changes.