Add separate VMX/fpu mxcsr
Add support for constant operands for most fpu instructions Remove constant folding for most fpu cpde half float
This commit is contained in:
@@ -616,7 +616,31 @@ struct Sequence {
|
||||
}
|
||||
}
|
||||
};
|
||||
template <typename T>
|
||||
static Xmm GetInputRegOrConstant(X64Emitter& e, const T& input,
|
||||
Xmm xmm_to_use_if_const) {
|
||||
if (input.is_constant) {
|
||||
using constant_type = std::remove_reference_t<decltype(input.constant())>;
|
||||
|
||||
if constexpr (std::is_integral_v<constant_type>) {
|
||||
vec128_t input_constant = vec128b(0);
|
||||
if constexpr (sizeof(constant_type) == 4) {
|
||||
input_constant.i32[0] = input.constant();
|
||||
|
||||
} else if constexpr (sizeof(constant_type) == 8) {
|
||||
input_constant.low = input.constant();
|
||||
} else {
|
||||
assert_unhandled_case(sizeof(constant_type));
|
||||
}
|
||||
e.LoadConstantXmm(xmm_to_use_if_const, input_constant);
|
||||
} else {
|
||||
e.LoadConstantXmm(xmm_to_use_if_const, input.constant());
|
||||
}
|
||||
return xmm_to_use_if_const;
|
||||
} else {
|
||||
return input;
|
||||
}
|
||||
}
|
||||
} // namespace x64
|
||||
} // namespace backend
|
||||
} // namespace cpu
|
||||
|
||||
Reference in New Issue
Block a user