[mips] Invert the abicalls feature bit to be noabicalls so that it's possible for...
authorDaniel Sanders <daniel.sanders@imgtec.com>
Fri, 8 Aug 2014 15:47:17 +0000 (15:47 +0000)
committerDaniel Sanders <daniel.sanders@imgtec.com>
Fri, 8 Aug 2014 15:47:17 +0000 (15:47 +0000)
commita19fc6deb82eb0a2ab736f5debc966e63a3c0a20
tree9f0b03b6b8573c66c6276e15af1593bff8799365
parentb79931d94ee931afb8423decc078fd0cb5ea7e90
[mips] Invert the abicalls feature bit to be noabicalls so that it's possible for -mno-abicalls to take effect.

Also added the testcase that should have been in r215194.

This behaviour has surprised me a few times now. The problem is that the
generated MipsSubtarget::ParseSubtargetFeatures() contains code like this:

   if ((Bits & Mips::FeatureABICalls) != 0) IsABICalls = true;

so '-abicalls' means 'leave it at the default' and '+abicalls' means 'set it to
true'. In this case, (and the similar -modd-spreg case) I'd like the code to be

  IsABICalls = (Bits & Mips::FeatureABICalls) != 0;

or possibly:

   if ((Bits & Mips::FeatureABICalls) != 0)
     IsABICalls = true;
   else
     IsABICalls = false;

and preferably arrange for 'Bits & Mips::FeatureABICalls' to be true by default
(on some triples).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215211 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/Mips/Mips.td
lib/Target/Mips/MipsSubtarget.cpp
lib/Target/Mips/MipsSubtarget.h
test/CodeGen/Mips/abicalls.ll