aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Frontend/CompilerInvocationTest.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@sifive.com>2021-01-05 10:43:44 -0800
committerCraig Topper <craig.topper@sifive.com>2021-01-05 10:59:30 -0800
commit210bc3dc0eb3550fd99158e5747619ad9e91c548 (patch)
treef6011a6969866f4184cc4fec8863bbf4552f414d /clang/unittests/Frontend/CompilerInvocationTest.cpp
parent86d68e288585964546d6382ecf71dcce10d018b7 (diff)
downloadllvm-210bc3dc0eb3550fd99158e5747619ad9e91c548.zip
llvm-210bc3dc0eb3550fd99158e5747619ad9e91c548.tar.gz
llvm-210bc3dc0eb3550fd99158e5747619ad9e91c548.tar.bz2
[RISCV] Don't parse 'vmsltu.vi v0, v1, 0' as 'vmsleu.vi v0, v1, -1'
vmsltu.vi v0, v1, 0 is always false there is no unsigned number less than 0. vmsleu.vi v0, v1, -1 on the other hand is always true since -1 will be considered unsigned max and all numbers are <= unsigned max. A similar problem exists for vmsgeu.vi v0, v1, 0 which is always true, but becomes vmsgtu.vi v0, v1, -1 which is always false. To match the GNU assembler we'll emit vmsne.vv and vmseq.vv with the same register for these cases instead. I'm using AsmParserOnly pseudo instructions here because we can't match an explicit immediate in an InstAlias. And we can't use a AsmOperand for the zero because the output we want doesn't use an immediate so there's nowhere to name the AsmOperand we want to use. To keep the implementations similar I'm also handling signed with pseudo instructions even though they don't have this issue. This way we can avoid the special renderMethod that decremented by 1 so the immediate we see for the pseudo instruction in processInstruction is 0 and not -1. Another option might have been to have a different simm5_plus1 operand for the unsigned case or just live with the immediate being pre-decremented. I felt this way was clearer, but I'm open to other opinions. Reviewed By: frasercrmck Differential Revision: https://reviews.llvm.org/D94035
Diffstat (limited to 'clang/unittests/Frontend/CompilerInvocationTest.cpp')
0 files changed, 0 insertions, 0 deletions