[PATCH] D50557: [clang][mips] Set __mips_fpr correctly for -mfpxx
Simon Atanasyan via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Aug 20 07:04:31 PDT 2018
atanasyan added inline comments.
================
Comment at: lib/Basic/Targets/Mips.cpp:141
+ Twine(32 / (FPMode == FP64 || IsSingleFloat ? 1 : 2)));
if (IsMips16)
----------------
What do you think about this variant of the code? It's longer, but imho looks more clear.
```
switch (FPMode) {
case FPXX:
Builder.defineMacro("__mips_fpr", Twine(0));
break;
case FP32:
Builder.defineMacro("__mips_fpr", Twine(32));
break;
case FP64:
Builder.defineMacro("__mips_fpr", Twine(64));
break;
}
if (FPMode == FP64 || IsSingleFloat)
Builder.defineMacro("_MIPS_FPSET", Twine(32));
else
Builder.defineMacro("_MIPS_FPSET", Twine(16));
```
https://reviews.llvm.org/D50557
More information about the cfe-commits
mailing list