[mips] Add assembler support for '.set mipsX'.
authorDaniel Sanders <daniel.sanders@imgtec.com>
Mon, 4 Aug 2014 12:20:00 +0000 (12:20 +0000)
committerDaniel Sanders <daniel.sanders@imgtec.com>
Mon, 4 Aug 2014 12:20:00 +0000 (12:20 +0000)
commit98b419bff75f6c85d76727b222103d5c69de6b89
tree1800ca85792ff83ad012b2dcb5a8adbad27d5c75
parent12d4f9f4e40a61602b74777aa56cb21728286ad5
[mips] Add assembler support for '.set mipsX'.

Summary:
This patch also fixes an issue with the way the Mips assembler enables/disables architecture
features. Before this patch, the assembler never disabled feature bits. For example,
.set mips64
.set mips32r2

would result in the 'OR' of mips64 with mips32r2 feature bits which isn't right.
Unfortunately this isn't trivial to fix because there's not an easy way to clear
feature bits as the algorithm in MCSubtargetInfo (ToggleFeature) only clears the bits
that imply the feature being cleared and not the implied bits by the feature (there's a
better explanation to the code I added).

Patch by Matheus Almeida and updated by Toma Tabacu

Reviewers: vmedic, matheusalmeida, dsanders

Reviewed By: dsanders

Subscribers: tomatabacu, llvm-commits

Differential Revision: http://reviews.llvm.org/D4123

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214709 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/MC/MCSubtargetInfo.h
lib/Target/Mips/AsmParser/MipsAsmParser.cpp
lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp
lib/Target/Mips/MipsTargetStreamer.h
test/MC/Mips/set-mips-directives-bad.s [new file with mode: 0644]
test/MC/Mips/set-mips-directives.s [new file with mode: 0644]