diff options
| author | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-11 20:26:56 +0800 |
|---|---|---|
| committer | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-11 20:26:56 +0800 |
| commit | 38626ed37c9ea78c76c12dae4806b750881fd910 (patch) | |
| tree | f838b8c3b79ec1458d3370411e3b32e892ba02ca /backend/lib/Target/RISCV/RISCVCodeGen.cpp | |
| parent | cd2e88b9618ba7c2f6fcfac901e81f4a302a34c9 (diff) | |
| download | rcc-project-38626ed37c9ea78c76c12dae4806b750881fd910.tar.gz rcc-project-38626ed37c9ea78c76c12dae4806b750881fd910.tar.xz | |
[RISCV] Add LP64 calling-convention facts
Diffstat (limited to 'backend/lib/Target/RISCV/RISCVCodeGen.cpp')
| -rw-r--r-- | backend/lib/Target/RISCV/RISCVCodeGen.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/backend/lib/Target/RISCV/RISCVCodeGen.cpp b/backend/lib/Target/RISCV/RISCVCodeGen.cpp index bd4e20c..076e030 100644 --- a/backend/lib/Target/RISCV/RISCVCodeGen.cpp +++ b/backend/lib/Target/RISCV/RISCVCodeGen.cpp @@ -1470,7 +1470,8 @@ void eraseDeadArtifacts(std::span<MachineInstr *const> Candidates, [[nodiscard]] Expected<void> lowerMultiplyLibcall(MachineInstr &Instruction, MachineFunction &Function, - const TargetDescription &Target) { + const TargetDescription &Target, + CallingConvention Convention) { const std::optional<LLT> Type = resultType(Function, Instruction); const MachineOperand *DestinationOperand = Instruction.operandAt(0); const MachineOperand *LeftOperand = Instruction.operandAt(1); @@ -1506,7 +1507,7 @@ void eraseDeadArtifacts(std::span<MachineInstr *const> Candidates, }; CallLoweringRequest Request; - Request.Convention = callingConventionID(CallingConvention::LP64D); + Request.Convention = callingConventionID(Convention); Request.Callee = std::move(*Callee); Request.Arguments = {Value(*Left, 0), Value(*Right, 1)}; Request.Results = {Value(*Destination, 0)}; @@ -3620,7 +3621,9 @@ public: if (Action == LegalizationAction::Custom) return widenNarrowMultiply(Instruction, Function, Target); if (Action == LegalizationAction::Libcall) - return lowerMultiplyLibcall(Instruction, Function, Target); + return lowerMultiplyLibcall(Instruction, Function, Target, + Features.has(RISCVExtension::D) ? CallingConvention::LP64D + : CallingConvention::LP64); } if (Action == LegalizationAction::Custom && resultType(Function, Instruction) |
