You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// For rusty ABIs, small aggregates are actually passed
280
-
// as `RegKind::Integer` (see `FnAbi::adjust_for_abi`),
281
-
// so we re-use that same threshold here.
282
-
layout.size <= self.data_layout().pointer_size*2
283
-
}
284
-
};
285
-
286
-
let a = args[0].immediate();
287
-
let b = args[1].immediate();
288
-
if layout.size.bytes() == 0{
289
-
self.const_bool(true)
290
-
}
291
-
/*else if use_integer_compare {
292
-
let integer_ty = self.type_ix(layout.size.bits()); // FIXME(antoyo): LLVM creates an integer of 96 bits for [i32; 3], but gcc doesn't support this, so it creates an integer of 128 bits.
293
-
let ptr_ty = self.type_ptr_to(integer_ty);
294
-
let a_ptr = self.bitcast(a, ptr_ty);
295
-
let a_val = self.load(integer_ty, a_ptr, layout.align.abi);
296
-
let b_ptr = self.bitcast(b, ptr_ty);
297
-
let b_val = self.load(integer_ty, b_ptr, layout.align.abi);
298
-
self.icmp(IntPredicate::IntEQ, a_val, b_val)
299
-
}*/
300
-
else{
301
-
let void_ptr_type = self.context.new_type::<*const()>();
302
-
let a_ptr = self.bitcast(a, void_ptr_type);
303
-
let b_ptr = self.bitcast(b, void_ptr_type);
304
-
let n = self.context.new_cast(None,self.const_usize(layout.size.bytes()),self.sizet_type);
305
-
let builtin = self.context.get_builtin_function("memcmp");
306
-
let cmp = self.context.new_call(None, builtin,&[a_ptr, b_ptr, n]);
0 commit comments