@@ -195,6 +195,7 @@ mod sparc;
195195mod spirv;
196196mod wasm;
197197mod x86;
198+ mod xtensa;
198199
199200pub use aarch64:: { AArch64InlineAsmReg , AArch64InlineAsmRegClass } ;
200201pub use arm:: { ArmInlineAsmReg , ArmInlineAsmRegClass } ;
@@ -213,6 +214,7 @@ pub use s390x::{S390xInlineAsmReg, S390xInlineAsmRegClass};
213214pub use sparc:: { SparcInlineAsmReg , SparcInlineAsmRegClass } ;
214215pub use spirv:: { SpirVInlineAsmReg , SpirVInlineAsmRegClass } ;
215216pub use wasm:: { WasmInlineAsmReg , WasmInlineAsmRegClass } ;
217+ pub use xtensa:: { XtensaInlineAsmReg , XtensaInlineAsmRegClass } ;
216218pub use x86:: { X86InlineAsmReg , X86InlineAsmRegClass } ;
217219
218220#[ derive( Copy , Clone , Encodable , Decodable , Debug , Eq , PartialEq , Hash ) ]
@@ -238,6 +240,7 @@ pub enum InlineAsmArch {
238240 SpirV ,
239241 Wasm32 ,
240242 Wasm64 ,
243+ Xtensa ,
241244 Bpf ,
242245 Avr ,
243246 Msp430 ,
@@ -271,6 +274,7 @@ impl FromStr for InlineAsmArch {
271274 "spirv" => Ok ( Self :: SpirV ) ,
272275 "wasm32" => Ok ( Self :: Wasm32 ) ,
273276 "wasm64" => Ok ( Self :: Wasm64 ) ,
277+ "xtensa" => Ok ( Self :: Xtensa ) ,
274278 "bpf" => Ok ( Self :: Bpf ) ,
275279 "avr" => Ok ( Self :: Avr ) ,
276280 "msp430" => Ok ( Self :: Msp430 ) ,
@@ -297,6 +301,7 @@ pub enum InlineAsmReg {
297301 Sparc ( SparcInlineAsmReg ) ,
298302 SpirV ( SpirVInlineAsmReg ) ,
299303 Wasm ( WasmInlineAsmReg ) ,
304+ Xtensa ( XtensaInlineAsmReg ) ,
300305 Bpf ( BpfInlineAsmReg ) ,
301306 Avr ( AvrInlineAsmReg ) ,
302307 Msp430 ( Msp430InlineAsmReg ) ,
@@ -319,6 +324,7 @@ impl InlineAsmReg {
319324 Self :: Mips ( r) => r. name ( ) ,
320325 Self :: S390x ( r) => r. name ( ) ,
321326 Self :: Sparc ( r) => r. name ( ) ,
327+ Self :: Xtensa ( r) => r. name ( ) ,
322328 Self :: Bpf ( r) => r. name ( ) ,
323329 Self :: Avr ( r) => r. name ( ) ,
324330 Self :: Msp430 ( r) => r. name ( ) ,
@@ -340,6 +346,7 @@ impl InlineAsmReg {
340346 Self :: Mips ( r) => InlineAsmRegClass :: Mips ( r. reg_class ( ) ) ,
341347 Self :: S390x ( r) => InlineAsmRegClass :: S390x ( r. reg_class ( ) ) ,
342348 Self :: Sparc ( r) => InlineAsmRegClass :: Sparc ( r. reg_class ( ) ) ,
349+ Self :: Xtensa ( r) => InlineAsmRegClass :: Xtensa ( r. reg_class ( ) ) ,
343350 Self :: Bpf ( r) => InlineAsmRegClass :: Bpf ( r. reg_class ( ) ) ,
344351 Self :: Avr ( r) => InlineAsmRegClass :: Avr ( r. reg_class ( ) ) ,
345352 Self :: Msp430 ( r) => InlineAsmRegClass :: Msp430 ( r. reg_class ( ) ) ,
@@ -373,6 +380,9 @@ impl InlineAsmReg {
373380 InlineAsmArch :: Mips | InlineAsmArch :: Mips64 => {
374381 Self :: Mips ( MipsInlineAsmReg :: parse ( name) ?)
375382 }
383+ InlineAsmArch :: Xtensa => {
384+ Self :: Xtensa ( XtensaInlineAsmReg :: parse ( name) ?)
385+ }
376386 InlineAsmArch :: S390x => Self :: S390x ( S390xInlineAsmReg :: parse ( name) ?) ,
377387 InlineAsmArch :: Sparc | InlineAsmArch :: Sparc64 => {
378388 Self :: Sparc ( SparcInlineAsmReg :: parse ( name) ?)
@@ -412,6 +422,7 @@ impl InlineAsmReg {
412422 Self :: Sparc ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
413423 Self :: Bpf ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
414424 Self :: Avr ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
425+ Self :: Xtensa ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
415426 Self :: Msp430 ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
416427 Self :: M68k ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
417428 Self :: CSKY ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
@@ -438,6 +449,7 @@ impl InlineAsmReg {
438449 Self :: Mips ( r) => r. emit ( out, arch, modifier) ,
439450 Self :: S390x ( r) => r. emit ( out, arch, modifier) ,
440451 Self :: Sparc ( r) => r. emit ( out, arch, modifier) ,
452+ Self :: Xtensa ( r) => r. emit ( out, arch, modifier) ,
441453 Self :: Bpf ( r) => r. emit ( out, arch, modifier) ,
442454 Self :: Avr ( r) => r. emit ( out, arch, modifier) ,
443455 Self :: Msp430 ( r) => r. emit ( out, arch, modifier) ,
@@ -459,6 +471,7 @@ impl InlineAsmReg {
459471 Self :: Mips ( _) => cb ( self ) ,
460472 Self :: S390x ( r) => r. overlapping_regs ( |r| cb ( Self :: S390x ( r) ) ) ,
461473 Self :: Sparc ( _) => cb ( self ) ,
474+ Self :: Xtensa ( _) => cb ( self ) ,
462475 Self :: Bpf ( r) => r. overlapping_regs ( |r| cb ( Self :: Bpf ( r) ) ) ,
463476 Self :: Avr ( r) => r. overlapping_regs ( |r| cb ( Self :: Avr ( r) ) ) ,
464477 Self :: Msp430 ( _) => cb ( self ) ,
@@ -485,6 +498,7 @@ pub enum InlineAsmRegClass {
485498 Sparc ( SparcInlineAsmRegClass ) ,
486499 SpirV ( SpirVInlineAsmRegClass ) ,
487500 Wasm ( WasmInlineAsmRegClass ) ,
501+ Xtensa ( XtensaInlineAsmRegClass ) ,
488502 Bpf ( BpfInlineAsmRegClass ) ,
489503 Avr ( AvrInlineAsmRegClass ) ,
490504 Msp430 ( Msp430InlineAsmRegClass ) ,
@@ -510,6 +524,7 @@ impl InlineAsmRegClass {
510524 Self :: Sparc ( r) => r. name ( ) ,
511525 Self :: SpirV ( r) => r. name ( ) ,
512526 Self :: Wasm ( r) => r. name ( ) ,
527+ Self :: Xtensa ( r) => r. name ( ) ,
513528 Self :: Bpf ( r) => r. name ( ) ,
514529 Self :: Avr ( r) => r. name ( ) ,
515530 Self :: Msp430 ( r) => r. name ( ) ,
@@ -537,6 +552,7 @@ impl InlineAsmRegClass {
537552 Self :: Sparc ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Sparc ) ,
538553 Self :: SpirV ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: SpirV ) ,
539554 Self :: Wasm ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Wasm ) ,
555+ Self :: Xtensa ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Xtensa ) ,
540556 Self :: Bpf ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Bpf ) ,
541557 Self :: Avr ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Avr ) ,
542558 Self :: Msp430 ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Msp430 ) ,
@@ -567,6 +583,7 @@ impl InlineAsmRegClass {
567583 Self :: Sparc ( r) => r. suggest_modifier ( arch, ty) ,
568584 Self :: SpirV ( r) => r. suggest_modifier ( arch, ty) ,
569585 Self :: Wasm ( r) => r. suggest_modifier ( arch, ty) ,
586+ Self :: Xtensa ( r) => r. suggest_modifier ( arch, ty) ,
570587 Self :: Bpf ( r) => r. suggest_modifier ( arch, ty) ,
571588 Self :: Avr ( r) => r. suggest_modifier ( arch, ty) ,
572589 Self :: Msp430 ( r) => r. suggest_modifier ( arch, ty) ,
@@ -597,6 +614,7 @@ impl InlineAsmRegClass {
597614 Self :: Sparc ( r) => r. default_modifier ( arch) ,
598615 Self :: SpirV ( r) => r. default_modifier ( arch) ,
599616 Self :: Wasm ( r) => r. default_modifier ( arch) ,
617+ Self :: Xtensa ( r) => r. default_modifier ( arch) ,
600618 Self :: Bpf ( r) => r. default_modifier ( arch) ,
601619 Self :: Avr ( r) => r. default_modifier ( arch) ,
602620 Self :: Msp430 ( r) => r. default_modifier ( arch) ,
@@ -630,6 +648,7 @@ impl InlineAsmRegClass {
630648 Self :: Sparc ( r) => r. supported_types ( arch) ,
631649 Self :: SpirV ( r) => r. supported_types ( arch) ,
632650 Self :: Wasm ( r) => r. supported_types ( arch) ,
651+ Self :: Xtensa ( r) => r. supported_types ( arch) ,
633652 Self :: Bpf ( r) => r. supported_types ( arch) ,
634653 Self :: Avr ( r) => r. supported_types ( arch) ,
635654 Self :: Msp430 ( r) => r. supported_types ( arch) ,
@@ -672,6 +691,7 @@ impl InlineAsmRegClass {
672691 }
673692 InlineAsmArch :: Bpf => Self :: Bpf ( BpfInlineAsmRegClass :: parse ( name) ?) ,
674693 InlineAsmArch :: Avr => Self :: Avr ( AvrInlineAsmRegClass :: parse ( name) ?) ,
694+ InlineAsmArch :: Xtensa => Self :: Xtensa ( XtensaInlineAsmRegClass :: parse ( name) ?) ,
675695 InlineAsmArch :: Msp430 => Self :: Msp430 ( Msp430InlineAsmRegClass :: parse ( name) ?) ,
676696 InlineAsmArch :: M68k => Self :: M68k ( M68kInlineAsmRegClass :: parse ( name) ?) ,
677697 InlineAsmArch :: CSKY => Self :: CSKY ( CSKYInlineAsmRegClass :: parse ( name) ?) ,
@@ -695,6 +715,7 @@ impl InlineAsmRegClass {
695715 Self :: Sparc ( r) => r. valid_modifiers ( arch) ,
696716 Self :: SpirV ( r) => r. valid_modifiers ( arch) ,
697717 Self :: Wasm ( r) => r. valid_modifiers ( arch) ,
718+ Self :: Xtensa ( r) => r. valid_modifiers ( arch) ,
698719 Self :: Bpf ( r) => r. valid_modifiers ( arch) ,
699720 Self :: Avr ( r) => r. valid_modifiers ( arch) ,
700721 Self :: Msp430 ( r) => r. valid_modifiers ( arch) ,
@@ -896,6 +917,11 @@ pub fn allocatable_registers(
896917 wasm:: fill_reg_map ( arch, reloc_model, target_features, target, & mut map) ;
897918 map
898919 }
920+ InlineAsmArch :: Xtensa => {
921+ let mut map = xtensa:: regclass_map ( ) ;
922+ xtensa:: fill_reg_map ( arch, reloc_model, target_features, target, & mut map) ;
923+ map
924+ }
899925 InlineAsmArch :: Bpf => {
900926 let mut map = bpf:: regclass_map ( ) ;
901927 bpf:: fill_reg_map ( arch, reloc_model, target_features, target, & mut map) ;
0 commit comments