s390x: Add z14 support
* Add support for processor features (including auto-detection). * Move base architecture set requirement back to z14. * Add z15 feature sets and re-enable z15-specific code generation when required features are available.
This commit is contained in:
@@ -125,6 +125,26 @@ pub fn builder_with_options(
|
||||
}
|
||||
}
|
||||
|
||||
// There is no is_s390x_feature_detected macro yet, so for now
|
||||
// we use getauxval from the libc crate directly.
|
||||
#[cfg(all(target_arch = "s390x", target_os = "linux"))]
|
||||
{
|
||||
use cranelift_codegen::settings::Configurable;
|
||||
|
||||
if !infer_native_flags {
|
||||
return Ok(isa_builder);
|
||||
}
|
||||
|
||||
let v = unsafe { libc::getauxval(libc::AT_HWCAP) };
|
||||
const HWCAP_S390X_VXRS_EXT2: libc::c_ulong = 32768;
|
||||
if (v & HWCAP_S390X_VXRS_EXT2) != 0 {
|
||||
isa_builder.enable("has_vxrs_ext2").unwrap();
|
||||
// There is no separate HWCAP bit for mie2, so assume
|
||||
// that any machine with vxrs_ext2 also has mie2.
|
||||
isa_builder.enable("has_mie2").unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
// squelch warnings about unused mut/variables on some platforms.
|
||||
drop(&mut isa_builder);
|
||||
drop(infer_native_flags);
|
||||
|
||||
Reference in New Issue
Block a user