Path: blob/main/cranelift/codegen/meta/src/isa/s390x.rs
1693 views
use crate::cdsl::isa::TargetIsa;1use crate::cdsl::settings::SettingGroupBuilder;23pub(crate) fn define() -> TargetIsa {4let mut settings = SettingGroupBuilder::new("s390x");56// The baseline architecture for cranelift is z14 (arch12),7// so we list only facilities of later processors here.89// z15 (arch13) facilities10let has_mie3 = settings.add_bool(11"has_mie3",12"Has Miscellaneous-Instruction-Extensions Facility 3 support.",13"",14false,15);16let has_vxrs_ext2 = settings.add_bool(17"has_vxrs_ext2",18"Has Vector-Enhancements Facility 2 support.",19"",20false,21);2223// z16 (arch14) has no new facilities that can be exploited by cranelift2425// z17 (arch15) facilities26let has_mie4 = settings.add_bool(27"has_mie4",28"Has Miscellaneous-Instruction-Extensions Facility 4 support.",29"",30false,31);32let has_vxrs_ext3 = settings.add_bool(33"has_vxrs_ext3",34"Has Vector-Enhancements Facility 3 support.",35"",36false,37);3839// Architecture level presets40settings.add_preset(41"arch13",42"Thirteenth Edition of the z/Architecture.",43preset!(has_mie3 && has_vxrs_ext2),44);45settings.add_preset(46"arch14",47"Fourteenth Edition of the z/Architecture.",48preset!(has_mie3 && has_vxrs_ext2),49);50settings.add_preset(51"arch15",52"Fifteenth Edition of the z/Architecture.",53preset!(has_mie3 && has_mie4 && has_vxrs_ext2 && has_vxrs_ext3),54);5556// Processor presets57settings.add_preset(58"z15",59"IBM z15 processor.",60preset!(has_mie3 && has_vxrs_ext2),61);62settings.add_preset(63"z16",64"IBM z16 processor.",65preset!(has_mie3 && has_vxrs_ext2),66);67settings.add_preset(68"z17",69"IBM z17 processor.",70preset!(has_mie3 && has_mie4 && has_vxrs_ext2 && has_vxrs_ext3),71);7273TargetIsa::new("s390x", settings.build())74}757677