@@ -195,6 +195,7 @@ mod sparc;
195
195
mod spirv;
196
196
mod wasm;
197
197
mod x86;
198
+ mod xtensa;
198
199
199
200
pub use aarch64:: { AArch64InlineAsmReg , AArch64InlineAsmRegClass } ;
200
201
pub use arm:: { ArmInlineAsmReg , ArmInlineAsmRegClass } ;
@@ -213,6 +214,7 @@ pub use s390x::{S390xInlineAsmReg, S390xInlineAsmRegClass};
213
214
pub use sparc:: { SparcInlineAsmReg , SparcInlineAsmRegClass } ;
214
215
pub use spirv:: { SpirVInlineAsmReg , SpirVInlineAsmRegClass } ;
215
216
pub use wasm:: { WasmInlineAsmReg , WasmInlineAsmRegClass } ;
217
+ pub use xtensa:: { XtensaInlineAsmReg , XtensaInlineAsmRegClass } ;
216
218
pub use x86:: { X86InlineAsmReg , X86InlineAsmRegClass } ;
217
219
218
220
#[ derive( Copy , Clone , Encodable , Decodable , Debug , Eq , PartialEq , Hash ) ]
@@ -237,6 +239,7 @@ pub enum InlineAsmArch {
237
239
SpirV ,
238
240
Wasm32 ,
239
241
Wasm64 ,
242
+ Xtensa ,
240
243
Bpf ,
241
244
Avr ,
242
245
Msp430 ,
@@ -269,6 +272,7 @@ impl FromStr for InlineAsmArch {
269
272
"spirv" => Ok ( Self :: SpirV ) ,
270
273
"wasm32" => Ok ( Self :: Wasm32 ) ,
271
274
"wasm64" => Ok ( Self :: Wasm64 ) ,
275
+ "xtensa" => Ok ( Self :: Xtensa ) ,
272
276
"bpf" => Ok ( Self :: Bpf ) ,
273
277
"avr" => Ok ( Self :: Avr ) ,
274
278
"msp430" => Ok ( Self :: Msp430 ) ,
@@ -295,6 +299,7 @@ pub enum InlineAsmReg {
295
299
Sparc ( SparcInlineAsmReg ) ,
296
300
SpirV ( SpirVInlineAsmReg ) ,
297
301
Wasm ( WasmInlineAsmReg ) ,
302
+ Xtensa ( XtensaInlineAsmReg ) ,
298
303
Bpf ( BpfInlineAsmReg ) ,
299
304
Avr ( AvrInlineAsmReg ) ,
300
305
Msp430 ( Msp430InlineAsmReg ) ,
@@ -317,6 +322,7 @@ impl InlineAsmReg {
317
322
Self :: Mips ( r) => r. name ( ) ,
318
323
Self :: S390x ( r) => r. name ( ) ,
319
324
Self :: Sparc ( r) => r. name ( ) ,
325
+ Self :: Xtensa ( r) => r. name ( ) ,
320
326
Self :: Bpf ( r) => r. name ( ) ,
321
327
Self :: Avr ( r) => r. name ( ) ,
322
328
Self :: Msp430 ( r) => r. name ( ) ,
@@ -338,6 +344,7 @@ impl InlineAsmReg {
338
344
Self :: Mips ( r) => InlineAsmRegClass :: Mips ( r. reg_class ( ) ) ,
339
345
Self :: S390x ( r) => InlineAsmRegClass :: S390x ( r. reg_class ( ) ) ,
340
346
Self :: Sparc ( r) => InlineAsmRegClass :: Sparc ( r. reg_class ( ) ) ,
347
+ Self :: Xtensa ( r) => InlineAsmRegClass :: Xtensa ( r. reg_class ( ) ) ,
341
348
Self :: Bpf ( r) => InlineAsmRegClass :: Bpf ( r. reg_class ( ) ) ,
342
349
Self :: Avr ( r) => InlineAsmRegClass :: Avr ( r. reg_class ( ) ) ,
343
350
Self :: Msp430 ( r) => InlineAsmRegClass :: Msp430 ( r. reg_class ( ) ) ,
@@ -369,6 +376,9 @@ impl InlineAsmReg {
369
376
InlineAsmArch :: Mips | InlineAsmArch :: Mips64 => {
370
377
Self :: Mips ( MipsInlineAsmReg :: parse ( name) ?)
371
378
}
379
+ InlineAsmArch :: Xtensa => {
380
+ Self :: Xtensa ( XtensaInlineAsmReg :: parse ( name) ?)
381
+ }
372
382
InlineAsmArch :: S390x => Self :: S390x ( S390xInlineAsmReg :: parse ( name) ?) ,
373
383
InlineAsmArch :: Sparc | InlineAsmArch :: Sparc64 => {
374
384
Self :: Sparc ( SparcInlineAsmReg :: parse ( name) ?)
@@ -408,6 +418,7 @@ impl InlineAsmReg {
408
418
Self :: Sparc ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
409
419
Self :: Bpf ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
410
420
Self :: Avr ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
421
+ Self :: Xtensa ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
411
422
Self :: Msp430 ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
412
423
Self :: M68k ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
413
424
Self :: CSKY ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
@@ -434,6 +445,7 @@ impl InlineAsmReg {
434
445
Self :: Mips ( r) => r. emit ( out, arch, modifier) ,
435
446
Self :: S390x ( r) => r. emit ( out, arch, modifier) ,
436
447
Self :: Sparc ( r) => r. emit ( out, arch, modifier) ,
448
+ Self :: Xtensa ( r) => r. emit ( out, arch, modifier) ,
437
449
Self :: Bpf ( r) => r. emit ( out, arch, modifier) ,
438
450
Self :: Avr ( r) => r. emit ( out, arch, modifier) ,
439
451
Self :: Msp430 ( r) => r. emit ( out, arch, modifier) ,
@@ -455,6 +467,7 @@ impl InlineAsmReg {
455
467
Self :: Mips ( _) => cb ( self ) ,
456
468
Self :: S390x ( r) => r. overlapping_regs ( |r| cb ( Self :: S390x ( r) ) ) ,
457
469
Self :: Sparc ( _) => cb ( self ) ,
470
+ Self :: Xtensa ( _) => cb ( self ) ,
458
471
Self :: Bpf ( r) => r. overlapping_regs ( |r| cb ( Self :: Bpf ( r) ) ) ,
459
472
Self :: Avr ( r) => r. overlapping_regs ( |r| cb ( Self :: Avr ( r) ) ) ,
460
473
Self :: Msp430 ( _) => cb ( self ) ,
@@ -481,6 +494,7 @@ pub enum InlineAsmRegClass {
481
494
Sparc ( SparcInlineAsmRegClass ) ,
482
495
SpirV ( SpirVInlineAsmRegClass ) ,
483
496
Wasm ( WasmInlineAsmRegClass ) ,
497
+ Xtensa ( XtensaInlineAsmRegClass ) ,
484
498
Bpf ( BpfInlineAsmRegClass ) ,
485
499
Avr ( AvrInlineAsmRegClass ) ,
486
500
Msp430 ( Msp430InlineAsmRegClass ) ,
@@ -506,6 +520,7 @@ impl InlineAsmRegClass {
506
520
Self :: Sparc ( r) => r. name ( ) ,
507
521
Self :: SpirV ( r) => r. name ( ) ,
508
522
Self :: Wasm ( r) => r. name ( ) ,
523
+ Self :: Xtensa ( r) => r. name ( ) ,
509
524
Self :: Bpf ( r) => r. name ( ) ,
510
525
Self :: Avr ( r) => r. name ( ) ,
511
526
Self :: Msp430 ( r) => r. name ( ) ,
@@ -533,6 +548,7 @@ impl InlineAsmRegClass {
533
548
Self :: Sparc ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Sparc ) ,
534
549
Self :: SpirV ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: SpirV ) ,
535
550
Self :: Wasm ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Wasm ) ,
551
+ Self :: Xtensa ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Xtensa ) ,
536
552
Self :: Bpf ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Bpf ) ,
537
553
Self :: Avr ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Avr ) ,
538
554
Self :: Msp430 ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Msp430 ) ,
@@ -563,6 +579,7 @@ impl InlineAsmRegClass {
563
579
Self :: Sparc ( r) => r. suggest_modifier ( arch, ty) ,
564
580
Self :: SpirV ( r) => r. suggest_modifier ( arch, ty) ,
565
581
Self :: Wasm ( r) => r. suggest_modifier ( arch, ty) ,
582
+ Self :: Xtensa ( r) => r. suggest_modifier ( arch, ty) ,
566
583
Self :: Bpf ( r) => r. suggest_modifier ( arch, ty) ,
567
584
Self :: Avr ( r) => r. suggest_modifier ( arch, ty) ,
568
585
Self :: Msp430 ( r) => r. suggest_modifier ( arch, ty) ,
@@ -593,6 +610,7 @@ impl InlineAsmRegClass {
593
610
Self :: Sparc ( r) => r. default_modifier ( arch) ,
594
611
Self :: SpirV ( r) => r. default_modifier ( arch) ,
595
612
Self :: Wasm ( r) => r. default_modifier ( arch) ,
613
+ Self :: Xtensa ( r) => r. default_modifier ( arch) ,
596
614
Self :: Bpf ( r) => r. default_modifier ( arch) ,
597
615
Self :: Avr ( r) => r. default_modifier ( arch) ,
598
616
Self :: Msp430 ( r) => r. default_modifier ( arch) ,
@@ -626,6 +644,7 @@ impl InlineAsmRegClass {
626
644
Self :: Sparc ( r) => r. supported_types ( arch) ,
627
645
Self :: SpirV ( r) => r. supported_types ( arch) ,
628
646
Self :: Wasm ( r) => r. supported_types ( arch) ,
647
+ Self :: Xtensa ( r) => r. supported_types ( arch) ,
629
648
Self :: Bpf ( r) => r. supported_types ( arch) ,
630
649
Self :: Avr ( r) => r. supported_types ( arch) ,
631
650
Self :: Msp430 ( r) => r. supported_types ( arch) ,
@@ -666,6 +685,7 @@ impl InlineAsmRegClass {
666
685
}
667
686
InlineAsmArch :: Bpf => Self :: Bpf ( BpfInlineAsmRegClass :: parse ( name) ?) ,
668
687
InlineAsmArch :: Avr => Self :: Avr ( AvrInlineAsmRegClass :: parse ( name) ?) ,
688
+ InlineAsmArch :: Xtensa => Self :: Xtensa ( XtensaInlineAsmRegClass :: parse ( name) ?) ,
669
689
InlineAsmArch :: Msp430 => Self :: Msp430 ( Msp430InlineAsmRegClass :: parse ( name) ?) ,
670
690
InlineAsmArch :: M68k => Self :: M68k ( M68kInlineAsmRegClass :: parse ( name) ?) ,
671
691
InlineAsmArch :: CSKY => Self :: CSKY ( CSKYInlineAsmRegClass :: parse ( name) ?) ,
@@ -689,6 +709,7 @@ impl InlineAsmRegClass {
689
709
Self :: Sparc ( r) => r. valid_modifiers ( arch) ,
690
710
Self :: SpirV ( r) => r. valid_modifiers ( arch) ,
691
711
Self :: Wasm ( r) => r. valid_modifiers ( arch) ,
712
+ Self :: Xtensa ( r) => r. valid_modifiers ( arch) ,
692
713
Self :: Bpf ( r) => r. valid_modifiers ( arch) ,
693
714
Self :: Avr ( r) => r. valid_modifiers ( arch) ,
694
715
Self :: Msp430 ( r) => r. valid_modifiers ( arch) ,
@@ -736,6 +757,7 @@ impl fmt::Display for InlineAsmRegOrRegClass {
736
757
/// Set of types which can be used with a particular register class.
737
758
#[ derive( Copy , Clone , Debug , Eq , PartialEq ) ]
738
759
pub enum InlineAsmType {
760
+ I1 ,
739
761
I8 ,
740
762
I16 ,
741
763
I32 ,
@@ -763,6 +785,7 @@ impl InlineAsmType {
763
785
764
786
pub fn size ( self ) -> Size {
765
787
Size :: from_bytes ( match self {
788
+ Self :: I1 => return Size :: from_bits ( 1 ) ,
766
789
Self :: I8 => 1 ,
767
790
Self :: I16 => 2 ,
768
791
Self :: I32 => 4 ,
@@ -788,6 +811,7 @@ impl InlineAsmType {
788
811
impl fmt:: Display for InlineAsmType {
789
812
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
790
813
match * self {
814
+ Self :: I1 => f. write_str ( "i1" ) ,
791
815
Self :: I8 => f. write_str ( "i8" ) ,
792
816
Self :: I16 => f. write_str ( "i16" ) ,
793
817
Self :: I32 => f. write_str ( "i32" ) ,
@@ -890,6 +914,11 @@ pub fn allocatable_registers(
890
914
wasm:: fill_reg_map ( arch, reloc_model, target_features, target, & mut map) ;
891
915
map
892
916
}
917
+ InlineAsmArch :: Xtensa => {
918
+ let mut map = xtensa:: regclass_map ( ) ;
919
+ xtensa:: fill_reg_map ( arch, reloc_model, target_features, target, & mut map) ;
920
+ map
921
+ }
893
922
InlineAsmArch :: Bpf => {
894
923
let mut map = bpf:: regclass_map ( ) ;
895
924
bpf:: fill_reg_map ( arch, reloc_model, target_features, target, & mut map) ;
0 commit comments