[PATCH] [mips] Add assembler support for '.set mipsX'.

Matheus Almeida matheus.almeida at imgtec.com
Wed Jun 18 10:04:18 PDT 2014


CC'ing the list because there's a small modification to MCSubtargetInfo.h.

This patch adds support to many of the .set mipsX assembler directives that allow an ISA to be selected/deselected in the same translation unit. Example:
  .text
  .set mips32
  // Mips32 ISA available
  .set mips64
  // Mips64 ISA available

Mips ISAs are defined with respect to older ISAs. For example:

FeatureMips1 : None
FeatureMips2 : FeatureMips1
FeatureMips3 : FeatureMips2 | FeatureMipsGP64
and so on...

One of the issues of disabling a feature is that the function ClearImpliedBits in SubtargetFeature only clears the features that imply the feature being cleared. As an example, clearing the FeatureMips3 will not clear (FeatureMips2 | FeatureMipsGP64 | FeatureMips1). 

The idea behind this patch is that every time we select a new ISA, we clear all the bits related to ISAs (updating MCSubtargetInfo) and select the new one as 'setImpliedBits' does the right thing. 

Does this make sense ?

Regards,
Matheus

http://reviews.llvm.org/D4123






More information about the llvm-commits mailing list