@@ -6,7 +6,7 @@ use super::{
6
6
asm:: AsmScalar ,
7
7
asm:: AsmScalarKind :: { Float , Integer , Vector } ,
8
8
builtins:: BuiltinSignature ,
9
- ArchProperties , AsmProperties , LongDoubleFormat , PrimitiveProperties ,
9
+ AbiProperties , ArchProperties , AsmProperties , FloatFormat , PrimitiveProperties ,
10
10
} ;
11
11
12
12
macro_rules! x86_machines{
@@ -564,6 +564,33 @@ pub const X86_16_TAG_NAMES: Span<StringView> = span![
564
564
const_sv!( "fastcall" )
565
565
] ;
566
566
567
+ pub const X86_VECTOR_ABI_FEATURES : Span < Pair < u16 , StringView > > = span ! [
568
+ Pair ( 8 , const_sv!( "mmx" ) ) ,
569
+ Pair ( 16 , const_sv!( "sse" ) ) ,
570
+ Pair ( 32 , const_sv!( "avx" ) ) ,
571
+ Pair ( 64 , const_sv!( "avx512f" ) ) ,
572
+ Pair ( 1024 , const_sv!( "amx-tile" ) )
573
+ ] ;
574
+ pub const X86_FLOAT_ABI_FEATURES : Span < Pair < super :: FloatFormat , StringView > > = span ! [ Pair (
575
+ super :: FloatFormat :: X87DoubleExtended ,
576
+ const_sv!( "x87" )
577
+ ) , ] ;
578
+
579
+ pub static X86_64_ABI_PROPERTIES : AbiProperties = AbiProperties {
580
+ vector_default_feature : const_sv ! ( "" ) , // An empty string will never be settable with `-m`
581
+ vector_width_features : X86_VECTOR_ABI_FEATURES ,
582
+ float_format_features : X86_FLOAT_ABI_FEATURES ,
583
+ float_default_features : const_sv ! ( "sse" ) ,
584
+ } ;
585
+
586
+ // x86-64 vs. IA-32 and IA-16 only differs in requiring sse vs. x87 for floats.
587
+ pub static X86_ABI_PROPERTIES : AbiProperties = AbiProperties {
588
+ vector_default_feature : const_sv ! ( "" ) , // An empty string will never be settable with `-m`
589
+ vector_width_features : X86_VECTOR_ABI_FEATURES ,
590
+ float_format_features : X86_FLOAT_ABI_FEATURES ,
591
+ float_default_features : const_sv ! ( "x87" ) ,
592
+ } ;
593
+
567
594
pub static X86_64 : ArchProperties = ArchProperties {
568
595
lock_free_atomic_masks : 0xFF ,
569
596
builtins : X86_BUILTINS ,
@@ -575,6 +602,7 @@ pub static X86_64: ArchProperties = ArchProperties {
575
602
asm_propreties : & X86_64_ASM_PROPERTIES ,
576
603
tag_names : X86_64_TAG_NAMES ,
577
604
width : 64 ,
605
+ abi_properties : Some ( & X86_64_ABI_PROPERTIES ) ,
578
606
} ;
579
607
580
608
pub static X86_64_V2 : ArchProperties = ArchProperties {
@@ -588,6 +616,7 @@ pub static X86_64_V2: ArchProperties = ArchProperties {
588
616
asm_propreties : & X86_64_ASM_PROPERTIES ,
589
617
tag_names : X86_64_TAG_NAMES ,
590
618
width : 64 ,
619
+ abi_properties : Some ( & X86_64_ABI_PROPERTIES ) ,
591
620
} ;
592
621
593
622
pub static X86_64_V3 : ArchProperties = ArchProperties {
@@ -601,6 +630,7 @@ pub static X86_64_V3: ArchProperties = ArchProperties {
601
630
asm_propreties : & X86_64_ASM_PROPERTIES ,
602
631
tag_names : X86_64_TAG_NAMES ,
603
632
width : 64 ,
633
+ abi_properties : Some ( & X86_64_ABI_PROPERTIES ) ,
604
634
} ;
605
635
606
636
pub static X86_64_V4 : ArchProperties = ArchProperties {
@@ -614,6 +644,7 @@ pub static X86_64_V4: ArchProperties = ArchProperties {
614
644
asm_propreties : & X86_64_ASM_PROPERTIES ,
615
645
tag_names : X86_64_TAG_NAMES ,
616
646
width : 64 ,
647
+ abi_properties : Some ( & X86_64_ABI_PROPERTIES ) ,
617
648
} ;
618
649
619
650
pub static I386 : ArchProperties = ArchProperties {
@@ -627,6 +658,7 @@ pub static I386: ArchProperties = ArchProperties {
627
658
asm_propreties : & X86_32_ASM_PROPERTIES ,
628
659
tag_names : X86_32_TAG_NAMES ,
629
660
width : 32 ,
661
+ abi_properties : Some ( & X86_ABI_PROPERTIES ) ,
630
662
} ;
631
663
632
664
pub static I486 : ArchProperties = ArchProperties {
@@ -640,6 +672,7 @@ pub static I486: ArchProperties = ArchProperties {
640
672
asm_propreties : & X86_32_ASM_PROPERTIES ,
641
673
tag_names : X86_32_TAG_NAMES ,
642
674
width : 32 ,
675
+ abi_properties : Some ( & X86_ABI_PROPERTIES ) ,
643
676
} ;
644
677
pub static I586 : ArchProperties = ArchProperties {
645
678
lock_free_atomic_masks : 0xF ,
@@ -652,6 +685,7 @@ pub static I586: ArchProperties = ArchProperties {
652
685
asm_propreties : & X86_32_ASM_PROPERTIES ,
653
686
tag_names : X86_32_TAG_NAMES ,
654
687
width : 32 ,
688
+ abi_properties : Some ( & X86_ABI_PROPERTIES ) ,
655
689
} ;
656
690
657
691
pub static I686 : ArchProperties = ArchProperties {
@@ -665,6 +699,7 @@ pub static I686: ArchProperties = ArchProperties {
665
699
asm_propreties : & X86_32_ASM_PROPERTIES ,
666
700
tag_names : X86_32_TAG_NAMES ,
667
701
width : 32 ,
702
+ abi_properties : Some ( & X86_ABI_PROPERTIES ) ,
668
703
} ;
669
704
670
705
pub static I86 : ArchProperties = ArchProperties {
@@ -678,6 +713,7 @@ pub static I86: ArchProperties = ArchProperties {
678
713
asm_propreties : & X86_16_ASM_PROPERTIES ,
679
714
tag_names : X86_16_TAG_NAMES ,
680
715
width : 16 ,
716
+ abi_properties : Some ( & X86_ABI_PROPERTIES ) ,
681
717
} ;
682
718
683
719
pub static X86_64_PRIMITIVES : PrimitiveProperties = PrimitiveProperties {
@@ -694,7 +730,7 @@ pub static X86_64_PRIMITIVES: PrimitiveProperties = PrimitiveProperties {
694
730
sizebits : 64 ,
695
731
lock_free_atomic_mask : 0xffff ,
696
732
ldbl_align : 16 ,
697
- ldbl_format : super :: LongDoubleFormat :: X87 ,
733
+ ldbl_format : FloatFormat :: X87DoubleExtended ,
698
734
max_atomic_align : 16 ,
699
735
} ;
700
736
@@ -712,7 +748,7 @@ pub static X32_PRIMITIVES: PrimitiveProperties = PrimitiveProperties {
712
748
sizebits : 32 ,
713
749
lock_free_atomic_mask : 0xffff ,
714
750
ldbl_align : 16 ,
715
- ldbl_format : super :: LongDoubleFormat :: X87 ,
751
+ ldbl_format : FloatFormat :: X87DoubleExtended ,
716
752
max_atomic_align : 16 ,
717
753
} ;
718
754
@@ -730,7 +766,7 @@ pub static X86_32_PRIMITIVES: PrimitiveProperties = PrimitiveProperties {
730
766
lock_free_atomic_mask : 0xf ,
731
767
sizebits : 32 ,
732
768
ldbl_align : 4 ,
733
- ldbl_format : LongDoubleFormat :: X87 ,
769
+ ldbl_format : FloatFormat :: X87DoubleExtended ,
734
770
max_atomic_align : 4 ,
735
771
} ;
736
772
@@ -748,7 +784,7 @@ pub static X86_16_NEAR_PRIMITIVES: PrimitiveProperties = PrimitiveProperties {
748
784
lock_free_atomic_mask : 0x3 ,
749
785
sizebits : 16 ,
750
786
ldbl_align : 4 ,
751
- ldbl_format : LongDoubleFormat :: X87 ,
787
+ ldbl_format : FloatFormat :: X87DoubleExtended ,
752
788
max_atomic_align : 2 ,
753
789
} ;
754
790
@@ -766,7 +802,7 @@ pub static X86_16_FAR_PRIMITIVES: PrimitiveProperties = PrimitiveProperties {
766
802
lock_free_atomic_mask : 0x3 ,
767
803
sizebits : 16 ,
768
804
ldbl_align : 4 ,
769
- ldbl_format : LongDoubleFormat :: X87 ,
805
+ ldbl_format : FloatFormat :: X87DoubleExtended ,
770
806
max_atomic_align : 2 ,
771
807
} ;
772
808
@@ -784,7 +820,7 @@ pub static X86_16_NEAR_DATA_FAR_FN_PRIMITIVES: PrimitiveProperties = PrimitivePr
784
820
lock_free_atomic_mask : 0x3 ,
785
821
sizebits : 16 ,
786
822
ldbl_align : 4 ,
787
- ldbl_format : LongDoubleFormat :: X87 ,
823
+ ldbl_format : FloatFormat :: X87DoubleExtended ,
788
824
max_atomic_align : 2 ,
789
825
} ;
790
826
@@ -802,6 +838,6 @@ pub static X86_16_FAR_DATA_NEAR_FN_PRIMITIVES: PrimitiveProperties = PrimitivePr
802
838
lock_free_atomic_mask : 0x3 ,
803
839
sizebits : 16 ,
804
840
ldbl_align : 4 ,
805
- ldbl_format : LongDoubleFormat :: X87 ,
841
+ ldbl_format : FloatFormat :: X87DoubleExtended ,
806
842
max_atomic_align : 2 ,
807
843
} ;
0 commit comments