@@ -194,6 +194,7 @@ mod sparc;
194194mod spirv;
195195mod wasm;
196196mod x86;
197+ mod xtensa;
197198
198199pub use aarch64:: { AArch64InlineAsmReg , AArch64InlineAsmRegClass } ;
199200pub use arm:: { ArmInlineAsmReg , ArmInlineAsmRegClass } ;
@@ -213,6 +214,7 @@ pub use sparc::{SparcInlineAsmReg, SparcInlineAsmRegClass};
213214pub use spirv:: { SpirVInlineAsmReg , SpirVInlineAsmRegClass } ;
214215pub use wasm:: { WasmInlineAsmReg , WasmInlineAsmRegClass } ;
215216pub use x86:: { X86InlineAsmReg , X86InlineAsmRegClass } ;
217+ pub use xtensa:: { XtensaInlineAsmReg , XtensaInlineAsmRegClass } ;
216218
217219#[ derive( Copy , Clone , Encodable , Decodable , Debug , Eq , PartialEq , Hash ) ]
218220pub enum InlineAsmArch {
@@ -237,6 +239,7 @@ pub enum InlineAsmArch {
237239 SpirV ,
238240 Wasm32 ,
239241 Wasm64 ,
242+ Xtensa ,
240243 Bpf ,
241244 Avr ,
242245 Msp430 ,
@@ -273,7 +276,8 @@ impl InlineAsmArch {
273276 Arch :: Msp430 => Some ( Self :: Msp430 ) ,
274277 Arch :: M68k => Some ( Self :: M68k ) ,
275278 Arch :: CSky => Some ( Self :: CSKY ) ,
276- Arch :: AmdGpu | Arch :: Xtensa | Arch :: Other ( _) => None ,
279+ Arch :: Xtensa => Some ( Self :: Xtensa ) ,
280+ Arch :: AmdGpu | Arch :: Other ( _) => None ,
277281 }
278282 }
279283}
@@ -294,6 +298,7 @@ pub enum InlineAsmReg {
294298 Sparc ( SparcInlineAsmReg ) ,
295299 SpirV ( SpirVInlineAsmReg ) ,
296300 Wasm ( WasmInlineAsmReg ) ,
301+ Xtensa ( XtensaInlineAsmReg ) ,
297302 Bpf ( BpfInlineAsmReg ) ,
298303 Avr ( AvrInlineAsmReg ) ,
299304 Msp430 ( Msp430InlineAsmReg ) ,
@@ -316,6 +321,7 @@ impl InlineAsmReg {
316321 Self :: Mips ( r) => r. name ( ) ,
317322 Self :: S390x ( r) => r. name ( ) ,
318323 Self :: Sparc ( r) => r. name ( ) ,
324+ Self :: Xtensa ( r) => r. name ( ) ,
319325 Self :: Bpf ( r) => r. name ( ) ,
320326 Self :: Avr ( r) => r. name ( ) ,
321327 Self :: Msp430 ( r) => r. name ( ) ,
@@ -337,6 +343,7 @@ impl InlineAsmReg {
337343 Self :: Mips ( r) => InlineAsmRegClass :: Mips ( r. reg_class ( ) ) ,
338344 Self :: S390x ( r) => InlineAsmRegClass :: S390x ( r. reg_class ( ) ) ,
339345 Self :: Sparc ( r) => InlineAsmRegClass :: Sparc ( r. reg_class ( ) ) ,
346+ Self :: Xtensa ( r) => InlineAsmRegClass :: Xtensa ( r. reg_class ( ) ) ,
340347 Self :: Bpf ( r) => InlineAsmRegClass :: Bpf ( r. reg_class ( ) ) ,
341348 Self :: Avr ( r) => InlineAsmRegClass :: Avr ( r. reg_class ( ) ) ,
342349 Self :: Msp430 ( r) => InlineAsmRegClass :: Msp430 ( r. reg_class ( ) ) ,
@@ -370,6 +377,7 @@ impl InlineAsmReg {
370377 InlineAsmArch :: Mips | InlineAsmArch :: Mips64 => {
371378 Self :: Mips ( MipsInlineAsmReg :: parse ( name) ?)
372379 }
380+ InlineAsmArch :: Xtensa => Self :: Xtensa ( XtensaInlineAsmReg :: parse ( name) ?) ,
373381 InlineAsmArch :: S390x => Self :: S390x ( S390xInlineAsmReg :: parse ( name) ?) ,
374382 InlineAsmArch :: Sparc | InlineAsmArch :: Sparc64 => {
375383 Self :: Sparc ( SparcInlineAsmReg :: parse ( name) ?)
@@ -409,6 +417,7 @@ impl InlineAsmReg {
409417 Self :: Sparc ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
410418 Self :: Bpf ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
411419 Self :: Avr ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
420+ Self :: Xtensa ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
412421 Self :: Msp430 ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
413422 Self :: M68k ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
414423 Self :: CSKY ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
@@ -435,6 +444,7 @@ impl InlineAsmReg {
435444 Self :: Mips ( r) => r. emit ( out, arch, modifier) ,
436445 Self :: S390x ( r) => r. emit ( out, arch, modifier) ,
437446 Self :: Sparc ( r) => r. emit ( out, arch, modifier) ,
447+ Self :: Xtensa ( r) => r. emit ( out, arch, modifier) ,
438448 Self :: Bpf ( r) => r. emit ( out, arch, modifier) ,
439449 Self :: Avr ( r) => r. emit ( out, arch, modifier) ,
440450 Self :: Msp430 ( r) => r. emit ( out, arch, modifier) ,
@@ -456,6 +466,7 @@ impl InlineAsmReg {
456466 Self :: Mips ( _) => cb ( self ) ,
457467 Self :: S390x ( r) => r. overlapping_regs ( |r| cb ( Self :: S390x ( r) ) ) ,
458468 Self :: Sparc ( _) => cb ( self ) ,
469+ Self :: Xtensa ( _) => cb ( self ) ,
459470 Self :: Bpf ( r) => r. overlapping_regs ( |r| cb ( Self :: Bpf ( r) ) ) ,
460471 Self :: Avr ( r) => r. overlapping_regs ( |r| cb ( Self :: Avr ( r) ) ) ,
461472 Self :: Msp430 ( _) => cb ( self ) ,
@@ -482,6 +493,7 @@ pub enum InlineAsmRegClass {
482493 Sparc ( SparcInlineAsmRegClass ) ,
483494 SpirV ( SpirVInlineAsmRegClass ) ,
484495 Wasm ( WasmInlineAsmRegClass ) ,
496+ Xtensa ( XtensaInlineAsmRegClass ) ,
485497 Bpf ( BpfInlineAsmRegClass ) ,
486498 Avr ( AvrInlineAsmRegClass ) ,
487499 Msp430 ( Msp430InlineAsmRegClass ) ,
@@ -507,6 +519,7 @@ impl InlineAsmRegClass {
507519 Self :: Sparc ( r) => r. name ( ) ,
508520 Self :: SpirV ( r) => r. name ( ) ,
509521 Self :: Wasm ( r) => r. name ( ) ,
522+ Self :: Xtensa ( r) => r. name ( ) ,
510523 Self :: Bpf ( r) => r. name ( ) ,
511524 Self :: Avr ( r) => r. name ( ) ,
512525 Self :: Msp430 ( r) => r. name ( ) ,
@@ -534,6 +547,7 @@ impl InlineAsmRegClass {
534547 Self :: Sparc ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Sparc ) ,
535548 Self :: SpirV ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: SpirV ) ,
536549 Self :: Wasm ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Wasm ) ,
550+ Self :: Xtensa ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Xtensa ) ,
537551 Self :: Bpf ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Bpf ) ,
538552 Self :: Avr ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Avr ) ,
539553 Self :: Msp430 ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Msp430 ) ,
@@ -564,6 +578,7 @@ impl InlineAsmRegClass {
564578 Self :: Sparc ( r) => r. suggest_modifier ( arch, ty) ,
565579 Self :: SpirV ( r) => r. suggest_modifier ( arch, ty) ,
566580 Self :: Wasm ( r) => r. suggest_modifier ( arch, ty) ,
581+ Self :: Xtensa ( r) => r. suggest_modifier ( arch, ty) ,
567582 Self :: Bpf ( r) => r. suggest_modifier ( arch, ty) ,
568583 Self :: Avr ( r) => r. suggest_modifier ( arch, ty) ,
569584 Self :: Msp430 ( r) => r. suggest_modifier ( arch, ty) ,
@@ -594,6 +609,7 @@ impl InlineAsmRegClass {
594609 Self :: Sparc ( r) => r. default_modifier ( arch) ,
595610 Self :: SpirV ( r) => r. default_modifier ( arch) ,
596611 Self :: Wasm ( r) => r. default_modifier ( arch) ,
612+ Self :: Xtensa ( r) => r. default_modifier ( arch) ,
597613 Self :: Bpf ( r) => r. default_modifier ( arch) ,
598614 Self :: Avr ( r) => r. default_modifier ( arch) ,
599615 Self :: Msp430 ( r) => r. default_modifier ( arch) ,
@@ -627,6 +643,7 @@ impl InlineAsmRegClass {
627643 Self :: Sparc ( r) => r. supported_types ( arch) ,
628644 Self :: SpirV ( r) => r. supported_types ( arch) ,
629645 Self :: Wasm ( r) => r. supported_types ( arch) ,
646+ Self :: Xtensa ( r) => r. supported_types ( arch) ,
630647 Self :: Bpf ( r) => r. supported_types ( arch) ,
631648 Self :: Avr ( r) => r. supported_types ( arch) ,
632649 Self :: Msp430 ( r) => r. supported_types ( arch) ,
@@ -669,6 +686,7 @@ impl InlineAsmRegClass {
669686 }
670687 InlineAsmArch :: Bpf => Self :: Bpf ( BpfInlineAsmRegClass :: parse ( name) ?) ,
671688 InlineAsmArch :: Avr => Self :: Avr ( AvrInlineAsmRegClass :: parse ( name) ?) ,
689+ InlineAsmArch :: Xtensa => Self :: Xtensa ( XtensaInlineAsmRegClass :: parse ( name) ?) ,
672690 InlineAsmArch :: Msp430 => Self :: Msp430 ( Msp430InlineAsmRegClass :: parse ( name) ?) ,
673691 InlineAsmArch :: M68k => Self :: M68k ( M68kInlineAsmRegClass :: parse ( name) ?) ,
674692 InlineAsmArch :: CSKY => Self :: CSKY ( CSKYInlineAsmRegClass :: parse ( name) ?) ,
@@ -692,6 +710,7 @@ impl InlineAsmRegClass {
692710 Self :: Sparc ( r) => r. valid_modifiers ( arch) ,
693711 Self :: SpirV ( r) => r. valid_modifiers ( arch) ,
694712 Self :: Wasm ( r) => r. valid_modifiers ( arch) ,
713+ Self :: Xtensa ( r) => r. valid_modifiers ( arch) ,
695714 Self :: Bpf ( r) => r. valid_modifiers ( arch) ,
696715 Self :: Avr ( r) => r. valid_modifiers ( arch) ,
697716 Self :: Msp430 ( r) => r. valid_modifiers ( arch) ,
@@ -893,6 +912,11 @@ pub fn allocatable_registers(
893912 wasm:: fill_reg_map ( arch, reloc_model, target_features, target, & mut map) ;
894913 map
895914 }
915+ InlineAsmArch :: Xtensa => {
916+ let mut map = xtensa:: regclass_map ( ) ;
917+ xtensa:: fill_reg_map ( arch, reloc_model, target_features, target, & mut map) ;
918+ map
919+ }
896920 InlineAsmArch :: Bpf => {
897921 let mut map = bpf:: regclass_map ( ) ;
898922 bpf:: fill_reg_map ( arch, reloc_model, target_features, target, & mut map) ;
0 commit comments