@@ -192,6 +192,7 @@ mod s390x;
192192mod spirv;
193193mod wasm;
194194mod x86;
195+ mod xtensa;
195196
196197pub use aarch64:: { AArch64InlineAsmReg , AArch64InlineAsmRegClass } ;
197198pub use arm:: { ArmInlineAsmReg , ArmInlineAsmRegClass } ;
@@ -209,6 +210,7 @@ pub use riscv::{RiscVInlineAsmReg, RiscVInlineAsmRegClass};
209210pub use s390x:: { S390xInlineAsmReg , S390xInlineAsmRegClass } ;
210211pub use spirv:: { SpirVInlineAsmReg , SpirVInlineAsmRegClass } ;
211212pub use wasm:: { WasmInlineAsmReg , WasmInlineAsmRegClass } ;
213+ pub use xtensa:: { XtensaInlineAsmReg , XtensaInlineAsmRegClass } ;
212214pub use x86:: { X86InlineAsmReg , X86InlineAsmRegClass } ;
213215
214216#[ derive( Copy , Clone , Encodable , Decodable , Debug , Eq , PartialEq , Hash ) ]
@@ -231,6 +233,7 @@ pub enum InlineAsmArch {
231233 SpirV ,
232234 Wasm32 ,
233235 Wasm64 ,
236+ Xtensa ,
234237 Bpf ,
235238 Avr ,
236239 Msp430 ,
@@ -261,6 +264,7 @@ impl FromStr for InlineAsmArch {
261264 "spirv" => Ok ( Self :: SpirV ) ,
262265 "wasm32" => Ok ( Self :: Wasm32 ) ,
263266 "wasm64" => Ok ( Self :: Wasm64 ) ,
267+ "xtensa" => Ok ( Self :: Xtensa ) ,
264268 "bpf" => Ok ( Self :: Bpf ) ,
265269 "avr" => Ok ( Self :: Avr ) ,
266270 "msp430" => Ok ( Self :: Msp430 ) ,
@@ -286,6 +290,7 @@ pub enum InlineAsmReg {
286290 S390x ( S390xInlineAsmReg ) ,
287291 SpirV ( SpirVInlineAsmReg ) ,
288292 Wasm ( WasmInlineAsmReg ) ,
293+ Xtensa ( XtensaInlineAsmReg ) ,
289294 Bpf ( BpfInlineAsmReg ) ,
290295 Avr ( AvrInlineAsmReg ) ,
291296 Msp430 ( Msp430InlineAsmReg ) ,
@@ -307,6 +312,7 @@ impl InlineAsmReg {
307312 Self :: LoongArch ( r) => r. name ( ) ,
308313 Self :: Mips ( r) => r. name ( ) ,
309314 Self :: S390x ( r) => r. name ( ) ,
315+ Self :: Xtensa ( r) => r. name ( ) ,
310316 Self :: Bpf ( r) => r. name ( ) ,
311317 Self :: Avr ( r) => r. name ( ) ,
312318 Self :: Msp430 ( r) => r. name ( ) ,
@@ -327,6 +333,7 @@ impl InlineAsmReg {
327333 Self :: LoongArch ( r) => InlineAsmRegClass :: LoongArch ( r. reg_class ( ) ) ,
328334 Self :: Mips ( r) => InlineAsmRegClass :: Mips ( r. reg_class ( ) ) ,
329335 Self :: S390x ( r) => InlineAsmRegClass :: S390x ( r. reg_class ( ) ) ,
336+ Self :: Xtensa ( r) => InlineAsmRegClass :: Xtensa ( r. reg_class ( ) ) ,
330337 Self :: Bpf ( r) => InlineAsmRegClass :: Bpf ( r. reg_class ( ) ) ,
331338 Self :: Avr ( r) => InlineAsmRegClass :: Avr ( r. reg_class ( ) ) ,
332339 Self :: Msp430 ( r) => InlineAsmRegClass :: Msp430 ( r. reg_class ( ) ) ,
@@ -358,6 +365,9 @@ impl InlineAsmReg {
358365 InlineAsmArch :: Mips | InlineAsmArch :: Mips64 => {
359366 Self :: Mips ( MipsInlineAsmReg :: parse ( name) ?)
360367 }
368+ InlineAsmArch :: Xtensa => {
369+ Self :: Xtensa ( XtensaInlineAsmReg :: parse ( name) ?)
370+ }
361371 InlineAsmArch :: S390x => Self :: S390x ( S390xInlineAsmReg :: parse ( name) ?) ,
362372 InlineAsmArch :: SpirV => Self :: SpirV ( SpirVInlineAsmReg :: parse ( name) ?) ,
363373 InlineAsmArch :: Wasm32 | InlineAsmArch :: Wasm64 => {
@@ -393,6 +403,7 @@ impl InlineAsmReg {
393403 Self :: S390x ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
394404 Self :: Bpf ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
395405 Self :: Avr ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
406+ Self :: Xtensa ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
396407 Self :: Msp430 ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
397408 Self :: M68k ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
398409 Self :: CSKY ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
@@ -418,6 +429,7 @@ impl InlineAsmReg {
418429 Self :: LoongArch ( r) => r. emit ( out, arch, modifier) ,
419430 Self :: Mips ( r) => r. emit ( out, arch, modifier) ,
420431 Self :: S390x ( r) => r. emit ( out, arch, modifier) ,
432+ Self :: Xtensa ( r) => r. emit ( out, arch, modifier) ,
421433 Self :: Bpf ( r) => r. emit ( out, arch, modifier) ,
422434 Self :: Avr ( r) => r. emit ( out, arch, modifier) ,
423435 Self :: Msp430 ( r) => r. emit ( out, arch, modifier) ,
@@ -438,6 +450,7 @@ impl InlineAsmReg {
438450 Self :: LoongArch ( _) => cb ( self ) ,
439451 Self :: Mips ( _) => cb ( self ) ,
440452 Self :: S390x ( _) => cb ( self ) ,
453+ Self :: Xtensa ( _) => cb ( self ) ,
441454 Self :: Bpf ( r) => r. overlapping_regs ( |r| cb ( Self :: Bpf ( r) ) ) ,
442455 Self :: Avr ( r) => r. overlapping_regs ( |r| cb ( Self :: Avr ( r) ) ) ,
443456 Self :: Msp430 ( _) => cb ( self ) ,
@@ -463,6 +476,7 @@ pub enum InlineAsmRegClass {
463476 S390x ( S390xInlineAsmRegClass ) ,
464477 SpirV ( SpirVInlineAsmRegClass ) ,
465478 Wasm ( WasmInlineAsmRegClass ) ,
479+ Xtensa ( XtensaInlineAsmRegClass ) ,
466480 Bpf ( BpfInlineAsmRegClass ) ,
467481 Avr ( AvrInlineAsmRegClass ) ,
468482 Msp430 ( Msp430InlineAsmRegClass ) ,
@@ -487,6 +501,7 @@ impl InlineAsmRegClass {
487501 Self :: S390x ( r) => r. name ( ) ,
488502 Self :: SpirV ( r) => r. name ( ) ,
489503 Self :: Wasm ( r) => r. name ( ) ,
504+ Self :: Xtensa ( r) => r. name ( ) ,
490505 Self :: Bpf ( r) => r. name ( ) ,
491506 Self :: Avr ( r) => r. name ( ) ,
492507 Self :: Msp430 ( r) => r. name ( ) ,
@@ -513,6 +528,7 @@ impl InlineAsmRegClass {
513528 Self :: S390x ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: S390x ) ,
514529 Self :: SpirV ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: SpirV ) ,
515530 Self :: Wasm ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Wasm ) ,
531+ Self :: Xtensa ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Xtensa ) ,
516532 Self :: Bpf ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Bpf ) ,
517533 Self :: Avr ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Avr ) ,
518534 Self :: Msp430 ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Msp430 ) ,
@@ -542,6 +558,7 @@ impl InlineAsmRegClass {
542558 Self :: S390x ( r) => r. suggest_modifier ( arch, ty) ,
543559 Self :: SpirV ( r) => r. suggest_modifier ( arch, ty) ,
544560 Self :: Wasm ( r) => r. suggest_modifier ( arch, ty) ,
561+ Self :: Xtensa ( r) => r. suggest_modifier ( arch, ty) ,
545562 Self :: Bpf ( r) => r. suggest_modifier ( arch, ty) ,
546563 Self :: Avr ( r) => r. suggest_modifier ( arch, ty) ,
547564 Self :: Msp430 ( r) => r. suggest_modifier ( arch, ty) ,
@@ -571,6 +588,7 @@ impl InlineAsmRegClass {
571588 Self :: S390x ( r) => r. default_modifier ( arch) ,
572589 Self :: SpirV ( r) => r. default_modifier ( arch) ,
573590 Self :: Wasm ( r) => r. default_modifier ( arch) ,
591+ Self :: Xtensa ( r) => r. default_modifier ( arch) ,
574592 Self :: Bpf ( r) => r. default_modifier ( arch) ,
575593 Self :: Avr ( r) => r. default_modifier ( arch) ,
576594 Self :: Msp430 ( r) => r. default_modifier ( arch) ,
@@ -599,6 +617,7 @@ impl InlineAsmRegClass {
599617 Self :: S390x ( r) => r. supported_types ( arch) ,
600618 Self :: SpirV ( r) => r. supported_types ( arch) ,
601619 Self :: Wasm ( r) => r. supported_types ( arch) ,
620+ Self :: Xtensa ( r) => r. supported_types ( arch) ,
602621 Self :: Bpf ( r) => r. supported_types ( arch) ,
603622 Self :: Avr ( r) => r. supported_types ( arch) ,
604623 Self :: Msp430 ( r) => r. supported_types ( arch) ,
@@ -636,6 +655,7 @@ impl InlineAsmRegClass {
636655 }
637656 InlineAsmArch :: Bpf => Self :: Bpf ( BpfInlineAsmRegClass :: parse ( name) ?) ,
638657 InlineAsmArch :: Avr => Self :: Avr ( AvrInlineAsmRegClass :: parse ( name) ?) ,
658+ InlineAsmArch :: Xtensa => Self :: Xtensa ( XtensaInlineAsmRegClass :: parse ( name) ?) ,
639659 InlineAsmArch :: Msp430 => Self :: Msp430 ( Msp430InlineAsmRegClass :: parse ( name) ?) ,
640660 InlineAsmArch :: M68k => Self :: M68k ( M68kInlineAsmRegClass :: parse ( name) ?) ,
641661 InlineAsmArch :: CSKY => Self :: CSKY ( CSKYInlineAsmRegClass :: parse ( name) ?) ,
@@ -658,6 +678,7 @@ impl InlineAsmRegClass {
658678 Self :: S390x ( r) => r. valid_modifiers ( arch) ,
659679 Self :: SpirV ( r) => r. valid_modifiers ( arch) ,
660680 Self :: Wasm ( r) => r. valid_modifiers ( arch) ,
681+ Self :: Xtensa ( r) => r. valid_modifiers ( arch) ,
661682 Self :: Bpf ( r) => r. valid_modifiers ( arch) ,
662683 Self :: Avr ( r) => r. valid_modifiers ( arch) ,
663684 Self :: Msp430 ( r) => r. valid_modifiers ( arch) ,
@@ -702,6 +723,7 @@ impl fmt::Display for InlineAsmRegOrRegClass {
702723/// Set of types which can be used with a particular register class.
703724#[ derive( Copy , Clone , Debug , Eq , PartialEq ) ]
704725pub enum InlineAsmType {
726+ I1 ,
705727 I8 ,
706728 I16 ,
707729 I32 ,
@@ -729,6 +751,7 @@ impl InlineAsmType {
729751
730752 pub fn size ( self ) -> Size {
731753 Size :: from_bytes ( match self {
754+ Self :: I1 => return Size :: from_bits ( 1 ) ,
732755 Self :: I8 => 1 ,
733756 Self :: I16 => 2 ,
734757 Self :: I32 => 4 ,
@@ -754,6 +777,7 @@ impl InlineAsmType {
754777impl fmt:: Display for InlineAsmType {
755778 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
756779 match * self {
780+ Self :: I1 => f. write_str ( "i1" ) ,
757781 Self :: I8 => f. write_str ( "i8" ) ,
758782 Self :: I16 => f. write_str ( "i16" ) ,
759783 Self :: I32 => f. write_str ( "i32" ) ,
@@ -851,6 +875,11 @@ pub fn allocatable_registers(
851875 wasm:: fill_reg_map ( arch, reloc_model, target_features, target, & mut map) ;
852876 map
853877 }
878+ InlineAsmArch :: Xtensa => {
879+ let mut map = xtensa:: regclass_map ( ) ;
880+ xtensa:: fill_reg_map ( arch, reloc_model, target_features, target, & mut map) ;
881+ map
882+ }
854883 InlineAsmArch :: Bpf => {
855884 let mut map = bpf:: regclass_map ( ) ;
856885 bpf:: fill_reg_map ( arch, reloc_model, target_features, target, & mut map) ;
0 commit comments