mirror of
https://github.com/odin-lang/Odin.git
synced 2026-07-23 16:02:38 +00:00
feat(arm32 cdecl): Added thumb as the triple for cortex-m7. Updated the calling convention for cortex-m7 arm32 micro processors as the soft float register was being used when calling across the C ABI boundary causing guff data to be passed.
This commit is contained in:
@@ -452,7 +452,9 @@ gb_internal lbProcedure *lb_create_dummy_procedure(lbModule *m, String link_name
|
||||
|
||||
Type *pt = p->type;
|
||||
lbCallingConventionKind cc_kind = lbCallingConvention_C;
|
||||
if (!is_arch_wasm()) {
|
||||
if (is_cortex_m7()) {
|
||||
cc_kind = lbCallingConvention_ARM_AAPCS_VFP;
|
||||
} else if (!is_arch_wasm()) {
|
||||
cc_kind = lb_calling_convention_map[pt->Proc.calling_convention];
|
||||
}
|
||||
LLVMSetFunctionCallConv(p->value, cc_kind);
|
||||
@@ -994,6 +996,9 @@ gb_internal lbValue lb_emit_call_internal(lbProcedure *p, lbValue value, lbValue
|
||||
LLVMValueRef ret = LLVMBuildCall2(p->builder, fnp, fn, args, arg_count, "");
|
||||
|
||||
auto llvm_cc = lb_calling_convention_map[proc_type->Proc.calling_convention];
|
||||
if (is_cortex_m7()) {
|
||||
llvm_cc = lbCallingConvention_ARM_AAPCS_VFP;
|
||||
}
|
||||
LLVMSetInstructionCallConv(ret, llvm_cc);
|
||||
|
||||
LLVMAttributeIndex param_offset = LLVMAttributeIndex_FirstArgIndex;
|
||||
|
||||
Reference in New Issue
Block a user