@@ -191,6 +191,7 @@ mod nvptx;
191
191
mod powerpc;
192
192
mod riscv;
193
193
mod s390x;
194
+ mod sparc;
194
195
mod spirv;
195
196
mod wasm;
196
197
mod x86;
@@ -209,6 +210,7 @@ pub use nvptx::{NvptxInlineAsmReg, NvptxInlineAsmRegClass};
209
210
pub use powerpc:: { PowerPCInlineAsmReg , PowerPCInlineAsmRegClass } ;
210
211
pub use riscv:: { RiscVInlineAsmReg , RiscVInlineAsmRegClass } ;
211
212
pub use s390x:: { S390xInlineAsmReg , S390xInlineAsmRegClass } ;
213
+ pub use sparc:: { SparcInlineAsmReg , SparcInlineAsmRegClass } ;
212
214
pub use spirv:: { SpirVInlineAsmReg , SpirVInlineAsmRegClass } ;
213
215
pub use wasm:: { WasmInlineAsmReg , WasmInlineAsmRegClass } ;
214
216
pub use x86:: { X86InlineAsmReg , X86InlineAsmRegClass } ;
@@ -230,6 +232,8 @@ pub enum InlineAsmArch {
230
232
PowerPC ,
231
233
PowerPC64 ,
232
234
S390x ,
235
+ Sparc ,
236
+ Sparc64 ,
233
237
SpirV ,
234
238
Wasm32 ,
235
239
Wasm64 ,
@@ -260,6 +264,8 @@ impl FromStr for InlineAsmArch {
260
264
"mips" | "mips32r6" => Ok ( Self :: Mips ) ,
261
265
"mips64" | "mips64r6" => Ok ( Self :: Mips64 ) ,
262
266
"s390x" => Ok ( Self :: S390x ) ,
267
+ "sparc" => Ok ( Self :: Sparc ) ,
268
+ "sparc64" => Ok ( Self :: Sparc64 ) ,
263
269
"spirv" => Ok ( Self :: SpirV ) ,
264
270
"wasm32" => Ok ( Self :: Wasm32 ) ,
265
271
"wasm64" => Ok ( Self :: Wasm64 ) ,
@@ -286,6 +292,7 @@ pub enum InlineAsmReg {
286
292
LoongArch ( LoongArchInlineAsmReg ) ,
287
293
Mips ( MipsInlineAsmReg ) ,
288
294
S390x ( S390xInlineAsmReg ) ,
295
+ Sparc ( SparcInlineAsmReg ) ,
289
296
SpirV ( SpirVInlineAsmReg ) ,
290
297
Wasm ( WasmInlineAsmReg ) ,
291
298
Bpf ( BpfInlineAsmReg ) ,
@@ -309,6 +316,7 @@ impl InlineAsmReg {
309
316
Self :: LoongArch ( r) => r. name ( ) ,
310
317
Self :: Mips ( r) => r. name ( ) ,
311
318
Self :: S390x ( r) => r. name ( ) ,
319
+ Self :: Sparc ( r) => r. name ( ) ,
312
320
Self :: Bpf ( r) => r. name ( ) ,
313
321
Self :: Avr ( r) => r. name ( ) ,
314
322
Self :: Msp430 ( r) => r. name ( ) ,
@@ -329,6 +337,7 @@ impl InlineAsmReg {
329
337
Self :: LoongArch ( r) => InlineAsmRegClass :: LoongArch ( r. reg_class ( ) ) ,
330
338
Self :: Mips ( r) => InlineAsmRegClass :: Mips ( r. reg_class ( ) ) ,
331
339
Self :: S390x ( r) => InlineAsmRegClass :: S390x ( r. reg_class ( ) ) ,
340
+ Self :: Sparc ( r) => InlineAsmRegClass :: Sparc ( r. reg_class ( ) ) ,
332
341
Self :: Bpf ( r) => InlineAsmRegClass :: Bpf ( r. reg_class ( ) ) ,
333
342
Self :: Avr ( r) => InlineAsmRegClass :: Avr ( r. reg_class ( ) ) ,
334
343
Self :: Msp430 ( r) => InlineAsmRegClass :: Msp430 ( r. reg_class ( ) ) ,
@@ -361,6 +370,9 @@ impl InlineAsmReg {
361
370
Self :: Mips ( MipsInlineAsmReg :: parse ( name) ?)
362
371
}
363
372
InlineAsmArch :: S390x => Self :: S390x ( S390xInlineAsmReg :: parse ( name) ?) ,
373
+ InlineAsmArch :: Sparc | InlineAsmArch :: Sparc64 => {
374
+ Self :: Sparc ( SparcInlineAsmReg :: parse ( name) ?)
375
+ }
364
376
InlineAsmArch :: SpirV => Self :: SpirV ( SpirVInlineAsmReg :: parse ( name) ?) ,
365
377
InlineAsmArch :: Wasm32 | InlineAsmArch :: Wasm64 => {
366
378
Self :: Wasm ( WasmInlineAsmReg :: parse ( name) ?)
@@ -393,6 +405,7 @@ impl InlineAsmReg {
393
405
}
394
406
Self :: Mips ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
395
407
Self :: S390x ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
408
+ Self :: Sparc ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
396
409
Self :: Bpf ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
397
410
Self :: Avr ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
398
411
Self :: Msp430 ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
@@ -420,6 +433,7 @@ impl InlineAsmReg {
420
433
Self :: LoongArch ( r) => r. emit ( out, arch, modifier) ,
421
434
Self :: Mips ( r) => r. emit ( out, arch, modifier) ,
422
435
Self :: S390x ( r) => r. emit ( out, arch, modifier) ,
436
+ Self :: Sparc ( r) => r. emit ( out, arch, modifier) ,
423
437
Self :: Bpf ( r) => r. emit ( out, arch, modifier) ,
424
438
Self :: Avr ( r) => r. emit ( out, arch, modifier) ,
425
439
Self :: Msp430 ( r) => r. emit ( out, arch, modifier) ,
@@ -440,6 +454,7 @@ impl InlineAsmReg {
440
454
Self :: LoongArch ( _) => cb ( self ) ,
441
455
Self :: Mips ( _) => cb ( self ) ,
442
456
Self :: S390x ( r) => r. overlapping_regs ( |r| cb ( Self :: S390x ( r) ) ) ,
457
+ Self :: Sparc ( _) => cb ( self ) ,
443
458
Self :: Bpf ( r) => r. overlapping_regs ( |r| cb ( Self :: Bpf ( r) ) ) ,
444
459
Self :: Avr ( r) => r. overlapping_regs ( |r| cb ( Self :: Avr ( r) ) ) ,
445
460
Self :: Msp430 ( _) => cb ( self ) ,
@@ -463,6 +478,7 @@ pub enum InlineAsmRegClass {
463
478
LoongArch ( LoongArchInlineAsmRegClass ) ,
464
479
Mips ( MipsInlineAsmRegClass ) ,
465
480
S390x ( S390xInlineAsmRegClass ) ,
481
+ Sparc ( SparcInlineAsmRegClass ) ,
466
482
SpirV ( SpirVInlineAsmRegClass ) ,
467
483
Wasm ( WasmInlineAsmRegClass ) ,
468
484
Bpf ( BpfInlineAsmRegClass ) ,
@@ -487,6 +503,7 @@ impl InlineAsmRegClass {
487
503
Self :: LoongArch ( r) => r. name ( ) ,
488
504
Self :: Mips ( r) => r. name ( ) ,
489
505
Self :: S390x ( r) => r. name ( ) ,
506
+ Self :: Sparc ( r) => r. name ( ) ,
490
507
Self :: SpirV ( r) => r. name ( ) ,
491
508
Self :: Wasm ( r) => r. name ( ) ,
492
509
Self :: Bpf ( r) => r. name ( ) ,
@@ -513,6 +530,7 @@ impl InlineAsmRegClass {
513
530
Self :: LoongArch ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: LoongArch ) ,
514
531
Self :: Mips ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Mips ) ,
515
532
Self :: S390x ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: S390x ) ,
533
+ Self :: Sparc ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Sparc ) ,
516
534
Self :: SpirV ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: SpirV ) ,
517
535
Self :: Wasm ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Wasm ) ,
518
536
Self :: Bpf ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Bpf ) ,
@@ -542,6 +560,7 @@ impl InlineAsmRegClass {
542
560
Self :: LoongArch ( r) => r. suggest_modifier ( arch, ty) ,
543
561
Self :: Mips ( r) => r. suggest_modifier ( arch, ty) ,
544
562
Self :: S390x ( r) => r. suggest_modifier ( arch, ty) ,
563
+ Self :: Sparc ( r) => r. suggest_modifier ( arch, ty) ,
545
564
Self :: SpirV ( r) => r. suggest_modifier ( arch, ty) ,
546
565
Self :: Wasm ( r) => r. suggest_modifier ( arch, ty) ,
547
566
Self :: Bpf ( r) => r. suggest_modifier ( arch, ty) ,
@@ -571,6 +590,7 @@ impl InlineAsmRegClass {
571
590
Self :: LoongArch ( r) => r. default_modifier ( arch) ,
572
591
Self :: Mips ( r) => r. default_modifier ( arch) ,
573
592
Self :: S390x ( r) => r. default_modifier ( arch) ,
593
+ Self :: Sparc ( r) => r. default_modifier ( arch) ,
574
594
Self :: SpirV ( r) => r. default_modifier ( arch) ,
575
595
Self :: Wasm ( r) => r. default_modifier ( arch) ,
576
596
Self :: Bpf ( r) => r. default_modifier ( arch) ,
@@ -599,6 +619,7 @@ impl InlineAsmRegClass {
599
619
Self :: LoongArch ( r) => r. supported_types ( arch) ,
600
620
Self :: Mips ( r) => r. supported_types ( arch) ,
601
621
Self :: S390x ( r) => r. supported_types ( arch) ,
622
+ Self :: Sparc ( r) => r. supported_types ( arch) ,
602
623
Self :: SpirV ( r) => r. supported_types ( arch) ,
603
624
Self :: Wasm ( r) => r. supported_types ( arch) ,
604
625
Self :: Bpf ( r) => r. supported_types ( arch) ,
@@ -632,6 +653,9 @@ impl InlineAsmRegClass {
632
653
Self :: Mips ( MipsInlineAsmRegClass :: parse ( name) ?)
633
654
}
634
655
InlineAsmArch :: S390x => Self :: S390x ( S390xInlineAsmRegClass :: parse ( name) ?) ,
656
+ InlineAsmArch :: Sparc | InlineAsmArch :: Sparc64 => {
657
+ Self :: Sparc ( SparcInlineAsmRegClass :: parse ( name) ?)
658
+ }
635
659
InlineAsmArch :: SpirV => Self :: SpirV ( SpirVInlineAsmRegClass :: parse ( name) ?) ,
636
660
InlineAsmArch :: Wasm32 | InlineAsmArch :: Wasm64 => {
637
661
Self :: Wasm ( WasmInlineAsmRegClass :: parse ( name) ?)
@@ -658,6 +682,7 @@ impl InlineAsmRegClass {
658
682
Self :: LoongArch ( r) => r. valid_modifiers ( arch) ,
659
683
Self :: Mips ( r) => r. valid_modifiers ( arch) ,
660
684
Self :: S390x ( r) => r. valid_modifiers ( arch) ,
685
+ Self :: Sparc ( r) => r. valid_modifiers ( arch) ,
661
686
Self :: SpirV ( r) => r. valid_modifiers ( arch) ,
662
687
Self :: Wasm ( r) => r. valid_modifiers ( arch) ,
663
688
Self :: Bpf ( r) => r. valid_modifiers ( arch) ,
@@ -843,6 +868,11 @@ pub fn allocatable_registers(
843
868
s390x:: fill_reg_map ( arch, reloc_model, target_features, target, & mut map) ;
844
869
map
845
870
}
871
+ InlineAsmArch :: Sparc | InlineAsmArch :: Sparc64 => {
872
+ let mut map = sparc:: regclass_map ( ) ;
873
+ sparc:: fill_reg_map ( arch, reloc_model, target_features, target, & mut map) ;
874
+ map
875
+ }
846
876
InlineAsmArch :: SpirV => {
847
877
let mut map = spirv:: regclass_map ( ) ;
848
878
spirv:: fill_reg_map ( arch, reloc_model, target_features, target, & mut map) ;
0 commit comments