Add a new compare_bytes intrinsic instead of calling memcmp directly

This commit is contained in:
Scott McMurray 2023-08-02 12:45:52 -07:00
parent 85fbb57149
commit 502af03445
17 changed files with 267 additions and 22 deletions

View file

@ -273,6 +273,10 @@ pub fn check_intrinsic_type(tcx: TyCtxt<'_>, it: &hir::ForeignItem<'_>) {
],
Ty::new_unit(tcx),
),
sym::compare_bytes => {
let byte_ptr = Ty::new_imm_ptr(tcx, tcx.types.u8);
(0, vec![byte_ptr, byte_ptr, tcx.types.usize], tcx.types.i32)
}
sym::write_bytes | sym::volatile_set_memory => (
1,
vec![