Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIPS] Updated MIPS N calling conventions so that fp16 arguments no longer cause a crash #116569

Merged
merged 1 commit into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions llvm/lib/Target/Mips/MipsCallingConv.td
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ class CCIfSubtargetNot<string F, CCAction A> : CCIfSubtarget<F, A, "!">;

/// Match if the original argument (before lowering) was a float.
/// For example, this is true for i32's that were lowered from soft-float.
class CCIfOrigArgWasNotFloat<CCAction A>
: CCIf<"!static_cast<MipsCCState *>(&State)->WasOriginalArgFloat(ValNo)",
class CCIfOrigArgWasFloat<CCAction A>
: CCIf<"static_cast<MipsCCState *>(&State)->WasOriginalArgFloat(ValNo)",
A>;

/// Match if the original argument (before lowering) was a 128-bit float (i.e.
Expand Down Expand Up @@ -134,12 +134,13 @@ def CC_MipsN : CallingConv<[
CCIfSubtargetNot<"isLittle()",
CCIfInReg<CCPromoteToUpperBitsInType<i64>>>>,

// All integers (except soft-float integers) are promoted to 64-bit.
CCIfType<[i8, i16, i32], CCIfOrigArgWasNotFloat<CCPromoteToType<i64>>>,
// First deal with f32s that got turned into i32s due to soft-float
CCIfType<[i32],
CCIfSubtarget<"useSoftFloat()",
CCIfOrigArgWasFloat<CCDelegateTo<CC_MipsN_SoftFloat>>>>,

// The only i32's we have left are soft-float arguments.
CCIfSubtarget<"useSoftFloat()", CCIfType<[i32],
CCDelegateTo<CC_MipsN_SoftFloat>>>,
// All remaining integers are promoted to 64-bit.
CCIfType<[i8, i16, i32], CCPromoteToType<i64>>,

// Integer arguments are passed in integer registers.
CCIfType<[i64], CCAssignToRegWithShadow<[A0_64, A1_64, A2_64, A3_64,
Expand Down
Loading
Loading