@@ -192,6 +192,7 @@ mod s390x;
192
192
mod spirv;
193
193
mod wasm;
194
194
mod x86;
195
+ mod xtensa;
195
196
196
197
pub use aarch64:: { AArch64InlineAsmReg , AArch64InlineAsmRegClass } ;
197
198
pub use arm:: { ArmInlineAsmReg , ArmInlineAsmRegClass } ;
@@ -209,6 +210,7 @@ pub use riscv::{RiscVInlineAsmReg, RiscVInlineAsmRegClass};
209
210
pub use s390x:: { S390xInlineAsmReg , S390xInlineAsmRegClass } ;
210
211
pub use spirv:: { SpirVInlineAsmReg , SpirVInlineAsmRegClass } ;
211
212
pub use wasm:: { WasmInlineAsmReg , WasmInlineAsmRegClass } ;
213
+ pub use xtensa:: { XtensaInlineAsmReg , XtensaInlineAsmRegClass } ;
212
214
pub use x86:: { X86InlineAsmReg , X86InlineAsmRegClass } ;
213
215
214
216
#[ derive( Copy , Clone , Encodable , Decodable , Debug , Eq , PartialEq , Hash ) ]
@@ -231,6 +233,7 @@ pub enum InlineAsmArch {
231
233
SpirV ,
232
234
Wasm32 ,
233
235
Wasm64 ,
236
+ Xtensa ,
234
237
Bpf ,
235
238
Avr ,
236
239
Msp430 ,
@@ -261,6 +264,7 @@ impl FromStr for InlineAsmArch {
261
264
"spirv" => Ok ( Self :: SpirV ) ,
262
265
"wasm32" => Ok ( Self :: Wasm32 ) ,
263
266
"wasm64" => Ok ( Self :: Wasm64 ) ,
267
+ "xtensa" => Ok ( Self :: Xtensa ) ,
264
268
"bpf" => Ok ( Self :: Bpf ) ,
265
269
"avr" => Ok ( Self :: Avr ) ,
266
270
"msp430" => Ok ( Self :: Msp430 ) ,
@@ -286,6 +290,7 @@ pub enum InlineAsmReg {
286
290
S390x ( S390xInlineAsmReg ) ,
287
291
SpirV ( SpirVInlineAsmReg ) ,
288
292
Wasm ( WasmInlineAsmReg ) ,
293
+ Xtensa ( XtensaInlineAsmReg ) ,
289
294
Bpf ( BpfInlineAsmReg ) ,
290
295
Avr ( AvrInlineAsmReg ) ,
291
296
Msp430 ( Msp430InlineAsmReg ) ,
@@ -307,6 +312,7 @@ impl InlineAsmReg {
307
312
Self :: LoongArch ( r) => r. name ( ) ,
308
313
Self :: Mips ( r) => r. name ( ) ,
309
314
Self :: S390x ( r) => r. name ( ) ,
315
+ Self :: Xtensa ( r) => r. name ( ) ,
310
316
Self :: Bpf ( r) => r. name ( ) ,
311
317
Self :: Avr ( r) => r. name ( ) ,
312
318
Self :: Msp430 ( r) => r. name ( ) ,
@@ -327,6 +333,7 @@ impl InlineAsmReg {
327
333
Self :: LoongArch ( r) => InlineAsmRegClass :: LoongArch ( r. reg_class ( ) ) ,
328
334
Self :: Mips ( r) => InlineAsmRegClass :: Mips ( r. reg_class ( ) ) ,
329
335
Self :: S390x ( r) => InlineAsmRegClass :: S390x ( r. reg_class ( ) ) ,
336
+ Self :: Xtensa ( r) => InlineAsmRegClass :: Xtensa ( r. reg_class ( ) ) ,
330
337
Self :: Bpf ( r) => InlineAsmRegClass :: Bpf ( r. reg_class ( ) ) ,
331
338
Self :: Avr ( r) => InlineAsmRegClass :: Avr ( r. reg_class ( ) ) ,
332
339
Self :: Msp430 ( r) => InlineAsmRegClass :: Msp430 ( r. reg_class ( ) ) ,
@@ -358,6 +365,9 @@ impl InlineAsmReg {
358
365
InlineAsmArch :: Mips | InlineAsmArch :: Mips64 => {
359
366
Self :: Mips ( MipsInlineAsmReg :: parse ( name) ?)
360
367
}
368
+ InlineAsmArch :: Xtensa => {
369
+ Self :: Xtensa ( XtensaInlineAsmReg :: parse ( name) ?)
370
+ }
361
371
InlineAsmArch :: S390x => Self :: S390x ( S390xInlineAsmReg :: parse ( name) ?) ,
362
372
InlineAsmArch :: SpirV => Self :: SpirV ( SpirVInlineAsmReg :: parse ( name) ?) ,
363
373
InlineAsmArch :: Wasm32 | InlineAsmArch :: Wasm64 => {
@@ -393,6 +403,7 @@ impl InlineAsmReg {
393
403
Self :: S390x ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
394
404
Self :: Bpf ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
395
405
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) ,
396
407
Self :: Msp430 ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
397
408
Self :: M68k ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
398
409
Self :: CSKY ( r) => r. validate ( arch, reloc_model, target_features, target, is_clobber) ,
@@ -418,6 +429,7 @@ impl InlineAsmReg {
418
429
Self :: LoongArch ( r) => r. emit ( out, arch, modifier) ,
419
430
Self :: Mips ( r) => r. emit ( out, arch, modifier) ,
420
431
Self :: S390x ( r) => r. emit ( out, arch, modifier) ,
432
+ Self :: Xtensa ( r) => r. emit ( out, arch, modifier) ,
421
433
Self :: Bpf ( r) => r. emit ( out, arch, modifier) ,
422
434
Self :: Avr ( r) => r. emit ( out, arch, modifier) ,
423
435
Self :: Msp430 ( r) => r. emit ( out, arch, modifier) ,
@@ -438,6 +450,7 @@ impl InlineAsmReg {
438
450
Self :: LoongArch ( _) => cb ( self ) ,
439
451
Self :: Mips ( _) => cb ( self ) ,
440
452
Self :: S390x ( _) => cb ( self ) ,
453
+ Self :: Xtensa ( _) => cb ( self ) ,
441
454
Self :: Bpf ( r) => r. overlapping_regs ( |r| cb ( Self :: Bpf ( r) ) ) ,
442
455
Self :: Avr ( r) => r. overlapping_regs ( |r| cb ( Self :: Avr ( r) ) ) ,
443
456
Self :: Msp430 ( _) => cb ( self ) ,
@@ -463,6 +476,7 @@ pub enum InlineAsmRegClass {
463
476
S390x ( S390xInlineAsmRegClass ) ,
464
477
SpirV ( SpirVInlineAsmRegClass ) ,
465
478
Wasm ( WasmInlineAsmRegClass ) ,
479
+ Xtensa ( XtensaInlineAsmRegClass ) ,
466
480
Bpf ( BpfInlineAsmRegClass ) ,
467
481
Avr ( AvrInlineAsmRegClass ) ,
468
482
Msp430 ( Msp430InlineAsmRegClass ) ,
@@ -487,6 +501,7 @@ impl InlineAsmRegClass {
487
501
Self :: S390x ( r) => r. name ( ) ,
488
502
Self :: SpirV ( r) => r. name ( ) ,
489
503
Self :: Wasm ( r) => r. name ( ) ,
504
+ Self :: Xtensa ( r) => r. name ( ) ,
490
505
Self :: Bpf ( r) => r. name ( ) ,
491
506
Self :: Avr ( r) => r. name ( ) ,
492
507
Self :: Msp430 ( r) => r. name ( ) ,
@@ -513,6 +528,7 @@ impl InlineAsmRegClass {
513
528
Self :: S390x ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: S390x ) ,
514
529
Self :: SpirV ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: SpirV ) ,
515
530
Self :: Wasm ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Wasm ) ,
531
+ Self :: Xtensa ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Xtensa ) ,
516
532
Self :: Bpf ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Bpf ) ,
517
533
Self :: Avr ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Avr ) ,
518
534
Self :: Msp430 ( r) => r. suggest_class ( arch, ty) . map ( InlineAsmRegClass :: Msp430 ) ,
@@ -542,6 +558,7 @@ impl InlineAsmRegClass {
542
558
Self :: S390x ( r) => r. suggest_modifier ( arch, ty) ,
543
559
Self :: SpirV ( r) => r. suggest_modifier ( arch, ty) ,
544
560
Self :: Wasm ( r) => r. suggest_modifier ( arch, ty) ,
561
+ Self :: Xtensa ( r) => r. suggest_modifier ( arch, ty) ,
545
562
Self :: Bpf ( r) => r. suggest_modifier ( arch, ty) ,
546
563
Self :: Avr ( r) => r. suggest_modifier ( arch, ty) ,
547
564
Self :: Msp430 ( r) => r. suggest_modifier ( arch, ty) ,
@@ -571,6 +588,7 @@ impl InlineAsmRegClass {
571
588
Self :: S390x ( r) => r. default_modifier ( arch) ,
572
589
Self :: SpirV ( r) => r. default_modifier ( arch) ,
573
590
Self :: Wasm ( r) => r. default_modifier ( arch) ,
591
+ Self :: Xtensa ( r) => r. default_modifier ( arch) ,
574
592
Self :: Bpf ( r) => r. default_modifier ( arch) ,
575
593
Self :: Avr ( r) => r. default_modifier ( arch) ,
576
594
Self :: Msp430 ( r) => r. default_modifier ( arch) ,
@@ -599,6 +617,7 @@ impl InlineAsmRegClass {
599
617
Self :: S390x ( r) => r. supported_types ( arch) ,
600
618
Self :: SpirV ( r) => r. supported_types ( arch) ,
601
619
Self :: Wasm ( r) => r. supported_types ( arch) ,
620
+ Self :: Xtensa ( r) => r. supported_types ( arch) ,
602
621
Self :: Bpf ( r) => r. supported_types ( arch) ,
603
622
Self :: Avr ( r) => r. supported_types ( arch) ,
604
623
Self :: Msp430 ( r) => r. supported_types ( arch) ,
@@ -636,6 +655,7 @@ impl InlineAsmRegClass {
636
655
}
637
656
InlineAsmArch :: Bpf => Self :: Bpf ( BpfInlineAsmRegClass :: parse ( name) ?) ,
638
657
InlineAsmArch :: Avr => Self :: Avr ( AvrInlineAsmRegClass :: parse ( name) ?) ,
658
+ InlineAsmArch :: Xtensa => Self :: Xtensa ( XtensaInlineAsmRegClass :: parse ( name) ?) ,
639
659
InlineAsmArch :: Msp430 => Self :: Msp430 ( Msp430InlineAsmRegClass :: parse ( name) ?) ,
640
660
InlineAsmArch :: M68k => Self :: M68k ( M68kInlineAsmRegClass :: parse ( name) ?) ,
641
661
InlineAsmArch :: CSKY => Self :: CSKY ( CSKYInlineAsmRegClass :: parse ( name) ?) ,
@@ -658,6 +678,7 @@ impl InlineAsmRegClass {
658
678
Self :: S390x ( r) => r. valid_modifiers ( arch) ,
659
679
Self :: SpirV ( r) => r. valid_modifiers ( arch) ,
660
680
Self :: Wasm ( r) => r. valid_modifiers ( arch) ,
681
+ Self :: Xtensa ( r) => r. valid_modifiers ( arch) ,
661
682
Self :: Bpf ( r) => r. valid_modifiers ( arch) ,
662
683
Self :: Avr ( r) => r. valid_modifiers ( arch) ,
663
684
Self :: Msp430 ( r) => r. valid_modifiers ( arch) ,
@@ -702,6 +723,7 @@ impl fmt::Display for InlineAsmRegOrRegClass {
702
723
/// Set of types which can be used with a particular register class.
703
724
#[ derive( Copy , Clone , Debug , Eq , PartialEq ) ]
704
725
pub enum InlineAsmType {
726
+ I1 ,
705
727
I8 ,
706
728
I16 ,
707
729
I32 ,
@@ -729,6 +751,7 @@ impl InlineAsmType {
729
751
730
752
pub fn size ( self ) -> Size {
731
753
Size :: from_bytes ( match self {
754
+ Self :: I1 => return Size :: from_bits ( 1 ) ,
732
755
Self :: I8 => 1 ,
733
756
Self :: I16 => 2 ,
734
757
Self :: I32 => 4 ,
@@ -754,6 +777,7 @@ impl InlineAsmType {
754
777
impl fmt:: Display for InlineAsmType {
755
778
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
756
779
match * self {
780
+ Self :: I1 => f. write_str ( "i1" ) ,
757
781
Self :: I8 => f. write_str ( "i8" ) ,
758
782
Self :: I16 => f. write_str ( "i16" ) ,
759
783
Self :: I32 => f. write_str ( "i32" ) ,
@@ -851,6 +875,11 @@ pub fn allocatable_registers(
851
875
wasm:: fill_reg_map ( arch, reloc_model, target_features, target, & mut map) ;
852
876
map
853
877
}
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
+ }
854
883
InlineAsmArch :: Bpf => {
855
884
let mut map = bpf:: regclass_map ( ) ;
856
885
bpf:: fill_reg_map ( arch, reloc_model, target_features, target, & mut map) ;
0 commit comments