Enable SSE 4.2 unconditionally (#3833)
* Enable SSE 4.2 unconditionally Fuzzing over the weekend found that `i64x2` comparison operators require `pcmpgtq` which is an SSE 4.2 instruction. Along the lines of #3816 this commit unconditionally enables and requires SSE 4.2 for compilation and fuzzing. It will no longer be possible to create a compiler for x86_64 with simd enabled if SSE 4.2 is disabled. * Update comment
This commit is contained in:
@@ -178,11 +178,15 @@ fn isa_constructor(
|
||||
let isa_flags = x64_settings::Flags::new(&shared_flags, builder);
|
||||
|
||||
// Check for compatibility between flags and ISA level
|
||||
// requested. In particular, SIMD support requires SSE4.1.
|
||||
// requested. In particular, SIMD support requires SSE4.2.
|
||||
if shared_flags.enable_simd() {
|
||||
if !isa_flags.has_sse3() || !isa_flags.has_ssse3() || !isa_flags.has_sse41() {
|
||||
if !isa_flags.has_sse3()
|
||||
|| !isa_flags.has_ssse3()
|
||||
|| !isa_flags.has_sse41()
|
||||
|| !isa_flags.has_sse42()
|
||||
{
|
||||
return Err(CodegenError::Unsupported(
|
||||
"SIMD support requires SSE3, SSSE3, and SSE4.1 on x86_64.".into(),
|
||||
"SIMD support requires SSE3, SSSE3, SSE4.1, and SSE4.2 on x86_64.".into(),
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -354,6 +358,7 @@ mod test {
|
||||
isa_builder.set("has_sse3", "false").unwrap();
|
||||
isa_builder.set("has_ssse3", "false").unwrap();
|
||||
isa_builder.set("has_sse41", "false").unwrap();
|
||||
isa_builder.set("has_sse42", "false").unwrap();
|
||||
assert!(matches!(
|
||||
isa_builder.finish(shared_flags),
|
||||
Err(CodegenError::Unsupported(_)),
|
||||
|
||||
Reference in New Issue
Block a user