@@ -154,6 +154,7 @@ mod mips;
154154mod nvptx;
155155mod powerpc;
156156mod riscv;
157+ mod s390x;
157158mod spirv;
158159mod wasm;
159160mod x86;
@@ -166,6 +167,7 @@ pub use mips::{MipsInlineAsmReg, MipsInlineAsmRegClass};
166167pub use nvptx:: { NvptxInlineAsmReg , NvptxInlineAsmRegClass } ;
167168pub use powerpc:: { PowerPCInlineAsmReg , PowerPCInlineAsmRegClass } ;
168169pub use riscv:: { RiscVInlineAsmReg , RiscVInlineAsmRegClass } ;
170+ pub use s390x:: { S390xInlineAsmReg , S390xInlineAsmRegClass } ;
169171pub use spirv:: { SpirVInlineAsmReg , SpirVInlineAsmRegClass } ;
170172pub use wasm:: { WasmInlineAsmReg , WasmInlineAsmRegClass } ;
171173pub use x86:: { X86InlineAsmReg , X86InlineAsmRegClass } ;
@@ -184,6 +186,7 @@ pub enum InlineAsmArch {
184186 Mips64 ,
185187 PowerPC ,
186188 PowerPC64 ,
189+ S390x ,
187190 SpirV ,
188191 Wasm32 ,
189192 Bpf ,
@@ -206,6 +209,7 @@ impl FromStr for InlineAsmArch {
206209 "hexagon" => Ok ( Self :: Hexagon ) ,
207210 "mips" => Ok ( Self :: Mips ) ,
208211 "mips64" => Ok ( Self :: Mips64 ) ,
212+ "s390x" => Ok ( Self :: S390x ) ,
209213 "spirv" => Ok ( Self :: SpirV ) ,
210214 "wasm32" => Ok ( Self :: Wasm32 ) ,
211215 "bpf" => Ok ( Self :: Bpf ) ,
@@ -235,6 +239,7 @@ pub enum InlineAsmReg {
235239 PowerPC ( PowerPCInlineAsmReg ) ,
236240 Hexagon ( HexagonInlineAsmReg ) ,
237241 Mips ( MipsInlineAsmReg ) ,
242+ S390x ( S390xInlineAsmReg ) ,
238243 SpirV ( SpirVInlineAsmReg ) ,
239244 Wasm ( WasmInlineAsmReg ) ,
240245 Bpf ( BpfInlineAsmReg ) ,
@@ -252,6 +257,7 @@ impl InlineAsmReg {
252257 Self :: PowerPC ( r) => r. name ( ) ,
253258 Self :: Hexagon ( r) => r. name ( ) ,
254259 Self :: Mips ( r) => r. name ( ) ,
260+ Self :: S390x ( r) => r. name ( ) ,
255261 Self :: Bpf ( r) => r. name ( ) ,
256262 Self :: Err => "<reg>" ,
257263 }
@@ -266,6 +272,7 @@ impl InlineAsmReg {
266272 Self :: PowerPC ( r) => InlineAsmRegClass :: PowerPC ( r. reg_class ( ) ) ,
267273 Self :: Hexagon ( r) => InlineAsmRegClass :: Hexagon ( r. reg_class ( ) ) ,
268274 Self :: Mips ( r) => InlineAsmRegClass :: Mips ( r. reg_class ( ) ) ,
275+ Self :: S390x ( r) => InlineAsmRegClass :: S390x ( r. reg_class ( ) ) ,
269276 Self :: Bpf ( r) => InlineAsmRegClass :: Bpf ( r. reg_class ( ) ) ,
270277 Self :: Err => InlineAsmRegClass :: Err ,
271278 }
@@ -305,6 +312,9 @@ impl InlineAsmReg {
305312 InlineAsmArch :: Mips | InlineAsmArch :: Mips64 => {
306313 Self :: Mips ( MipsInlineAsmReg :: parse ( arch, has_feature, target, & name) ?)
307314 }
315+ InlineAsmArch :: S390x => {
316+ Self :: S390x ( S390xInlineAsmReg :: parse ( arch, has_feature, target, & name) ?)
317+ }
308318 InlineAsmArch :: SpirV => {
309319 Self :: SpirV ( SpirVInlineAsmReg :: parse ( arch, has_feature, target, & name) ?)
310320 }
@@ -333,6 +343,7 @@ impl InlineAsmReg {
333343 Self :: PowerPC ( r) => r. emit ( out, arch, modifier) ,
334344 Self :: Hexagon ( r) => r. emit ( out, arch, modifier) ,
335345 Self :: Mips ( r) => r. emit ( out, arch, modifier) ,
346+ Self :: S390x ( r) => r. emit ( out, arch, modifier) ,
336347 Self :: Bpf ( r) => r. emit ( out, arch, modifier) ,
337348 Self :: Err => unreachable ! ( "Use of InlineAsmReg::Err" ) ,
338349 }
@@ -347,6 +358,7 @@ impl InlineAsmReg {
347358 Self :: PowerPC ( _) => cb ( self ) ,
348359 Self :: Hexagon ( r) => r. overlapping_regs ( |r| cb ( Self :: Hexagon ( r) ) ) ,
349360 Self :: Mips ( _) => cb ( self ) ,
361+ Self :: S390x ( _) => cb ( self ) ,
350362 Self :: Bpf ( r) => r. overlapping_regs ( |r| cb ( Self :: Bpf ( r) ) ) ,
351363 Self :: Err => unreachable ! ( "Use of InlineAsmReg::Err" ) ,
352364 }
@@ -374,6 +386,7 @@ pub enum InlineAsmRegClass {
374386 PowerPC ( PowerPCInlineAsmRegClass ) ,
375387 Hexagon ( HexagonInlineAsmRegClass ) ,
376388 Mips ( MipsInlineAsmRegClass ) ,
389+ S390x ( S390xInlineAsmRegClass ) ,
377390 SpirV ( SpirVInlineAsmRegClass ) ,
378391 Wasm ( WasmInlineAsmRegClass ) ,
379392 Bpf ( BpfInlineAsmRegClass ) ,
@@ -392,6 +405,7 @@ impl InlineAsmRegClass {
392405 Self :: PowerPC ( r) => r. name ( ) ,
393406 Self :: Hexagon ( r) => r. name ( ) ,
394407 Self :: Mips ( r) => r. name ( ) ,
408+ Self :: S390x ( r) => r. name ( ) ,
395409 Self :: SpirV ( r) => r. name ( ) ,
396410 Self :: Wasm ( r) => r. name ( ) ,
397411 Self :: Bpf ( r) => r. name ( ) ,
@@ -412,6 +426,7 @@ impl InlineAsmRegClass {
412426 Self :: PowerPC ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: PowerPC ) ,
413427 Self :: Hexagon ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Hexagon ) ,
414428 Self :: Mips ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Mips ) ,
429+ Self :: S390x ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: S390x ) ,
415430 Self :: SpirV ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: SpirV ) ,
416431 Self :: Wasm ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Wasm ) ,
417432 Self :: Bpf ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Bpf ) ,
@@ -439,6 +454,7 @@ impl InlineAsmRegClass {
439454 Self :: PowerPC ( r) => r. suggest_modifier ( arch, ty) ,
440455 Self :: Hexagon ( r) => r. suggest_modifier ( arch, ty) ,
441456 Self :: Mips ( r) => r. suggest_modifier ( arch, ty) ,
457+ Self :: S390x ( r) => r. suggest_modifier ( arch, ty) ,
442458 Self :: SpirV ( r) => r. suggest_modifier ( arch, ty) ,
443459 Self :: Wasm ( r) => r. suggest_modifier ( arch, ty) ,
444460 Self :: Bpf ( r) => r. suggest_modifier ( arch, ty) ,
@@ -462,6 +478,7 @@ impl InlineAsmRegClass {
462478 Self :: PowerPC ( r) => r. default_modifier ( arch) ,
463479 Self :: Hexagon ( r) => r. default_modifier ( arch) ,
464480 Self :: Mips ( r) => r. default_modifier ( arch) ,
481+ Self :: S390x ( r) => r. default_modifier ( arch) ,
465482 Self :: SpirV ( r) => r. default_modifier ( arch) ,
466483 Self :: Wasm ( r) => r. default_modifier ( arch) ,
467484 Self :: Bpf ( r) => r. default_modifier ( arch) ,
@@ -484,6 +501,7 @@ impl InlineAsmRegClass {
484501 Self :: PowerPC ( r) => r. supported_types ( arch) ,
485502 Self :: Hexagon ( r) => r. supported_types ( arch) ,
486503 Self :: Mips ( r) => r. supported_types ( arch) ,
504+ Self :: S390x ( r) => r. supported_types ( arch) ,
487505 Self :: SpirV ( r) => r. supported_types ( arch) ,
488506 Self :: Wasm ( r) => r. supported_types ( arch) ,
489507 Self :: Bpf ( r) => r. supported_types ( arch) ,
@@ -509,6 +527,7 @@ impl InlineAsmRegClass {
509527 InlineAsmArch :: Mips | InlineAsmArch :: Mips64 => {
510528 Self :: Mips ( MipsInlineAsmRegClass :: parse ( arch, name) ?)
511529 }
530+ InlineAsmArch :: S390x => Self :: S390x ( S390xInlineAsmRegClass :: parse ( arch, name) ?) ,
512531 InlineAsmArch :: SpirV => Self :: SpirV ( SpirVInlineAsmRegClass :: parse ( arch, name) ?) ,
513532 InlineAsmArch :: Wasm32 => Self :: Wasm ( WasmInlineAsmRegClass :: parse ( arch, name) ?) ,
514533 InlineAsmArch :: Bpf => Self :: Bpf ( BpfInlineAsmRegClass :: parse ( arch, name) ?) ,
@@ -527,6 +546,7 @@ impl InlineAsmRegClass {
527546 Self :: PowerPC ( r) => r. valid_modifiers ( arch) ,
528547 Self :: Hexagon ( r) => r. valid_modifiers ( arch) ,
529548 Self :: Mips ( r) => r. valid_modifiers ( arch) ,
549+ Self :: S390x ( r) => r. valid_modifiers ( arch) ,
530550 Self :: SpirV ( r) => r. valid_modifiers ( arch) ,
531551 Self :: Wasm ( r) => r. valid_modifiers ( arch) ,
532552 Self :: Bpf ( r) => r. valid_modifiers ( arch) ,
@@ -695,6 +715,11 @@ pub fn allocatable_registers(
695715 mips:: fill_reg_map ( arch, has_feature, target, & mut map) ;
696716 map
697717 }
718+ InlineAsmArch :: S390x => {
719+ let mut map = s390x:: regclass_map ( ) ;
720+ s390x:: fill_reg_map ( arch, has_feature, target, & mut map) ;
721+ map
722+ }
698723 InlineAsmArch :: SpirV => {
699724 let mut map = spirv:: regclass_map ( ) ;
700725 spirv:: fill_reg_map ( arch, has_feature, target, & mut map) ;
0 commit comments