Skip to content

Commit b75d396

Browse files
committed
Add support for bf16 linkage
1 parent d6a3056 commit b75d396

File tree

1 file changed

+11
-0
lines changed
  • compiler/rustc_codegen_llvm/src

1 file changed

+11
-0
lines changed

compiler/rustc_codegen_llvm/src/abi.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,17 @@ impl<'ll, 'tcx> FnAbiLlvmExt<'ll, 'tcx> for FnAbi<'tcx, Ty<'tcx>> {
439439
false
440440
}
441441
}
442+
TypeKind::BFloat => rust_ty == cx.type_i16(),
443+
TypeKind::Vector => {
444+
let element_count = cx.vector_length(llvm_ty);
445+
let element_ty = cx.element_type(llvm_ty);
446+
447+
if element_ty == cx.type_bf16() {
448+
rust_ty == cx.type_vector(cx.type_i16(), element_count as u64)
449+
} else {
450+
false
451+
}
452+
}
442453
_ => false,
443454
}
444455
};

0 commit comments

Comments
 (0)