Skip to content

Commit 2cf0314

Browse files
committed
[LoongArch] Move lp64s out of the unimplemented calling conv list
lp64s is same as lp64d execpt that floating point arguments and return values are always passed via GPRs or stack which means `UseGPRForFloat` is always `true` in `CC_LoongArch` for lp64s. One motivation of this change is to build linux which uses `-msoft-float` and `-mabi=lp64s` [1]. [1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/loongarch/Makefile?h=v6.4-rc1#n49 Reviewed By: xen0n, hev Differential Revision: https://reviews.llvm.org/D150417
1 parent 8f84797 commit 2cf0314

File tree

6 files changed

+524
-416
lines changed

6 files changed

+524
-416
lines changed

llvm/docs/ReleaseNotes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ Changes to the Hexagon Backend
123123
Changes to the LoongArch Backend
124124
--------------------------------
125125

126+
* The `lp64s` ABI is supported now and has been tested on Rust bare-matal target.
127+
126128
Changes to the MIPS Backend
127129
---------------------------
128130

llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1928,7 +1928,6 @@ static bool CC_LoongArch(const DataLayout &DL, LoongArchABI::ABI ABI,
19281928
default:
19291929
llvm_unreachable("Unexpected ABI");
19301930
case LoongArchABI::ABI_ILP32S:
1931-
case LoongArchABI::ABI_LP64S:
19321931
case LoongArchABI::ABI_ILP32F:
19331932
case LoongArchABI::ABI_LP64F:
19341933
report_fatal_error("Unimplemented ABI");
@@ -1937,6 +1936,8 @@ static bool CC_LoongArch(const DataLayout &DL, LoongArchABI::ABI ABI,
19371936
case LoongArchABI::ABI_LP64D:
19381937
UseGPRForFloat = !IsFixed;
19391938
break;
1939+
case LoongArchABI::ABI_LP64S:
1940+
break;
19401941
}
19411942

19421943
// FPR32 and FPR64 alias each other.

0 commit comments

Comments
 (0)