Skip to content

Commit

Permalink
[LoongArch] Move lp64s out of the unimplemented calling conv list
Browse files Browse the repository at this point in the history
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
  • Loading branch information
SixWeining committed May 16, 2023
1 parent 8f84797 commit 2cf0314
Show file tree
Hide file tree
Showing 6 changed files with 524 additions and 416 deletions.
2 changes: 2 additions & 0 deletions llvm/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ Changes to the Hexagon Backend
Changes to the LoongArch Backend
--------------------------------

* The `lp64s` ABI is supported now and has been tested on Rust bare-matal target.

Changes to the MIPS Backend
---------------------------

Expand Down
3 changes: 2 additions & 1 deletion llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1928,7 +1928,6 @@ static bool CC_LoongArch(const DataLayout &DL, LoongArchABI::ABI ABI,
default:
llvm_unreachable("Unexpected ABI");
case LoongArchABI::ABI_ILP32S:
case LoongArchABI::ABI_LP64S:
case LoongArchABI::ABI_ILP32F:
case LoongArchABI::ABI_LP64F:
report_fatal_error("Unimplemented ABI");
Expand All @@ -1937,6 +1936,8 @@ static bool CC_LoongArch(const DataLayout &DL, LoongArchABI::ABI ABI,
case LoongArchABI::ABI_LP64D:
UseGPRForFloat = !IsFixed;
break;
case LoongArchABI::ABI_LP64S:
break;
}

// FPR32 and FPR64 alias each other.
Expand Down
Loading

0 comments on commit 2cf0314

Please sign in to comment.