@@ -4,8 +4,10 @@ use rustc_middle::{mir, ty, ty::FloatTy};
4
4
use rustc_span:: { sym, Symbol } ;
5
5
use rustc_target:: abi:: { Endian , HasDataLayout } ;
6
6
7
+ use crate :: helpers:: {
8
+ bool_to_simd_element, check_arg_count, round_to_next_multiple_of, simd_element_to_bool,
9
+ } ;
7
10
use crate :: * ;
8
- use helpers:: { bool_to_simd_element, check_arg_count, simd_element_to_bool} ;
9
11
10
12
impl < ' mir , ' tcx : ' mir > EvalContextExt < ' mir , ' tcx > for crate :: MiriInterpCx < ' mir , ' tcx > { }
11
13
pub trait EvalContextExt < ' mir , ' tcx : ' mir > : crate :: MiriInterpCxExt < ' mir , ' tcx > {
@@ -411,7 +413,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
411
413
let ( yes, yes_len) = this. operand_to_simd ( yes) ?;
412
414
let ( no, no_len) = this. operand_to_simd ( no) ?;
413
415
let ( dest, dest_len) = this. place_to_simd ( dest) ?;
414
- let bitmask_len = dest_len . max ( 8 ) ;
416
+ let bitmask_len = round_to_next_multiple_of ( dest_len , 8 ) ;
415
417
416
418
// The mask must be an integer or an array.
417
419
assert ! (
@@ -457,7 +459,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
457
459
"bitmask" => {
458
460
let [ op] = check_arg_count ( args) ?;
459
461
let ( op, op_len) = this. operand_to_simd ( op) ?;
460
- let bitmask_len = op_len . max ( 8 ) ;
462
+ let bitmask_len = round_to_next_multiple_of ( op_len , 8 ) ;
461
463
462
464
// Returns either an unsigned integer or array of `u8`.
463
465
assert ! (
0 commit comments