@@ -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 ,
@@ -294,6 +297,7 @@ pub enum InlineAsmReg {
294297 Sparc ( SparcInlineAsmReg ) ,
295298 SpirV ( SpirVInlineAsmReg ) ,
296299 Wasm ( WasmInlineAsmReg ) ,
300+ Xtensa ( XtensaInlineAsmReg ) ,
297301 Bpf ( BpfInlineAsmReg ) ,
298302 Avr ( AvrInlineAsmReg ) ,
299303 Msp430 ( Msp430InlineAsmReg ) ,
@@ -316,6 +320,7 @@ impl InlineAsmReg {
316320 Self :: Mips ( r) => r. name ( ) ,
317321 Self :: S390x ( r) => r. name ( ) ,
318322 Self :: Sparc ( r) => r. name ( ) ,
323+ Self :: Xtensa ( r) => r. name ( ) ,
319324 Self :: Bpf ( r) => r. name ( ) ,
320325 Self :: Avr ( r) => r. name ( ) ,
321326 Self :: Msp430 ( r) => r. name ( ) ,
@@ -337,6 +342,7 @@ impl InlineAsmReg {
337342 Self :: Mips ( r) => InlineAsmRegClass :: Mips ( r. reg_class ( ) ) ,
338343 Self :: S390x ( r) => InlineAsmRegClass :: S390x ( r. reg_class ( ) ) ,
339344 Self :: Sparc ( r) => InlineAsmRegClass :: Sparc ( r. reg_class ( ) ) ,
345+ Self :: Xtensa ( r) => InlineAsmRegClass :: Xtensa ( r. reg_class ( ) ) ,
340346 Self :: Bpf ( r) => InlineAsmRegClass :: Bpf ( r. reg_class ( ) ) ,
341347 Self :: Avr ( r) => InlineAsmRegClass :: Avr ( r. reg_class ( ) ) ,
342348 Self :: Msp430 ( r) => InlineAsmRegClass :: Msp430 ( r. reg_class ( ) ) ,
@@ -370,6 +376,7 @@ impl InlineAsmReg {
370376 InlineAsmArch :: Mips | InlineAsmArch :: Mips64 => {
371377 Self :: Mips ( MipsInlineAsmReg :: parse ( name) ?)
372378 }
379+ InlineAsmArch :: Xtensa => Self :: Xtensa ( XtensaInlineAsmReg :: parse ( name) ?) ,
373380 InlineAsmArch :: S390x => Self :: S390x ( S390xInlineAsmReg :: parse ( name) ?) ,
374381 InlineAsmArch :: Sparc | InlineAsmArch :: Sparc64 => {
375382 Self :: Sparc ( SparcInlineAsmReg :: parse ( name) ?)
@@ -409,6 +416,7 @@ impl InlineAsmReg {
409416 Self :: Sparc ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
410417 Self :: Bpf ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
411418 Self :: Avr ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
419+ Self :: Xtensa ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
412420 Self :: Msp430 ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
413421 Self :: M68k ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
414422 Self :: CSKY ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
@@ -435,6 +443,7 @@ impl InlineAsmReg {
435443 Self :: Mips ( r) => r. emit ( out, arch, modifier) ,
436444 Self :: S390x ( r) => r. emit ( out, arch, modifier) ,
437445 Self :: Sparc ( r) => r. emit ( out, arch, modifier) ,
446+ Self :: Xtensa ( r) => r. emit ( out, arch, modifier) ,
438447 Self :: Bpf ( r) => r. emit ( out, arch, modifier) ,
439448 Self :: Avr ( r) => r. emit ( out, arch, modifier) ,
440449 Self :: Msp430 ( r) => r. emit ( out, arch, modifier) ,
@@ -456,6 +465,7 @@ impl InlineAsmReg {
456465 Self :: Mips ( _) => cb ( self ) ,
457466 Self :: S390x ( r) => r. overlapping_regs ( |r| cb ( Self :: S390x ( r) ) ) ,
458467 Self :: Sparc ( _) => cb ( self ) ,
468+ Self :: Xtensa ( _) => cb ( self ) ,
459469 Self :: Bpf ( r) => r. overlapping_regs ( |r| cb ( Self :: Bpf ( r) ) ) ,
460470 Self :: Avr ( r) => r. overlapping_regs ( |r| cb ( Self :: Avr ( r) ) ) ,
461471 Self :: Msp430 ( _) => cb ( self ) ,
@@ -482,6 +492,7 @@ pub enum InlineAsmRegClass {
482492 Sparc ( SparcInlineAsmRegClass ) ,
483493 SpirV ( SpirVInlineAsmRegClass ) ,
484494 Wasm ( WasmInlineAsmRegClass ) ,
495+ Xtensa ( XtensaInlineAsmRegClass ) ,
485496 Bpf ( BpfInlineAsmRegClass ) ,
486497 Avr ( AvrInlineAsmRegClass ) ,
487498 Msp430 ( Msp430InlineAsmRegClass ) ,
@@ -507,6 +518,7 @@ impl InlineAsmRegClass {
507518 Self :: Sparc ( r) => r. name ( ) ,
508519 Self :: SpirV ( r) => r. name ( ) ,
509520 Self :: Wasm ( r) => r. name ( ) ,
521+ Self :: Xtensa ( r) => r. name ( ) ,
510522 Self :: Bpf ( r) => r. name ( ) ,
511523 Self :: Avr ( r) => r. name ( ) ,
512524 Self :: Msp430 ( r) => r. name ( ) ,
@@ -534,6 +546,7 @@ impl InlineAsmRegClass {
534546 Self :: Sparc ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Sparc ) ,
535547 Self :: SpirV ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: SpirV ) ,
536548 Self :: Wasm ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Wasm ) ,
549+ Self :: Xtensa ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Xtensa ) ,
537550 Self :: Bpf ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Bpf ) ,
538551 Self :: Avr ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Avr ) ,
539552 Self :: Msp430 ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Msp430 ) ,
@@ -564,6 +577,7 @@ impl InlineAsmRegClass {
564577 Self :: Sparc ( r) => r. suggest_modifier ( arch, ty) ,
565578 Self :: SpirV ( r) => r. suggest_modifier ( arch, ty) ,
566579 Self :: Wasm ( r) => r. suggest_modifier ( arch, ty) ,
580+ Self :: Xtensa ( r) => r. suggest_modifier ( arch, ty) ,
567581 Self :: Bpf ( r) => r. suggest_modifier ( arch, ty) ,
568582 Self :: Avr ( r) => r. suggest_modifier ( arch, ty) ,
569583 Self :: Msp430 ( r) => r. suggest_modifier ( arch, ty) ,
@@ -594,6 +608,7 @@ impl InlineAsmRegClass {
594608 Self :: Sparc ( r) => r. default_modifier ( arch) ,
595609 Self :: SpirV ( r) => r. default_modifier ( arch) ,
596610 Self :: Wasm ( r) => r. default_modifier ( arch) ,
611+ Self :: Xtensa ( r) => r. default_modifier ( arch) ,
597612 Self :: Bpf ( r) => r. default_modifier ( arch) ,
598613 Self :: Avr ( r) => r. default_modifier ( arch) ,
599614 Self :: Msp430 ( r) => r. default_modifier ( arch) ,
@@ -627,6 +642,7 @@ impl InlineAsmRegClass {
627642 Self :: Sparc ( r) => r. supported_types ( arch) ,
628643 Self :: SpirV ( r) => r. supported_types ( arch) ,
629644 Self :: Wasm ( r) => r. supported_types ( arch) ,
645+ Self :: Xtensa ( r) => r. supported_types ( arch) ,
630646 Self :: Bpf ( r) => r. supported_types ( arch) ,
631647 Self :: Avr ( r) => r. supported_types ( arch) ,
632648 Self :: Msp430 ( r) => r. supported_types ( arch) ,
@@ -669,6 +685,7 @@ impl InlineAsmRegClass {
669685 }
670686 InlineAsmArch :: Bpf => Self :: Bpf ( BpfInlineAsmRegClass :: parse ( name) ?) ,
671687 InlineAsmArch :: Avr => Self :: Avr ( AvrInlineAsmRegClass :: parse ( name) ?) ,
688+ InlineAsmArch :: Xtensa => Self :: Xtensa ( XtensaInlineAsmRegClass :: parse ( name) ?) ,
672689 InlineAsmArch :: Msp430 => Self :: Msp430 ( Msp430InlineAsmRegClass :: parse ( name) ?) ,
673690 InlineAsmArch :: M68k => Self :: M68k ( M68kInlineAsmRegClass :: parse ( name) ?) ,
674691 InlineAsmArch :: CSKY => Self :: CSKY ( CSKYInlineAsmRegClass :: parse ( name) ?) ,
@@ -692,6 +709,7 @@ impl InlineAsmRegClass {
692709 Self :: Sparc ( r) => r. valid_modifiers ( arch) ,
693710 Self :: SpirV ( r) => r. valid_modifiers ( arch) ,
694711 Self :: Wasm ( r) => r. valid_modifiers ( arch) ,
712+ Self :: Xtensa ( r) => r. valid_modifiers ( arch) ,
695713 Self :: Bpf ( r) => r. valid_modifiers ( arch) ,
696714 Self :: Avr ( r) => r. valid_modifiers ( arch) ,
697715 Self :: Msp430 ( r) => r. valid_modifiers ( arch) ,
@@ -893,6 +911,11 @@ pub fn allocatable_registers(
893911 wasm:: fill_reg_map ( arch, reloc_model, target_features, target, & mut map) ;
894912 map
895913 }
914+ InlineAsmArch :: Xtensa => {
915+ let mut map = xtensa:: regclass_map ( ) ;
916+ xtensa:: fill_reg_map ( arch, reloc_model, target_features, target, & mut map) ;
917+ map
918+ }
896919 InlineAsmArch :: Bpf => {
897920 let mut map = bpf:: regclass_map ( ) ;
898921 bpf:: fill_reg_map ( arch, reloc_model, target_features, target, & mut map) ;
0 commit comments