@@ -154,6 +154,7 @@ mod mips;
154
154
mod nvptx;
155
155
mod powerpc;
156
156
mod riscv;
157
+ mod s390x;
157
158
mod spirv;
158
159
mod wasm;
159
160
mod x86;
@@ -166,6 +167,7 @@ pub use mips::{MipsInlineAsmReg, MipsInlineAsmRegClass};
166
167
pub use nvptx:: { NvptxInlineAsmReg , NvptxInlineAsmRegClass } ;
167
168
pub use powerpc:: { PowerPCInlineAsmReg , PowerPCInlineAsmRegClass } ;
168
169
pub use riscv:: { RiscVInlineAsmReg , RiscVInlineAsmRegClass } ;
170
+ pub use s390x:: { S390xInlineAsmReg , S390xInlineAsmRegClass } ;
169
171
pub use spirv:: { SpirVInlineAsmReg , SpirVInlineAsmRegClass } ;
170
172
pub use wasm:: { WasmInlineAsmReg , WasmInlineAsmRegClass } ;
171
173
pub use x86:: { X86InlineAsmReg , X86InlineAsmRegClass } ;
@@ -184,6 +186,7 @@ pub enum InlineAsmArch {
184
186
Mips64 ,
185
187
PowerPC ,
186
188
PowerPC64 ,
189
+ S390x ,
187
190
SpirV ,
188
191
Wasm32 ,
189
192
Bpf ,
@@ -206,6 +209,7 @@ impl FromStr for InlineAsmArch {
206
209
"hexagon" => Ok ( Self :: Hexagon ) ,
207
210
"mips" => Ok ( Self :: Mips ) ,
208
211
"mips64" => Ok ( Self :: Mips64 ) ,
212
+ "s390x" => Ok ( Self :: S390x ) ,
209
213
"spirv" => Ok ( Self :: SpirV ) ,
210
214
"wasm32" => Ok ( Self :: Wasm32 ) ,
211
215
"bpf" => Ok ( Self :: Bpf ) ,
@@ -235,6 +239,7 @@ pub enum InlineAsmReg {
235
239
PowerPC ( PowerPCInlineAsmReg ) ,
236
240
Hexagon ( HexagonInlineAsmReg ) ,
237
241
Mips ( MipsInlineAsmReg ) ,
242
+ S390x ( S390xInlineAsmReg ) ,
238
243
SpirV ( SpirVInlineAsmReg ) ,
239
244
Wasm ( WasmInlineAsmReg ) ,
240
245
Bpf ( BpfInlineAsmReg ) ,
@@ -252,6 +257,7 @@ impl InlineAsmReg {
252
257
Self :: PowerPC ( r) => r. name ( ) ,
253
258
Self :: Hexagon ( r) => r. name ( ) ,
254
259
Self :: Mips ( r) => r. name ( ) ,
260
+ Self :: S390x ( r) => r. name ( ) ,
255
261
Self :: Bpf ( r) => r. name ( ) ,
256
262
Self :: Err => "<reg>" ,
257
263
}
@@ -266,6 +272,7 @@ impl InlineAsmReg {
266
272
Self :: PowerPC ( r) => InlineAsmRegClass :: PowerPC ( r. reg_class ( ) ) ,
267
273
Self :: Hexagon ( r) => InlineAsmRegClass :: Hexagon ( r. reg_class ( ) ) ,
268
274
Self :: Mips ( r) => InlineAsmRegClass :: Mips ( r. reg_class ( ) ) ,
275
+ Self :: S390x ( r) => InlineAsmRegClass :: S390x ( r. reg_class ( ) ) ,
269
276
Self :: Bpf ( r) => InlineAsmRegClass :: Bpf ( r. reg_class ( ) ) ,
270
277
Self :: Err => InlineAsmRegClass :: Err ,
271
278
}
@@ -305,6 +312,9 @@ impl InlineAsmReg {
305
312
InlineAsmArch :: Mips | InlineAsmArch :: Mips64 => {
306
313
Self :: Mips ( MipsInlineAsmReg :: parse ( arch, has_feature, target, & name) ?)
307
314
}
315
+ InlineAsmArch :: S390x => {
316
+ Self :: S390x ( S390xInlineAsmReg :: parse ( arch, has_feature, target, & name) ?)
317
+ }
308
318
InlineAsmArch :: SpirV => {
309
319
Self :: SpirV ( SpirVInlineAsmReg :: parse ( arch, has_feature, target, & name) ?)
310
320
}
@@ -333,6 +343,7 @@ impl InlineAsmReg {
333
343
Self :: PowerPC ( r) => r. emit ( out, arch, modifier) ,
334
344
Self :: Hexagon ( r) => r. emit ( out, arch, modifier) ,
335
345
Self :: Mips ( r) => r. emit ( out, arch, modifier) ,
346
+ Self :: S390x ( r) => r. emit ( out, arch, modifier) ,
336
347
Self :: Bpf ( r) => r. emit ( out, arch, modifier) ,
337
348
Self :: Err => unreachable ! ( "Use of InlineAsmReg::Err" ) ,
338
349
}
@@ -347,6 +358,7 @@ impl InlineAsmReg {
347
358
Self :: PowerPC ( _) => cb ( self ) ,
348
359
Self :: Hexagon ( r) => r. overlapping_regs ( |r| cb ( Self :: Hexagon ( r) ) ) ,
349
360
Self :: Mips ( _) => cb ( self ) ,
361
+ Self :: S390x ( _) => cb ( self ) ,
350
362
Self :: Bpf ( r) => r. overlapping_regs ( |r| cb ( Self :: Bpf ( r) ) ) ,
351
363
Self :: Err => unreachable ! ( "Use of InlineAsmReg::Err" ) ,
352
364
}
@@ -374,6 +386,7 @@ pub enum InlineAsmRegClass {
374
386
PowerPC ( PowerPCInlineAsmRegClass ) ,
375
387
Hexagon ( HexagonInlineAsmRegClass ) ,
376
388
Mips ( MipsInlineAsmRegClass ) ,
389
+ S390x ( S390xInlineAsmRegClass ) ,
377
390
SpirV ( SpirVInlineAsmRegClass ) ,
378
391
Wasm ( WasmInlineAsmRegClass ) ,
379
392
Bpf ( BpfInlineAsmRegClass ) ,
@@ -392,6 +405,7 @@ impl InlineAsmRegClass {
392
405
Self :: PowerPC ( r) => r. name ( ) ,
393
406
Self :: Hexagon ( r) => r. name ( ) ,
394
407
Self :: Mips ( r) => r. name ( ) ,
408
+ Self :: S390x ( r) => r. name ( ) ,
395
409
Self :: SpirV ( r) => r. name ( ) ,
396
410
Self :: Wasm ( r) => r. name ( ) ,
397
411
Self :: Bpf ( r) => r. name ( ) ,
@@ -412,6 +426,7 @@ impl InlineAsmRegClass {
412
426
Self :: PowerPC ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: PowerPC ) ,
413
427
Self :: Hexagon ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Hexagon ) ,
414
428
Self :: Mips ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Mips ) ,
429
+ Self :: S390x ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: S390x ) ,
415
430
Self :: SpirV ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: SpirV ) ,
416
431
Self :: Wasm ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Wasm ) ,
417
432
Self :: Bpf ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Bpf ) ,
@@ -439,6 +454,7 @@ impl InlineAsmRegClass {
439
454
Self :: PowerPC ( r) => r. suggest_modifier ( arch, ty) ,
440
455
Self :: Hexagon ( r) => r. suggest_modifier ( arch, ty) ,
441
456
Self :: Mips ( r) => r. suggest_modifier ( arch, ty) ,
457
+ Self :: S390x ( r) => r. suggest_modifier ( arch, ty) ,
442
458
Self :: SpirV ( r) => r. suggest_modifier ( arch, ty) ,
443
459
Self :: Wasm ( r) => r. suggest_modifier ( arch, ty) ,
444
460
Self :: Bpf ( r) => r. suggest_modifier ( arch, ty) ,
@@ -462,6 +478,7 @@ impl InlineAsmRegClass {
462
478
Self :: PowerPC ( r) => r. default_modifier ( arch) ,
463
479
Self :: Hexagon ( r) => r. default_modifier ( arch) ,
464
480
Self :: Mips ( r) => r. default_modifier ( arch) ,
481
+ Self :: S390x ( r) => r. default_modifier ( arch) ,
465
482
Self :: SpirV ( r) => r. default_modifier ( arch) ,
466
483
Self :: Wasm ( r) => r. default_modifier ( arch) ,
467
484
Self :: Bpf ( r) => r. default_modifier ( arch) ,
@@ -484,6 +501,7 @@ impl InlineAsmRegClass {
484
501
Self :: PowerPC ( r) => r. supported_types ( arch) ,
485
502
Self :: Hexagon ( r) => r. supported_types ( arch) ,
486
503
Self :: Mips ( r) => r. supported_types ( arch) ,
504
+ Self :: S390x ( r) => r. supported_types ( arch) ,
487
505
Self :: SpirV ( r) => r. supported_types ( arch) ,
488
506
Self :: Wasm ( r) => r. supported_types ( arch) ,
489
507
Self :: Bpf ( r) => r. supported_types ( arch) ,
@@ -509,6 +527,7 @@ impl InlineAsmRegClass {
509
527
InlineAsmArch :: Mips | InlineAsmArch :: Mips64 => {
510
528
Self :: Mips ( MipsInlineAsmRegClass :: parse ( arch, name) ?)
511
529
}
530
+ InlineAsmArch :: S390x => Self :: S390x ( S390xInlineAsmRegClass :: parse ( arch, name) ?) ,
512
531
InlineAsmArch :: SpirV => Self :: SpirV ( SpirVInlineAsmRegClass :: parse ( arch, name) ?) ,
513
532
InlineAsmArch :: Wasm32 => Self :: Wasm ( WasmInlineAsmRegClass :: parse ( arch, name) ?) ,
514
533
InlineAsmArch :: Bpf => Self :: Bpf ( BpfInlineAsmRegClass :: parse ( arch, name) ?) ,
@@ -527,6 +546,7 @@ impl InlineAsmRegClass {
527
546
Self :: PowerPC ( r) => r. valid_modifiers ( arch) ,
528
547
Self :: Hexagon ( r) => r. valid_modifiers ( arch) ,
529
548
Self :: Mips ( r) => r. valid_modifiers ( arch) ,
549
+ Self :: S390x ( r) => r. valid_modifiers ( arch) ,
530
550
Self :: SpirV ( r) => r. valid_modifiers ( arch) ,
531
551
Self :: Wasm ( r) => r. valid_modifiers ( arch) ,
532
552
Self :: Bpf ( r) => r. valid_modifiers ( arch) ,
@@ -695,6 +715,11 @@ pub fn allocatable_registers(
695
715
mips:: fill_reg_map ( arch, has_feature, target, & mut map) ;
696
716
map
697
717
}
718
+ InlineAsmArch :: S390x => {
719
+ let mut map = s390x:: regclass_map ( ) ;
720
+ s390x:: fill_reg_map ( arch, has_feature, target, & mut map) ;
721
+ map
722
+ }
698
723
InlineAsmArch :: SpirV => {
699
724
let mut map = spirv:: regclass_map ( ) ;
700
725
spirv:: fill_reg_map ( arch, has_feature, target, & mut map) ;
0 commit comments