@@ -180,6 +180,7 @@ mod s390x;
180
180
mod spirv;
181
181
mod wasm;
182
182
mod x86;
183
+ mod xtensa;
183
184
184
185
pub use aarch64:: { AArch64InlineAsmReg , AArch64InlineAsmRegClass } ;
185
186
pub use arm:: { ArmInlineAsmReg , ArmInlineAsmRegClass } ;
@@ -197,6 +198,7 @@ pub use riscv::{RiscVInlineAsmReg, RiscVInlineAsmRegClass};
197
198
pub use s390x:: { S390xInlineAsmReg , S390xInlineAsmRegClass } ;
198
199
pub use spirv:: { SpirVInlineAsmReg , SpirVInlineAsmRegClass } ;
199
200
pub use wasm:: { WasmInlineAsmReg , WasmInlineAsmRegClass } ;
201
+ pub use xtensa:: { XtensaInlineAsmReg , XtensaInlineAsmRegClass } ;
200
202
pub use x86:: { X86InlineAsmReg , X86InlineAsmRegClass } ;
201
203
202
204
#[ derive( Copy , Clone , Encodable , Decodable , Debug , Eq , PartialEq , Hash ) ]
@@ -218,6 +220,7 @@ pub enum InlineAsmArch {
218
220
SpirV ,
219
221
Wasm32 ,
220
222
Wasm64 ,
223
+ Xtensa ,
221
224
Bpf ,
222
225
Avr ,
223
226
Msp430 ,
@@ -247,6 +250,7 @@ impl FromStr for InlineAsmArch {
247
250
"spirv" => Ok ( Self :: SpirV ) ,
248
251
"wasm32" => Ok ( Self :: Wasm32 ) ,
249
252
"wasm64" => Ok ( Self :: Wasm64 ) ,
253
+ "xtensa" => Ok ( Self :: Xtensa ) ,
250
254
"bpf" => Ok ( Self :: Bpf ) ,
251
255
"avr" => Ok ( Self :: Avr ) ,
252
256
"msp430" => Ok ( Self :: Msp430 ) ,
@@ -272,6 +276,7 @@ pub enum InlineAsmReg {
272
276
S390x ( S390xInlineAsmReg ) ,
273
277
SpirV ( SpirVInlineAsmReg ) ,
274
278
Wasm ( WasmInlineAsmReg ) ,
279
+ Xtensa ( XtensaInlineAsmReg ) ,
275
280
Bpf ( BpfInlineAsmReg ) ,
276
281
Avr ( AvrInlineAsmReg ) ,
277
282
Msp430 ( Msp430InlineAsmReg ) ,
@@ -293,6 +298,7 @@ impl InlineAsmReg {
293
298
Self :: LoongArch ( r) => r. name ( ) ,
294
299
Self :: Mips ( r) => r. name ( ) ,
295
300
Self :: S390x ( r) => r. name ( ) ,
301
+ Self :: Xtensa ( r) => r. name ( ) ,
296
302
Self :: Bpf ( r) => r. name ( ) ,
297
303
Self :: Avr ( r) => r. name ( ) ,
298
304
Self :: Msp430 ( r) => r. name ( ) ,
@@ -313,6 +319,7 @@ impl InlineAsmReg {
313
319
Self :: LoongArch ( r) => InlineAsmRegClass :: LoongArch ( r. reg_class ( ) ) ,
314
320
Self :: Mips ( r) => InlineAsmRegClass :: Mips ( r. reg_class ( ) ) ,
315
321
Self :: S390x ( r) => InlineAsmRegClass :: S390x ( r. reg_class ( ) ) ,
322
+ Self :: Xtensa ( r) => InlineAsmRegClass :: Xtensa ( r. reg_class ( ) ) ,
316
323
Self :: Bpf ( r) => InlineAsmRegClass :: Bpf ( r. reg_class ( ) ) ,
317
324
Self :: Avr ( r) => InlineAsmRegClass :: Avr ( r. reg_class ( ) ) ,
318
325
Self :: Msp430 ( r) => InlineAsmRegClass :: Msp430 ( r. reg_class ( ) ) ,
@@ -342,6 +349,9 @@ impl InlineAsmReg {
342
349
InlineAsmArch :: Mips | InlineAsmArch :: Mips64 => {
343
350
Self :: Mips ( MipsInlineAsmReg :: parse ( name) ?)
344
351
}
352
+ InlineAsmArch :: Xtensa => {
353
+ Self :: Xtensa ( XtensaInlineAsmReg :: parse ( name) ?)
354
+ }
345
355
InlineAsmArch :: S390x => Self :: S390x ( S390xInlineAsmReg :: parse ( name) ?) ,
346
356
InlineAsmArch :: SpirV => Self :: SpirV ( SpirVInlineAsmReg :: parse ( name) ?) ,
347
357
InlineAsmArch :: Wasm32 | InlineAsmArch :: Wasm64 => {
@@ -377,6 +387,7 @@ impl InlineAsmReg {
377
387
Self :: S390x ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
378
388
Self :: Bpf ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
379
389
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) ,
380
391
Self :: Msp430 ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
381
392
Self :: M68k ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
382
393
Self :: CSKY ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
@@ -402,6 +413,7 @@ impl InlineAsmReg {
402
413
Self :: LoongArch ( r) => r. emit ( out, arch, modifier) ,
403
414
Self :: Mips ( r) => r. emit ( out, arch, modifier) ,
404
415
Self :: S390x ( r) => r. emit ( out, arch, modifier) ,
416
+ Self :: Xtensa ( r) => r. emit ( out, arch, modifier) ,
405
417
Self :: Bpf ( r) => r. emit ( out, arch, modifier) ,
406
418
Self :: Avr ( r) => r. emit ( out, arch, modifier) ,
407
419
Self :: Msp430 ( r) => r. emit ( out, arch, modifier) ,
@@ -422,6 +434,7 @@ impl InlineAsmReg {
422
434
Self :: LoongArch ( _) => cb ( self ) ,
423
435
Self :: Mips ( _) => cb ( self ) ,
424
436
Self :: S390x ( _) => cb ( self ) ,
437
+ Self :: Xtensa ( _) => cb ( self ) ,
425
438
Self :: Bpf ( r) => r. overlapping_regs ( |r| cb ( Self :: Bpf ( r) ) ) ,
426
439
Self :: Avr ( r) => r. overlapping_regs ( |r| cb ( Self :: Avr ( r) ) ) ,
427
440
Self :: Msp430 ( _) => cb ( self ) ,
@@ -447,6 +460,7 @@ pub enum InlineAsmRegClass {
447
460
S390x ( S390xInlineAsmRegClass ) ,
448
461
SpirV ( SpirVInlineAsmRegClass ) ,
449
462
Wasm ( WasmInlineAsmRegClass ) ,
463
+ Xtensa ( XtensaInlineAsmRegClass ) ,
450
464
Bpf ( BpfInlineAsmRegClass ) ,
451
465
Avr ( AvrInlineAsmRegClass ) ,
452
466
Msp430 ( Msp430InlineAsmRegClass ) ,
@@ -471,6 +485,7 @@ impl InlineAsmRegClass {
471
485
Self :: S390x ( r) => r. name ( ) ,
472
486
Self :: SpirV ( r) => r. name ( ) ,
473
487
Self :: Wasm ( r) => r. name ( ) ,
488
+ Self :: Xtensa ( r) => r. name ( ) ,
474
489
Self :: Bpf ( r) => r. name ( ) ,
475
490
Self :: Avr ( r) => r. name ( ) ,
476
491
Self :: Msp430 ( r) => r. name ( ) ,
@@ -497,6 +512,7 @@ impl InlineAsmRegClass {
497
512
Self :: S390x ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: S390x ) ,
498
513
Self :: SpirV ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: SpirV ) ,
499
514
Self :: Wasm ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Wasm ) ,
515
+ Self :: Xtensa ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Xtensa ) ,
500
516
Self :: Bpf ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Bpf ) ,
501
517
Self :: Avr ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Avr ) ,
502
518
Self :: Msp430 ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Msp430 ) ,
@@ -530,6 +546,7 @@ impl InlineAsmRegClass {
530
546
Self :: S390x ( r) => r. suggest_modifier ( arch, ty) ,
531
547
Self :: SpirV ( r) => r. suggest_modifier ( arch, ty) ,
532
548
Self :: Wasm ( r) => r. suggest_modifier ( arch, ty) ,
549
+ Self :: Xtensa ( r) => r. suggest_modifier ( arch, ty) ,
533
550
Self :: Bpf ( r) => r. suggest_modifier ( arch, ty) ,
534
551
Self :: Avr ( r) => r. suggest_modifier ( arch, ty) ,
535
552
Self :: Msp430 ( r) => r. suggest_modifier ( arch, ty) ,
@@ -559,6 +576,7 @@ impl InlineAsmRegClass {
559
576
Self :: S390x ( r) => r. default_modifier ( arch) ,
560
577
Self :: SpirV ( r) => r. default_modifier ( arch) ,
561
578
Self :: Wasm ( r) => r. default_modifier ( arch) ,
579
+ Self :: Xtensa ( r) => r. default_modifier ( arch) ,
562
580
Self :: Bpf ( r) => r. default_modifier ( arch) ,
563
581
Self :: Avr ( r) => r. default_modifier ( arch) ,
564
582
Self :: Msp430 ( r) => r. default_modifier ( arch) ,
@@ -587,6 +605,7 @@ impl InlineAsmRegClass {
587
605
Self :: S390x ( r) => r. supported_types ( arch) ,
588
606
Self :: SpirV ( r) => r. supported_types ( arch) ,
589
607
Self :: Wasm ( r) => r. supported_types ( arch) ,
608
+ Self :: Xtensa ( r) => r. supported_types ( arch) ,
590
609
Self :: Bpf ( r) => r. supported_types ( arch) ,
591
610
Self :: Avr ( r) => r. supported_types ( arch) ,
592
611
Self :: Msp430 ( r) => r. supported_types ( arch) ,
@@ -622,6 +641,7 @@ impl InlineAsmRegClass {
622
641
}
623
642
InlineAsmArch :: Bpf => Self :: Bpf ( BpfInlineAsmRegClass :: parse ( name) ?) ,
624
643
InlineAsmArch :: Avr => Self :: Avr ( AvrInlineAsmRegClass :: parse ( name) ?) ,
644
+ InlineAsmArch :: Xtensa => Self :: Xtensa ( XtensaInlineAsmRegClass :: parse ( name) ?) ,
625
645
InlineAsmArch :: Msp430 => Self :: Msp430 ( Msp430InlineAsmRegClass :: parse ( name) ?) ,
626
646
InlineAsmArch :: M68k => Self :: M68k ( M68kInlineAsmRegClass :: parse ( name) ?) ,
627
647
InlineAsmArch :: CSKY => Self :: CSKY ( CSKYInlineAsmRegClass :: parse ( name) ?) ,
@@ -644,6 +664,7 @@ impl InlineAsmRegClass {
644
664
Self :: S390x ( r) => r. valid_modifiers ( arch) ,
645
665
Self :: SpirV ( r) => r. valid_modifiers ( arch) ,
646
666
Self :: Wasm ( r) => r. valid_modifiers ( arch) ,
667
+ Self :: Xtensa ( r) => r. valid_modifiers ( arch) ,
647
668
Self :: Bpf ( r) => r. valid_modifiers ( arch) ,
648
669
Self :: Avr ( r) => r. valid_modifiers ( arch) ,
649
670
Self :: Msp430 ( r) => r. valid_modifiers ( arch) ,
@@ -688,6 +709,7 @@ impl fmt::Display for InlineAsmRegOrRegClass {
688
709
/// Set of types which can be used with a particular register class.
689
710
#[ derive( Copy , Clone , Debug , Eq , PartialEq ) ]
690
711
pub enum InlineAsmType {
712
+ I1 ,
691
713
I8 ,
692
714
I16 ,
693
715
I32 ,
@@ -711,6 +733,7 @@ impl InlineAsmType {
711
733
712
734
pub fn size ( self ) -> Size {
713
735
Size :: from_bytes ( match self {
736
+ Self :: I1 => return Size :: from_bits ( 1 ) ,
714
737
Self :: I8 => 1 ,
715
738
Self :: I16 => 2 ,
716
739
Self :: I32 => 4 ,
@@ -732,6 +755,7 @@ impl InlineAsmType {
732
755
impl fmt:: Display for InlineAsmType {
733
756
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
734
757
match * self {
758
+ Self :: I1 => f. write_str ( "i1" ) ,
735
759
Self :: I8 => f. write_str ( "i8" ) ,
736
760
Self :: I16 => f. write_str ( "i16" ) ,
737
761
Self :: I32 => f. write_str ( "i32" ) ,
@@ -825,6 +849,11 @@ pub fn allocatable_registers(
825
849
wasm:: fill_reg_map ( arch, reloc_model, target_features, target, & mut map) ;
826
850
map
827
851
}
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
+ }
828
857
InlineAsmArch :: Bpf => {
829
858
let mut map = bpf:: regclass_map ( ) ;
830
859
bpf:: fill_reg_map ( arch, reloc_model, target_features, target, & mut map) ;
0 commit comments