@@ -194,6 +194,7 @@ mod s390x;
194194mod spirv;
195195mod wasm;
196196mod x86;
197+ mod xtensa;
197198
198199pub use aarch64:: { AArch64InlineAsmReg , AArch64InlineAsmRegClass } ;
199200pub use arm:: { ArmInlineAsmReg , ArmInlineAsmRegClass } ;
@@ -211,6 +212,7 @@ pub use riscv::{RiscVInlineAsmReg, RiscVInlineAsmRegClass};
211212pub use s390x:: { S390xInlineAsmReg , S390xInlineAsmRegClass } ;
212213pub use spirv:: { SpirVInlineAsmReg , SpirVInlineAsmRegClass } ;
213214pub use wasm:: { WasmInlineAsmReg , WasmInlineAsmRegClass } ;
215+ pub use xtensa:: { XtensaInlineAsmReg , XtensaInlineAsmRegClass } ;
214216pub use x86:: { X86InlineAsmReg , X86InlineAsmRegClass } ;
215217
216218#[ derive( Copy , Clone , Encodable , Decodable , Debug , Eq , PartialEq , Hash ) ]
@@ -233,6 +235,7 @@ pub enum InlineAsmArch {
233235 SpirV ,
234236 Wasm32 ,
235237 Wasm64 ,
238+ Xtensa ,
236239 Bpf ,
237240 Avr ,
238241 Msp430 ,
@@ -263,6 +266,7 @@ impl FromStr for InlineAsmArch {
263266 "spirv" => Ok ( Self :: SpirV ) ,
264267 "wasm32" => Ok ( Self :: Wasm32 ) ,
265268 "wasm64" => Ok ( Self :: Wasm64 ) ,
269+ "xtensa" => Ok ( Self :: Xtensa ) ,
266270 "bpf" => Ok ( Self :: Bpf ) ,
267271 "avr" => Ok ( Self :: Avr ) ,
268272 "msp430" => Ok ( Self :: Msp430 ) ,
@@ -288,6 +292,7 @@ pub enum InlineAsmReg {
288292 S390x ( S390xInlineAsmReg ) ,
289293 SpirV ( SpirVInlineAsmReg ) ,
290294 Wasm ( WasmInlineAsmReg ) ,
295+ Xtensa ( XtensaInlineAsmReg ) ,
291296 Bpf ( BpfInlineAsmReg ) ,
292297 Avr ( AvrInlineAsmReg ) ,
293298 Msp430 ( Msp430InlineAsmReg ) ,
@@ -309,6 +314,7 @@ impl InlineAsmReg {
309314 Self :: LoongArch ( r) => r. name ( ) ,
310315 Self :: Mips ( r) => r. name ( ) ,
311316 Self :: S390x ( r) => r. name ( ) ,
317+ Self :: Xtensa ( r) => r. name ( ) ,
312318 Self :: Bpf ( r) => r. name ( ) ,
313319 Self :: Avr ( r) => r. name ( ) ,
314320 Self :: Msp430 ( r) => r. name ( ) ,
@@ -329,6 +335,7 @@ impl InlineAsmReg {
329335 Self :: LoongArch ( r) => InlineAsmRegClass :: LoongArch ( r. reg_class ( ) ) ,
330336 Self :: Mips ( r) => InlineAsmRegClass :: Mips ( r. reg_class ( ) ) ,
331337 Self :: S390x ( r) => InlineAsmRegClass :: S390x ( r. reg_class ( ) ) ,
338+ Self :: Xtensa ( r) => InlineAsmRegClass :: Xtensa ( r. reg_class ( ) ) ,
332339 Self :: Bpf ( r) => InlineAsmRegClass :: Bpf ( r. reg_class ( ) ) ,
333340 Self :: Avr ( r) => InlineAsmRegClass :: Avr ( r. reg_class ( ) ) ,
334341 Self :: Msp430 ( r) => InlineAsmRegClass :: Msp430 ( r. reg_class ( ) ) ,
@@ -360,6 +367,9 @@ impl InlineAsmReg {
360367 InlineAsmArch :: Mips | InlineAsmArch :: Mips64 => {
361368 Self :: Mips ( MipsInlineAsmReg :: parse ( name) ?)
362369 }
370+ InlineAsmArch :: Xtensa => {
371+ Self :: Xtensa ( XtensaInlineAsmReg :: parse ( name) ?)
372+ }
363373 InlineAsmArch :: S390x => Self :: S390x ( S390xInlineAsmReg :: parse ( name) ?) ,
364374 InlineAsmArch :: SpirV => Self :: SpirV ( SpirVInlineAsmReg :: parse ( name) ?) ,
365375 InlineAsmArch :: Wasm32 | InlineAsmArch :: Wasm64 => {
@@ -395,6 +405,7 @@ impl InlineAsmReg {
395405 Self :: S390x ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
396406 Self :: Bpf ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
397407 Self :: Avr ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
408+ Self :: Xtensa ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
398409 Self :: Msp430 ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
399410 Self :: M68k ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
400411 Self :: CSKY ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
@@ -420,6 +431,7 @@ impl InlineAsmReg {
420431 Self :: LoongArch ( r) => r. emit ( out, arch, modifier) ,
421432 Self :: Mips ( r) => r. emit ( out, arch, modifier) ,
422433 Self :: S390x ( r) => r. emit ( out, arch, modifier) ,
434+ Self :: Xtensa ( r) => r. emit ( out, arch, modifier) ,
423435 Self :: Bpf ( r) => r. emit ( out, arch, modifier) ,
424436 Self :: Avr ( r) => r. emit ( out, arch, modifier) ,
425437 Self :: Msp430 ( r) => r. emit ( out, arch, modifier) ,
@@ -440,6 +452,7 @@ impl InlineAsmReg {
440452 Self :: LoongArch ( _) => cb ( self ) ,
441453 Self :: Mips ( _) => cb ( self ) ,
442454 Self :: S390x ( _) => cb ( self ) ,
455+ Self :: Xtensa ( _) => cb ( self ) ,
443456 Self :: Bpf ( r) => r. overlapping_regs ( |r| cb ( Self :: Bpf ( r) ) ) ,
444457 Self :: Avr ( r) => r. overlapping_regs ( |r| cb ( Self :: Avr ( r) ) ) ,
445458 Self :: Msp430 ( _) => cb ( self ) ,
@@ -465,6 +478,7 @@ pub enum InlineAsmRegClass {
465478 S390x ( S390xInlineAsmRegClass ) ,
466479 SpirV ( SpirVInlineAsmRegClass ) ,
467480 Wasm ( WasmInlineAsmRegClass ) ,
481+ Xtensa ( XtensaInlineAsmRegClass ) ,
468482 Bpf ( BpfInlineAsmRegClass ) ,
469483 Avr ( AvrInlineAsmRegClass ) ,
470484 Msp430 ( Msp430InlineAsmRegClass ) ,
@@ -489,6 +503,7 @@ impl InlineAsmRegClass {
489503 Self :: S390x ( r) => r. name ( ) ,
490504 Self :: SpirV ( r) => r. name ( ) ,
491505 Self :: Wasm ( r) => r. name ( ) ,
506+ Self :: Xtensa ( r) => r. name ( ) ,
492507 Self :: Bpf ( r) => r. name ( ) ,
493508 Self :: Avr ( r) => r. name ( ) ,
494509 Self :: Msp430 ( r) => r. name ( ) ,
@@ -515,6 +530,7 @@ impl InlineAsmRegClass {
515530 Self :: S390x ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: S390x ) ,
516531 Self :: SpirV ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: SpirV ) ,
517532 Self :: Wasm ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Wasm ) ,
533+ Self :: Xtensa ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Xtensa ) ,
518534 Self :: Bpf ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Bpf ) ,
519535 Self :: Avr ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Avr ) ,
520536 Self :: Msp430 ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Msp430 ) ,
@@ -544,6 +560,7 @@ impl InlineAsmRegClass {
544560 Self :: S390x ( r) => r. suggest_modifier ( arch, ty) ,
545561 Self :: SpirV ( r) => r. suggest_modifier ( arch, ty) ,
546562 Self :: Wasm ( r) => r. suggest_modifier ( arch, ty) ,
563+ Self :: Xtensa ( r) => r. suggest_modifier ( arch, ty) ,
547564 Self :: Bpf ( r) => r. suggest_modifier ( arch, ty) ,
548565 Self :: Avr ( r) => r. suggest_modifier ( arch, ty) ,
549566 Self :: Msp430 ( r) => r. suggest_modifier ( arch, ty) ,
@@ -573,6 +590,7 @@ impl InlineAsmRegClass {
573590 Self :: S390x ( r) => r. default_modifier ( arch) ,
574591 Self :: SpirV ( r) => r. default_modifier ( arch) ,
575592 Self :: Wasm ( r) => r. default_modifier ( arch) ,
593+ Self :: Xtensa ( r) => r. default_modifier ( arch) ,
576594 Self :: Bpf ( r) => r. default_modifier ( arch) ,
577595 Self :: Avr ( r) => r. default_modifier ( arch) ,
578596 Self :: Msp430 ( r) => r. default_modifier ( arch) ,
@@ -601,6 +619,7 @@ impl InlineAsmRegClass {
601619 Self :: S390x ( r) => r. supported_types ( arch) ,
602620 Self :: SpirV ( r) => r. supported_types ( arch) ,
603621 Self :: Wasm ( r) => r. supported_types ( arch) ,
622+ Self :: Xtensa ( r) => r. supported_types ( arch) ,
604623 Self :: Bpf ( r) => r. supported_types ( arch) ,
605624 Self :: Avr ( r) => r. supported_types ( arch) ,
606625 Self :: Msp430 ( r) => r. supported_types ( arch) ,
@@ -638,6 +657,7 @@ impl InlineAsmRegClass {
638657 }
639658 InlineAsmArch :: Bpf => Self :: Bpf ( BpfInlineAsmRegClass :: parse ( name) ?) ,
640659 InlineAsmArch :: Avr => Self :: Avr ( AvrInlineAsmRegClass :: parse ( name) ?) ,
660+ InlineAsmArch :: Xtensa => Self :: Xtensa ( XtensaInlineAsmRegClass :: parse ( name) ?) ,
641661 InlineAsmArch :: Msp430 => Self :: Msp430 ( Msp430InlineAsmRegClass :: parse ( name) ?) ,
642662 InlineAsmArch :: M68k => Self :: M68k ( M68kInlineAsmRegClass :: parse ( name) ?) ,
643663 InlineAsmArch :: CSKY => Self :: CSKY ( CSKYInlineAsmRegClass :: parse ( name) ?) ,
@@ -660,6 +680,7 @@ impl InlineAsmRegClass {
660680 Self :: S390x ( r) => r. valid_modifiers ( arch) ,
661681 Self :: SpirV ( r) => r. valid_modifiers ( arch) ,
662682 Self :: Wasm ( r) => r. valid_modifiers ( arch) ,
683+ Self :: Xtensa ( r) => r. valid_modifiers ( arch) ,
663684 Self :: Bpf ( r) => r. valid_modifiers ( arch) ,
664685 Self :: Avr ( r) => r. valid_modifiers ( arch) ,
665686 Self :: Msp430 ( r) => r. valid_modifiers ( arch) ,
@@ -704,6 +725,7 @@ impl fmt::Display for InlineAsmRegOrRegClass {
704725/// Set of types which can be used with a particular register class.
705726#[ derive( Copy , Clone , Debug , Eq , PartialEq ) ]
706727pub enum InlineAsmType {
728+ I1 ,
707729 I8 ,
708730 I16 ,
709731 I32 ,
@@ -731,6 +753,7 @@ impl InlineAsmType {
731753
732754 pub fn size ( self ) -> Size {
733755 Size :: from_bytes ( match self {
756+ Self :: I1 => return Size :: from_bits ( 1 ) ,
734757 Self :: I8 => 1 ,
735758 Self :: I16 => 2 ,
736759 Self :: I32 => 4 ,
@@ -756,6 +779,7 @@ impl InlineAsmType {
756779impl fmt:: Display for InlineAsmType {
757780 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
758781 match * self {
782+ Self :: I1 => f. write_str ( "i1" ) ,
759783 Self :: I8 => f. write_str ( "i8" ) ,
760784 Self :: I16 => f. write_str ( "i16" ) ,
761785 Self :: I32 => f. write_str ( "i32" ) ,
@@ -853,6 +877,11 @@ pub fn allocatable_registers(
853877 wasm:: fill_reg_map ( arch, reloc_model, target_features, target, & mut map) ;
854878 map
855879 }
880+ InlineAsmArch :: Xtensa => {
881+ let mut map = xtensa:: regclass_map ( ) ;
882+ xtensa:: fill_reg_map ( arch, reloc_model, target_features, target, & mut map) ;
883+ map
884+ }
856885 InlineAsmArch :: Bpf => {
857886 let mut map = bpf:: regclass_map ( ) ;
858887 bpf:: fill_reg_map ( arch, reloc_model, target_features, target, & mut map) ;
0 commit comments