machinst x64: check SSE requirements for instructions against enabled features;

This commit is contained in:
Benjamin Bouvier
2020-10-02 16:59:01 +02:00
parent c5bbc87498
commit e32e6fb612
3 changed files with 76 additions and 1 deletions

View File

@@ -475,6 +475,16 @@ pub(crate) fn emit(
info: &EmitInfo,
state: &mut EmitState,
) {
if let Some(iset_requirement) = inst.isa_requirement() {
match iset_requirement {
// Cranelift assumes SSE2 at least.
InstructionSet::SSE | InstructionSet::SSE2 => {}
InstructionSet::SSSE3 => assert!(info.isa_flags.has_ssse3()),
InstructionSet::SSE41 => assert!(info.isa_flags.has_sse41()),
InstructionSet::SSE42 => assert!(info.isa_flags.has_sse42()),
}
}
match inst {
Inst::AluRmiR {
is_64,