@@ -194,6 +194,7 @@ mod s390x;
194
194
mod spirv;
195
195
mod wasm;
196
196
mod x86;
197
+ mod xtensa;
197
198
198
199
pub use aarch64:: { AArch64InlineAsmReg , AArch64InlineAsmRegClass } ;
199
200
pub use arm:: { ArmInlineAsmReg , ArmInlineAsmRegClass } ;
@@ -211,6 +212,7 @@ pub use riscv::{RiscVInlineAsmReg, RiscVInlineAsmRegClass};
211
212
pub use s390x:: { S390xInlineAsmReg , S390xInlineAsmRegClass } ;
212
213
pub use spirv:: { SpirVInlineAsmReg , SpirVInlineAsmRegClass } ;
213
214
pub use wasm:: { WasmInlineAsmReg , WasmInlineAsmRegClass } ;
215
+ pub use xtensa:: { XtensaInlineAsmReg , XtensaInlineAsmRegClass } ;
214
216
pub use x86:: { X86InlineAsmReg , X86InlineAsmRegClass } ;
215
217
216
218
#[ derive( Copy , Clone , Encodable , Decodable , Debug , Eq , PartialEq , Hash ) ]
@@ -233,6 +235,7 @@ pub enum InlineAsmArch {
233
235
SpirV ,
234
236
Wasm32 ,
235
237
Wasm64 ,
238
+ Xtensa ,
236
239
Bpf ,
237
240
Avr ,
238
241
Msp430 ,
@@ -263,6 +266,7 @@ impl FromStr for InlineAsmArch {
263
266
"spirv" => Ok ( Self :: SpirV ) ,
264
267
"wasm32" => Ok ( Self :: Wasm32 ) ,
265
268
"wasm64" => Ok ( Self :: Wasm64 ) ,
269
+ "xtensa" => Ok ( Self :: Xtensa ) ,
266
270
"bpf" => Ok ( Self :: Bpf ) ,
267
271
"avr" => Ok ( Self :: Avr ) ,
268
272
"msp430" => Ok ( Self :: Msp430 ) ,
@@ -288,6 +292,7 @@ pub enum InlineAsmReg {
288
292
S390x ( S390xInlineAsmReg ) ,
289
293
SpirV ( SpirVInlineAsmReg ) ,
290
294
Wasm ( WasmInlineAsmReg ) ,
295
+ Xtensa ( XtensaInlineAsmReg ) ,
291
296
Bpf ( BpfInlineAsmReg ) ,
292
297
Avr ( AvrInlineAsmReg ) ,
293
298
Msp430 ( Msp430InlineAsmReg ) ,
@@ -309,6 +314,7 @@ impl InlineAsmReg {
309
314
Self :: LoongArch ( r) => r. name ( ) ,
310
315
Self :: Mips ( r) => r. name ( ) ,
311
316
Self :: S390x ( r) => r. name ( ) ,
317
+ Self :: Xtensa ( r) => r. name ( ) ,
312
318
Self :: Bpf ( r) => r. name ( ) ,
313
319
Self :: Avr ( r) => r. name ( ) ,
314
320
Self :: Msp430 ( r) => r. name ( ) ,
@@ -329,6 +335,7 @@ impl InlineAsmReg {
329
335
Self :: LoongArch ( r) => InlineAsmRegClass :: LoongArch ( r. reg_class ( ) ) ,
330
336
Self :: Mips ( r) => InlineAsmRegClass :: Mips ( r. reg_class ( ) ) ,
331
337
Self :: S390x ( r) => InlineAsmRegClass :: S390x ( r. reg_class ( ) ) ,
338
+ Self :: Xtensa ( r) => InlineAsmRegClass :: Xtensa ( r. reg_class ( ) ) ,
332
339
Self :: Bpf ( r) => InlineAsmRegClass :: Bpf ( r. reg_class ( ) ) ,
333
340
Self :: Avr ( r) => InlineAsmRegClass :: Avr ( r. reg_class ( ) ) ,
334
341
Self :: Msp430 ( r) => InlineAsmRegClass :: Msp430 ( r. reg_class ( ) ) ,
@@ -360,6 +367,9 @@ impl InlineAsmReg {
360
367
InlineAsmArch :: Mips | InlineAsmArch :: Mips64 => {
361
368
Self :: Mips ( MipsInlineAsmReg :: parse ( name) ?)
362
369
}
370
+ InlineAsmArch :: Xtensa => {
371
+ Self :: Xtensa ( XtensaInlineAsmReg :: parse ( name) ?)
372
+ }
363
373
InlineAsmArch :: S390x => Self :: S390x ( S390xInlineAsmReg :: parse ( name) ?) ,
364
374
InlineAsmArch :: SpirV => Self :: SpirV ( SpirVInlineAsmReg :: parse ( name) ?) ,
365
375
InlineAsmArch :: Wasm32 | InlineAsmArch :: Wasm64 => {
@@ -395,6 +405,7 @@ impl InlineAsmReg {
395
405
Self :: S390x ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
396
406
Self :: Bpf ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
397
407
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) ,
398
409
Self :: Msp430 ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
399
410
Self :: M68k ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
400
411
Self :: CSKY ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
@@ -420,6 +431,7 @@ impl InlineAsmReg {
420
431
Self :: LoongArch ( r) => r. emit ( out, arch, modifier) ,
421
432
Self :: Mips ( r) => r. emit ( out, arch, modifier) ,
422
433
Self :: S390x ( r) => r. emit ( out, arch, modifier) ,
434
+ Self :: Xtensa ( r) => r. emit ( out, arch, modifier) ,
423
435
Self :: Bpf ( r) => r. emit ( out, arch, modifier) ,
424
436
Self :: Avr ( r) => r. emit ( out, arch, modifier) ,
425
437
Self :: Msp430 ( r) => r. emit ( out, arch, modifier) ,
@@ -440,6 +452,7 @@ impl InlineAsmReg {
440
452
Self :: LoongArch ( _) => cb ( self ) ,
441
453
Self :: Mips ( _) => cb ( self ) ,
442
454
Self :: S390x ( _) => cb ( self ) ,
455
+ Self :: Xtensa ( _) => cb ( self ) ,
443
456
Self :: Bpf ( r) => r. overlapping_regs ( |r| cb ( Self :: Bpf ( r) ) ) ,
444
457
Self :: Avr ( r) => r. overlapping_regs ( |r| cb ( Self :: Avr ( r) ) ) ,
445
458
Self :: Msp430 ( _) => cb ( self ) ,
@@ -465,6 +478,7 @@ pub enum InlineAsmRegClass {
465
478
S390x ( S390xInlineAsmRegClass ) ,
466
479
SpirV ( SpirVInlineAsmRegClass ) ,
467
480
Wasm ( WasmInlineAsmRegClass ) ,
481
+ Xtensa ( XtensaInlineAsmRegClass ) ,
468
482
Bpf ( BpfInlineAsmRegClass ) ,
469
483
Avr ( AvrInlineAsmRegClass ) ,
470
484
Msp430 ( Msp430InlineAsmRegClass ) ,
@@ -489,6 +503,7 @@ impl InlineAsmRegClass {
489
503
Self :: S390x ( r) => r. name ( ) ,
490
504
Self :: SpirV ( r) => r. name ( ) ,
491
505
Self :: Wasm ( r) => r. name ( ) ,
506
+ Self :: Xtensa ( r) => r. name ( ) ,
492
507
Self :: Bpf ( r) => r. name ( ) ,
493
508
Self :: Avr ( r) => r. name ( ) ,
494
509
Self :: Msp430 ( r) => r. name ( ) ,
@@ -515,6 +530,7 @@ impl InlineAsmRegClass {
515
530
Self :: S390x ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: S390x ) ,
516
531
Self :: SpirV ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: SpirV ) ,
517
532
Self :: Wasm ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Wasm ) ,
533
+ Self :: Xtensa ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Xtensa ) ,
518
534
Self :: Bpf ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Bpf ) ,
519
535
Self :: Avr ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Avr ) ,
520
536
Self :: Msp430 ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Msp430 ) ,
@@ -544,6 +560,7 @@ impl InlineAsmRegClass {
544
560
Self :: S390x ( r) => r. suggest_modifier ( arch, ty) ,
545
561
Self :: SpirV ( r) => r. suggest_modifier ( arch, ty) ,
546
562
Self :: Wasm ( r) => r. suggest_modifier ( arch, ty) ,
563
+ Self :: Xtensa ( r) => r. suggest_modifier ( arch, ty) ,
547
564
Self :: Bpf ( r) => r. suggest_modifier ( arch, ty) ,
548
565
Self :: Avr ( r) => r. suggest_modifier ( arch, ty) ,
549
566
Self :: Msp430 ( r) => r. suggest_modifier ( arch, ty) ,
@@ -573,6 +590,7 @@ impl InlineAsmRegClass {
573
590
Self :: S390x ( r) => r. default_modifier ( arch) ,
574
591
Self :: SpirV ( r) => r. default_modifier ( arch) ,
575
592
Self :: Wasm ( r) => r. default_modifier ( arch) ,
593
+ Self :: Xtensa ( r) => r. default_modifier ( arch) ,
576
594
Self :: Bpf ( r) => r. default_modifier ( arch) ,
577
595
Self :: Avr ( r) => r. default_modifier ( arch) ,
578
596
Self :: Msp430 ( r) => r. default_modifier ( arch) ,
@@ -601,6 +619,7 @@ impl InlineAsmRegClass {
601
619
Self :: S390x ( r) => r. supported_types ( arch) ,
602
620
Self :: SpirV ( r) => r. supported_types ( arch) ,
603
621
Self :: Wasm ( r) => r. supported_types ( arch) ,
622
+ Self :: Xtensa ( r) => r. supported_types ( arch) ,
604
623
Self :: Bpf ( r) => r. supported_types ( arch) ,
605
624
Self :: Avr ( r) => r. supported_types ( arch) ,
606
625
Self :: Msp430 ( r) => r. supported_types ( arch) ,
@@ -638,6 +657,7 @@ impl InlineAsmRegClass {
638
657
}
639
658
InlineAsmArch :: Bpf => Self :: Bpf ( BpfInlineAsmRegClass :: parse ( name) ?) ,
640
659
InlineAsmArch :: Avr => Self :: Avr ( AvrInlineAsmRegClass :: parse ( name) ?) ,
660
+ InlineAsmArch :: Xtensa => Self :: Xtensa ( XtensaInlineAsmRegClass :: parse ( name) ?) ,
641
661
InlineAsmArch :: Msp430 => Self :: Msp430 ( Msp430InlineAsmRegClass :: parse ( name) ?) ,
642
662
InlineAsmArch :: M68k => Self :: M68k ( M68kInlineAsmRegClass :: parse ( name) ?) ,
643
663
InlineAsmArch :: CSKY => Self :: CSKY ( CSKYInlineAsmRegClass :: parse ( name) ?) ,
@@ -660,6 +680,7 @@ impl InlineAsmRegClass {
660
680
Self :: S390x ( r) => r. valid_modifiers ( arch) ,
661
681
Self :: SpirV ( r) => r. valid_modifiers ( arch) ,
662
682
Self :: Wasm ( r) => r. valid_modifiers ( arch) ,
683
+ Self :: Xtensa ( r) => r. valid_modifiers ( arch) ,
663
684
Self :: Bpf ( r) => r. valid_modifiers ( arch) ,
664
685
Self :: Avr ( r) => r. valid_modifiers ( arch) ,
665
686
Self :: Msp430 ( r) => r. valid_modifiers ( arch) ,
@@ -704,6 +725,7 @@ impl fmt::Display for InlineAsmRegOrRegClass {
704
725
/// Set of types which can be used with a particular register class.
705
726
#[ derive( Copy , Clone , Debug , Eq , PartialEq ) ]
706
727
pub enum InlineAsmType {
728
+ I1 ,
707
729
I8 ,
708
730
I16 ,
709
731
I32 ,
@@ -731,6 +753,7 @@ impl InlineAsmType {
731
753
732
754
pub fn size ( self ) -> Size {
733
755
Size :: from_bytes ( match self {
756
+ Self :: I1 => return Size :: from_bits ( 1 ) ,
734
757
Self :: I8 => 1 ,
735
758
Self :: I16 => 2 ,
736
759
Self :: I32 => 4 ,
@@ -756,6 +779,7 @@ impl InlineAsmType {
756
779
impl fmt:: Display for InlineAsmType {
757
780
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
758
781
match * self {
782
+ Self :: I1 => f. write_str ( "i1" ) ,
759
783
Self :: I8 => f. write_str ( "i8" ) ,
760
784
Self :: I16 => f. write_str ( "i16" ) ,
761
785
Self :: I32 => f. write_str ( "i32" ) ,
@@ -853,6 +877,11 @@ pub fn allocatable_registers(
853
877
wasm:: fill_reg_map ( arch, reloc_model, target_features, target, & mut map) ;
854
878
map
855
879
}
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
+ }
856
885
InlineAsmArch :: Bpf => {
857
886
let mut map = bpf:: regclass_map ( ) ;
858
887
bpf:: fill_reg_map ( arch, reloc_model, target_features, target, & mut map) ;
0 commit comments