MIPS: allow o32 abi with 64bit CPU and 64 abi with 32bit triple
authorYunQiang Su <wzssyqa@gmail.com>
Tue, 16 May 2023 22:31:37 +0000 (15:31 -0700)
committerFangrui Song <i@maskray.me>
Tue, 16 May 2023 22:31:37 +0000 (15:31 -0700)
commit7983f8aca82e258174849f1cc6a70029353e9887
tree0fbbae5a459e6b20815306c02fdb0873a3092ec6
parent0b1cd03dbb778026995436e1f29b7dbc8c8e95bc
MIPS: allow o32 abi with 64bit CPU and 64 abi with 32bit triple

In general, MIPS support ELF format like
   ELF 32-bit LSB relocatable, MIPS, MIPS64 rel2 version 1 (SYSV)
and Linux's VDSO uses it.

Currently clang stop CMDs like
    clang -march=mips64r2 -mabi=32

While it is not needed now, since the the backend support the combination now.

This patch also allows something like
     clang --target=mipsel-linux-gnu -mabi=64
Since the triple can convert to right 64bit one automaticly.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D146269
clang/lib/Basic/Targets/Mips.cpp
clang/test/Driver/mips-abi.c
clang/test/Driver/mips-cpu64abi32.c [new file with mode: 0644]
llvm/lib/Target/Mips/MipsSubtarget.cpp