@@ -180,6 +180,7 @@ mod s390x;
180180mod spirv;
181181mod wasm;
182182mod x86;
183+ mod xtensa;
183184
184185pub use aarch64:: { AArch64InlineAsmReg , AArch64InlineAsmRegClass } ;
185186pub use arm:: { ArmInlineAsmReg , ArmInlineAsmRegClass } ;
@@ -197,6 +198,7 @@ pub use riscv::{RiscVInlineAsmReg, RiscVInlineAsmRegClass};
197198pub use s390x:: { S390xInlineAsmReg , S390xInlineAsmRegClass } ;
198199pub use spirv:: { SpirVInlineAsmReg , SpirVInlineAsmRegClass } ;
199200pub use wasm:: { WasmInlineAsmReg , WasmInlineAsmRegClass } ;
201+ pub use xtensa:: { XtensaInlineAsmReg , XtensaInlineAsmRegClass } ;
200202pub use x86:: { X86InlineAsmReg , X86InlineAsmRegClass } ;
201203
202204#[ derive( Copy , Clone , Encodable , Decodable , Debug , Eq , PartialEq , Hash ) ]
@@ -218,6 +220,7 @@ pub enum InlineAsmArch {
218220 SpirV ,
219221 Wasm32 ,
220222 Wasm64 ,
223+ Xtensa ,
221224 Bpf ,
222225 Avr ,
223226 Msp430 ,
@@ -247,6 +250,7 @@ impl FromStr for InlineAsmArch {
247250 "spirv" => Ok ( Self :: SpirV ) ,
248251 "wasm32" => Ok ( Self :: Wasm32 ) ,
249252 "wasm64" => Ok ( Self :: Wasm64 ) ,
253+ "xtensa" => Ok ( Self :: Xtensa ) ,
250254 "bpf" => Ok ( Self :: Bpf ) ,
251255 "avr" => Ok ( Self :: Avr ) ,
252256 "msp430" => Ok ( Self :: Msp430 ) ,
@@ -272,6 +276,7 @@ pub enum InlineAsmReg {
272276 S390x ( S390xInlineAsmReg ) ,
273277 SpirV ( SpirVInlineAsmReg ) ,
274278 Wasm ( WasmInlineAsmReg ) ,
279+ Xtensa ( XtensaInlineAsmReg ) ,
275280 Bpf ( BpfInlineAsmReg ) ,
276281 Avr ( AvrInlineAsmReg ) ,
277282 Msp430 ( Msp430InlineAsmReg ) ,
@@ -293,6 +298,7 @@ impl InlineAsmReg {
293298 Self :: LoongArch ( r) => r. name ( ) ,
294299 Self :: Mips ( r) => r. name ( ) ,
295300 Self :: S390x ( r) => r. name ( ) ,
301+ Self :: Xtensa ( r) => r. name ( ) ,
296302 Self :: Bpf ( r) => r. name ( ) ,
297303 Self :: Avr ( r) => r. name ( ) ,
298304 Self :: Msp430 ( r) => r. name ( ) ,
@@ -313,6 +319,7 @@ impl InlineAsmReg {
313319 Self :: LoongArch ( r) => InlineAsmRegClass :: LoongArch ( r. reg_class ( ) ) ,
314320 Self :: Mips ( r) => InlineAsmRegClass :: Mips ( r. reg_class ( ) ) ,
315321 Self :: S390x ( r) => InlineAsmRegClass :: S390x ( r. reg_class ( ) ) ,
322+ Self :: Xtensa ( r) => InlineAsmRegClass :: Xtensa ( r. reg_class ( ) ) ,
316323 Self :: Bpf ( r) => InlineAsmRegClass :: Bpf ( r. reg_class ( ) ) ,
317324 Self :: Avr ( r) => InlineAsmRegClass :: Avr ( r. reg_class ( ) ) ,
318325 Self :: Msp430 ( r) => InlineAsmRegClass :: Msp430 ( r. reg_class ( ) ) ,
@@ -342,6 +349,9 @@ impl InlineAsmReg {
342349 InlineAsmArch :: Mips | InlineAsmArch :: Mips64 => {
343350 Self :: Mips ( MipsInlineAsmReg :: parse ( name) ?)
344351 }
352+ InlineAsmArch :: Xtensa => {
353+ Self :: Xtensa ( XtensaInlineAsmReg :: parse ( name) ?)
354+ }
345355 InlineAsmArch :: S390x => Self :: S390x ( S390xInlineAsmReg :: parse ( name) ?) ,
346356 InlineAsmArch :: SpirV => Self :: SpirV ( SpirVInlineAsmReg :: parse ( name) ?) ,
347357 InlineAsmArch :: Wasm32 | InlineAsmArch :: Wasm64 => {
@@ -377,6 +387,7 @@ impl InlineAsmReg {
377387 Self :: S390x ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
378388 Self :: Bpf ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
379389 Self :: Avr ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
390+ Self :: Xtensa ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
380391 Self :: Msp430 ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
381392 Self :: M68k ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
382393 Self :: CSKY ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
@@ -402,6 +413,7 @@ impl InlineAsmReg {
402413 Self :: LoongArch ( r) => r. emit ( out, arch, modifier) ,
403414 Self :: Mips ( r) => r. emit ( out, arch, modifier) ,
404415 Self :: S390x ( r) => r. emit ( out, arch, modifier) ,
416+ Self :: Xtensa ( r) => r. emit ( out, arch, modifier) ,
405417 Self :: Bpf ( r) => r. emit ( out, arch, modifier) ,
406418 Self :: Avr ( r) => r. emit ( out, arch, modifier) ,
407419 Self :: Msp430 ( r) => r. emit ( out, arch, modifier) ,
@@ -422,6 +434,7 @@ impl InlineAsmReg {
422434 Self :: LoongArch ( _) => cb ( self ) ,
423435 Self :: Mips ( _) => cb ( self ) ,
424436 Self :: S390x ( _) => cb ( self ) ,
437+ Self :: Xtensa ( _) => cb ( self ) ,
425438 Self :: Bpf ( r) => r. overlapping_regs ( |r| cb ( Self :: Bpf ( r) ) ) ,
426439 Self :: Avr ( r) => r. overlapping_regs ( |r| cb ( Self :: Avr ( r) ) ) ,
427440 Self :: Msp430 ( _) => cb ( self ) ,
@@ -447,6 +460,7 @@ pub enum InlineAsmRegClass {
447460 S390x ( S390xInlineAsmRegClass ) ,
448461 SpirV ( SpirVInlineAsmRegClass ) ,
449462 Wasm ( WasmInlineAsmRegClass ) ,
463+ Xtensa ( XtensaInlineAsmRegClass ) ,
450464 Bpf ( BpfInlineAsmRegClass ) ,
451465 Avr ( AvrInlineAsmRegClass ) ,
452466 Msp430 ( Msp430InlineAsmRegClass ) ,
@@ -471,6 +485,7 @@ impl InlineAsmRegClass {
471485 Self :: S390x ( r) => r. name ( ) ,
472486 Self :: SpirV ( r) => r. name ( ) ,
473487 Self :: Wasm ( r) => r. name ( ) ,
488+ Self :: Xtensa ( r) => r. name ( ) ,
474489 Self :: Bpf ( r) => r. name ( ) ,
475490 Self :: Avr ( r) => r. name ( ) ,
476491 Self :: Msp430 ( r) => r. name ( ) ,
@@ -497,6 +512,7 @@ impl InlineAsmRegClass {
497512 Self :: S390x ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: S390x ) ,
498513 Self :: SpirV ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: SpirV ) ,
499514 Self :: Wasm ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Wasm ) ,
515+ Self :: Xtensa ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Xtensa ) ,
500516 Self :: Bpf ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Bpf ) ,
501517 Self :: Avr ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Avr ) ,
502518 Self :: Msp430 ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Msp430 ) ,
@@ -530,6 +546,7 @@ impl InlineAsmRegClass {
530546 Self :: S390x ( r) => r. suggest_modifier ( arch, ty) ,
531547 Self :: SpirV ( r) => r. suggest_modifier ( arch, ty) ,
532548 Self :: Wasm ( r) => r. suggest_modifier ( arch, ty) ,
549+ Self :: Xtensa ( r) => r. suggest_modifier ( arch, ty) ,
533550 Self :: Bpf ( r) => r. suggest_modifier ( arch, ty) ,
534551 Self :: Avr ( r) => r. suggest_modifier ( arch, ty) ,
535552 Self :: Msp430 ( r) => r. suggest_modifier ( arch, ty) ,
@@ -559,6 +576,7 @@ impl InlineAsmRegClass {
559576 Self :: S390x ( r) => r. default_modifier ( arch) ,
560577 Self :: SpirV ( r) => r. default_modifier ( arch) ,
561578 Self :: Wasm ( r) => r. default_modifier ( arch) ,
579+ Self :: Xtensa ( r) => r. default_modifier ( arch) ,
562580 Self :: Bpf ( r) => r. default_modifier ( arch) ,
563581 Self :: Avr ( r) => r. default_modifier ( arch) ,
564582 Self :: Msp430 ( r) => r. default_modifier ( arch) ,
@@ -587,6 +605,7 @@ impl InlineAsmRegClass {
587605 Self :: S390x ( r) => r. supported_types ( arch) ,
588606 Self :: SpirV ( r) => r. supported_types ( arch) ,
589607 Self :: Wasm ( r) => r. supported_types ( arch) ,
608+ Self :: Xtensa ( r) => r. supported_types ( arch) ,
590609 Self :: Bpf ( r) => r. supported_types ( arch) ,
591610 Self :: Avr ( r) => r. supported_types ( arch) ,
592611 Self :: Msp430 ( r) => r. supported_types ( arch) ,
@@ -622,6 +641,7 @@ impl InlineAsmRegClass {
622641 }
623642 InlineAsmArch :: Bpf => Self :: Bpf ( BpfInlineAsmRegClass :: parse ( name) ?) ,
624643 InlineAsmArch :: Avr => Self :: Avr ( AvrInlineAsmRegClass :: parse ( name) ?) ,
644+ InlineAsmArch :: Xtensa => Self :: Xtensa ( XtensaInlineAsmRegClass :: parse ( name) ?) ,
625645 InlineAsmArch :: Msp430 => Self :: Msp430 ( Msp430InlineAsmRegClass :: parse ( name) ?) ,
626646 InlineAsmArch :: M68k => Self :: M68k ( M68kInlineAsmRegClass :: parse ( name) ?) ,
627647 InlineAsmArch :: CSKY => Self :: CSKY ( CSKYInlineAsmRegClass :: parse ( name) ?) ,
@@ -644,6 +664,7 @@ impl InlineAsmRegClass {
644664 Self :: S390x ( r) => r. valid_modifiers ( arch) ,
645665 Self :: SpirV ( r) => r. valid_modifiers ( arch) ,
646666 Self :: Wasm ( r) => r. valid_modifiers ( arch) ,
667+ Self :: Xtensa ( r) => r. valid_modifiers ( arch) ,
647668 Self :: Bpf ( r) => r. valid_modifiers ( arch) ,
648669 Self :: Avr ( r) => r. valid_modifiers ( arch) ,
649670 Self :: Msp430 ( r) => r. valid_modifiers ( arch) ,
@@ -688,6 +709,7 @@ impl fmt::Display for InlineAsmRegOrRegClass {
688709/// Set of types which can be used with a particular register class.
689710#[ derive( Copy , Clone , Debug , Eq , PartialEq ) ]
690711pub enum InlineAsmType {
712+ I1 ,
691713 I8 ,
692714 I16 ,
693715 I32 ,
@@ -711,6 +733,7 @@ impl InlineAsmType {
711733
712734 pub fn size ( self ) -> Size {
713735 Size :: from_bytes ( match self {
736+ Self :: I1 => return Size :: from_bits ( 1 ) ,
714737 Self :: I8 => 1 ,
715738 Self :: I16 => 2 ,
716739 Self :: I32 => 4 ,
@@ -732,6 +755,7 @@ impl InlineAsmType {
732755impl fmt:: Display for InlineAsmType {
733756 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
734757 match * self {
758+ Self :: I1 => f. write_str ( "i1" ) ,
735759 Self :: I8 => f. write_str ( "i8" ) ,
736760 Self :: I16 => f. write_str ( "i16" ) ,
737761 Self :: I32 => f. write_str ( "i32" ) ,
@@ -825,6 +849,11 @@ pub fn allocatable_registers(
825849 wasm:: fill_reg_map ( arch, reloc_model, target_features, target, & mut map) ;
826850 map
827851 }
852+ InlineAsmArch :: Xtensa => {
853+ let mut map = xtensa:: regclass_map ( ) ;
854+ xtensa:: fill_reg_map ( arch, reloc_model, target_features, target, & mut map) ;
855+ map
856+ }
828857 InlineAsmArch :: Bpf => {
829858 let mut map = bpf:: regclass_map ( ) ;
830859 bpf:: fill_reg_map ( arch, reloc_model, target_features, target, & mut map) ;
0 commit comments