Avoid mir_operand_get_const_val for simd_shuffle and cmpps and cmppd
This commit is contained in:
parent
aab17ccd19
commit
d8c1393557
@ -74,8 +74,12 @@ pub(crate) fn codegen_x86_llvm_intrinsic_call<'tcx>(
|
||||
};
|
||||
let x = codegen_operand(fx, x);
|
||||
let y = codegen_operand(fx, y);
|
||||
let kind = crate::constant::mir_operand_get_const_val(fx, kind)
|
||||
.expect("llvm.x86.sse2.cmp.* kind not const");
|
||||
let kind = match kind {
|
||||
Operand::Constant(const_) => {
|
||||
crate::constant::eval_mir_constant(fx, const_).unwrap().0
|
||||
}
|
||||
Operand::Copy(_) | Operand::Move(_) => unreachable!("{kind:?}"),
|
||||
};
|
||||
|
||||
let flt_cc = match kind
|
||||
.try_to_bits(Size::from_bytes(1))
|
||||
|
@ -168,8 +168,12 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
|
||||
|
||||
let indexes = {
|
||||
use rustc_middle::mir::interpret::*;
|
||||
let idx_const = crate::constant::mir_operand_get_const_val(fx, idx)
|
||||
.expect("simd_shuffle idx not const");
|
||||
let idx_const = match idx {
|
||||
Operand::Constant(const_) => {
|
||||
crate::constant::eval_mir_constant(fx, const_).unwrap().0
|
||||
}
|
||||
Operand::Copy(_) | Operand::Move(_) => unreachable!("{idx:?}"),
|
||||
};
|
||||
|
||||
let idx_bytes = match idx_const {
|
||||
ConstValue::ByRef { alloc, offset } => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user