@@ -191,6 +191,7 @@ mod nvptx;
191191mod powerpc;
192192mod riscv;
193193mod s390x;
194+ mod sparc;
194195mod spirv;
195196mod wasm;
196197mod x86;
@@ -209,6 +210,7 @@ pub use nvptx::{NvptxInlineAsmReg, NvptxInlineAsmRegClass};
209210pub use powerpc:: { PowerPCInlineAsmReg , PowerPCInlineAsmRegClass } ;
210211pub use riscv:: { RiscVInlineAsmReg , RiscVInlineAsmRegClass } ;
211212pub use s390x:: { S390xInlineAsmReg , S390xInlineAsmRegClass } ;
213+ pub use sparc:: { SparcInlineAsmReg , SparcInlineAsmRegClass } ;
212214pub use spirv:: { SpirVInlineAsmReg , SpirVInlineAsmRegClass } ;
213215pub use wasm:: { WasmInlineAsmReg , WasmInlineAsmRegClass } ;
214216pub use x86:: { X86InlineAsmReg , X86InlineAsmRegClass } ;
@@ -230,6 +232,8 @@ pub enum InlineAsmArch {
230232 PowerPC ,
231233 PowerPC64 ,
232234 S390x ,
235+ Sparc ,
236+ Sparc64 ,
233237 SpirV ,
234238 Wasm32 ,
235239 Wasm64 ,
@@ -260,6 +264,8 @@ impl FromStr for InlineAsmArch {
260264 "mips" | "mips32r6" => Ok ( Self :: Mips ) ,
261265 "mips64" | "mips64r6" => Ok ( Self :: Mips64 ) ,
262266 "s390x" => Ok ( Self :: S390x ) ,
267+ "sparc" => Ok ( Self :: Sparc ) ,
268+ "sparc64" => Ok ( Self :: Sparc64 ) ,
263269 "spirv" => Ok ( Self :: SpirV ) ,
264270 "wasm32" => Ok ( Self :: Wasm32 ) ,
265271 "wasm64" => Ok ( Self :: Wasm64 ) ,
@@ -286,6 +292,7 @@ pub enum InlineAsmReg {
286292 LoongArch ( LoongArchInlineAsmReg ) ,
287293 Mips ( MipsInlineAsmReg ) ,
288294 S390x ( S390xInlineAsmReg ) ,
295+ Sparc ( SparcInlineAsmReg ) ,
289296 SpirV ( SpirVInlineAsmReg ) ,
290297 Wasm ( WasmInlineAsmReg ) ,
291298 Bpf ( BpfInlineAsmReg ) ,
@@ -309,6 +316,7 @@ impl InlineAsmReg {
309316 Self :: LoongArch ( r) => r. name ( ) ,
310317 Self :: Mips ( r) => r. name ( ) ,
311318 Self :: S390x ( r) => r. name ( ) ,
319+ Self :: Sparc ( r) => r. name ( ) ,
312320 Self :: Bpf ( r) => r. name ( ) ,
313321 Self :: Avr ( r) => r. name ( ) ,
314322 Self :: Msp430 ( r) => r. name ( ) ,
@@ -329,6 +337,7 @@ impl InlineAsmReg {
329337 Self :: LoongArch ( r) => InlineAsmRegClass :: LoongArch ( r. reg_class ( ) ) ,
330338 Self :: Mips ( r) => InlineAsmRegClass :: Mips ( r. reg_class ( ) ) ,
331339 Self :: S390x ( r) => InlineAsmRegClass :: S390x ( r. reg_class ( ) ) ,
340+ Self :: Sparc ( r) => InlineAsmRegClass :: Sparc ( r. reg_class ( ) ) ,
332341 Self :: Bpf ( r) => InlineAsmRegClass :: Bpf ( r. reg_class ( ) ) ,
333342 Self :: Avr ( r) => InlineAsmRegClass :: Avr ( r. reg_class ( ) ) ,
334343 Self :: Msp430 ( r) => InlineAsmRegClass :: Msp430 ( r. reg_class ( ) ) ,
@@ -361,6 +370,9 @@ impl InlineAsmReg {
361370 Self :: Mips ( MipsInlineAsmReg :: parse ( name) ?)
362371 }
363372 InlineAsmArch :: S390x => Self :: S390x ( S390xInlineAsmReg :: parse ( name) ?) ,
373+ InlineAsmArch :: Sparc | InlineAsmArch :: Sparc64 => {
374+ Self :: Sparc ( SparcInlineAsmReg :: parse ( name) ?)
375+ }
364376 InlineAsmArch :: SpirV => Self :: SpirV ( SpirVInlineAsmReg :: parse ( name) ?) ,
365377 InlineAsmArch :: Wasm32 | InlineAsmArch :: Wasm64 => {
366378 Self :: Wasm ( WasmInlineAsmReg :: parse ( name) ?)
@@ -393,6 +405,7 @@ impl InlineAsmReg {
393405 }
394406 Self :: Mips ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
395407 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) ,
396409 Self :: Bpf ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
397410 Self :: Avr ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
398411 Self :: Msp430 ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
@@ -420,6 +433,7 @@ impl InlineAsmReg {
420433 Self :: LoongArch ( r) => r. emit ( out, arch, modifier) ,
421434 Self :: Mips ( r) => r. emit ( out, arch, modifier) ,
422435 Self :: S390x ( r) => r. emit ( out, arch, modifier) ,
436+ Self :: Sparc ( r) => r. emit ( out, arch, modifier) ,
423437 Self :: Bpf ( r) => r. emit ( out, arch, modifier) ,
424438 Self :: Avr ( r) => r. emit ( out, arch, modifier) ,
425439 Self :: Msp430 ( r) => r. emit ( out, arch, modifier) ,
@@ -440,6 +454,7 @@ impl InlineAsmReg {
440454 Self :: LoongArch ( _) => cb ( self ) ,
441455 Self :: Mips ( _) => cb ( self ) ,
442456 Self :: S390x ( r) => r. overlapping_regs ( |r| cb ( Self :: S390x ( r) ) ) ,
457+ Self :: Sparc ( _) => cb ( self ) ,
443458 Self :: Bpf ( r) => r. overlapping_regs ( |r| cb ( Self :: Bpf ( r) ) ) ,
444459 Self :: Avr ( r) => r. overlapping_regs ( |r| cb ( Self :: Avr ( r) ) ) ,
445460 Self :: Msp430 ( _) => cb ( self ) ,
@@ -463,6 +478,7 @@ pub enum InlineAsmRegClass {
463478 LoongArch ( LoongArchInlineAsmRegClass ) ,
464479 Mips ( MipsInlineAsmRegClass ) ,
465480 S390x ( S390xInlineAsmRegClass ) ,
481+ Sparc ( SparcInlineAsmRegClass ) ,
466482 SpirV ( SpirVInlineAsmRegClass ) ,
467483 Wasm ( WasmInlineAsmRegClass ) ,
468484 Bpf ( BpfInlineAsmRegClass ) ,
@@ -487,6 +503,7 @@ impl InlineAsmRegClass {
487503 Self :: LoongArch ( r) => r. name ( ) ,
488504 Self :: Mips ( r) => r. name ( ) ,
489505 Self :: S390x ( r) => r. name ( ) ,
506+ Self :: Sparc ( r) => r. name ( ) ,
490507 Self :: SpirV ( r) => r. name ( ) ,
491508 Self :: Wasm ( r) => r. name ( ) ,
492509 Self :: Bpf ( r) => r. name ( ) ,
@@ -513,6 +530,7 @@ impl InlineAsmRegClass {
513530 Self :: LoongArch ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: LoongArch ) ,
514531 Self :: Mips ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Mips ) ,
515532 Self :: S390x ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: S390x ) ,
533+ Self :: Sparc ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Sparc ) ,
516534 Self :: SpirV ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: SpirV ) ,
517535 Self :: Wasm ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Wasm ) ,
518536 Self :: Bpf ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Bpf ) ,
@@ -542,6 +560,7 @@ impl InlineAsmRegClass {
542560 Self :: LoongArch ( r) => r. suggest_modifier ( arch, ty) ,
543561 Self :: Mips ( r) => r. suggest_modifier ( arch, ty) ,
544562 Self :: S390x ( r) => r. suggest_modifier ( arch, ty) ,
563+ Self :: Sparc ( r) => r. suggest_modifier ( arch, ty) ,
545564 Self :: SpirV ( r) => r. suggest_modifier ( arch, ty) ,
546565 Self :: Wasm ( r) => r. suggest_modifier ( arch, ty) ,
547566 Self :: Bpf ( r) => r. suggest_modifier ( arch, ty) ,
@@ -571,6 +590,7 @@ impl InlineAsmRegClass {
571590 Self :: LoongArch ( r) => r. default_modifier ( arch) ,
572591 Self :: Mips ( r) => r. default_modifier ( arch) ,
573592 Self :: S390x ( r) => r. default_modifier ( arch) ,
593+ Self :: Sparc ( r) => r. default_modifier ( arch) ,
574594 Self :: SpirV ( r) => r. default_modifier ( arch) ,
575595 Self :: Wasm ( r) => r. default_modifier ( arch) ,
576596 Self :: Bpf ( r) => r. default_modifier ( arch) ,
@@ -599,6 +619,7 @@ impl InlineAsmRegClass {
599619 Self :: LoongArch ( r) => r. supported_types ( arch) ,
600620 Self :: Mips ( r) => r. supported_types ( arch) ,
601621 Self :: S390x ( r) => r. supported_types ( arch) ,
622+ Self :: Sparc ( r) => r. supported_types ( arch) ,
602623 Self :: SpirV ( r) => r. supported_types ( arch) ,
603624 Self :: Wasm ( r) => r. supported_types ( arch) ,
604625 Self :: Bpf ( r) => r. supported_types ( arch) ,
@@ -632,6 +653,9 @@ impl InlineAsmRegClass {
632653 Self :: Mips ( MipsInlineAsmRegClass :: parse ( name) ?)
633654 }
634655 InlineAsmArch :: S390x => Self :: S390x ( S390xInlineAsmRegClass :: parse ( name) ?) ,
656+ InlineAsmArch :: Sparc | InlineAsmArch :: Sparc64 => {
657+ Self :: Sparc ( SparcInlineAsmRegClass :: parse ( name) ?)
658+ }
635659 InlineAsmArch :: SpirV => Self :: SpirV ( SpirVInlineAsmRegClass :: parse ( name) ?) ,
636660 InlineAsmArch :: Wasm32 | InlineAsmArch :: Wasm64 => {
637661 Self :: Wasm ( WasmInlineAsmRegClass :: parse ( name) ?)
@@ -658,6 +682,7 @@ impl InlineAsmRegClass {
658682 Self :: LoongArch ( r) => r. valid_modifiers ( arch) ,
659683 Self :: Mips ( r) => r. valid_modifiers ( arch) ,
660684 Self :: S390x ( r) => r. valid_modifiers ( arch) ,
685+ Self :: Sparc ( r) => r. valid_modifiers ( arch) ,
661686 Self :: SpirV ( r) => r. valid_modifiers ( arch) ,
662687 Self :: Wasm ( r) => r. valid_modifiers ( arch) ,
663688 Self :: Bpf ( r) => r. valid_modifiers ( arch) ,
@@ -843,6 +868,11 @@ pub fn allocatable_registers(
843868 s390x:: fill_reg_map ( arch, reloc_model, target_features, target, & mut map) ;
844869 map
845870 }
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+ }
846876 InlineAsmArch :: SpirV => {
847877 let mut map = spirv:: regclass_map ( ) ;
848878 spirv:: fill_reg_map ( arch, reloc_model, target_features, target, & mut map) ;
0 commit comments