@@ -260,6 +260,7 @@ struct is_supported_char_type
260
260
> {
261
261
};
262
262
263
+ #if 0
263
264
union float_union {
264
265
float f;
265
266
uint32_t bits;
@@ -341,6 +342,7 @@ fastfloat_really_inline constexpr std::bfloat16_t bit_cast(const uint16_t &u) {
341
342
return fu.f;
342
343
}
343
344
#endif // __STDCPP_BFLOAT16_T__
345
+ #endif // 0
344
346
345
347
// Compares two ASCII strings in a case insensitive manner.
346
348
template <typename UC>
@@ -519,25 +521,25 @@ template <typename T, typename U = void> struct binary_format_lookup_tables;
519
521
template <typename T> struct binary_format : binary_format_lookup_tables<T> {
520
522
using equiv_uint = equiv_uint_t <T>;
521
523
522
- static inline constexpr int mantissa_explicit_bits ();
523
- static inline constexpr int minimum_exponent ();
524
- static inline constexpr int infinite_power ();
525
- static inline constexpr int sign_index ();
526
- static inline constexpr int
524
+ static constexpr int mantissa_explicit_bits ();
525
+ static constexpr int minimum_exponent ();
526
+ static constexpr int infinite_power ();
527
+ static constexpr int sign_index ();
528
+ static constexpr int
527
529
min_exponent_fast_path (); // used when fegetround() == FE_TONEAREST
528
- static inline constexpr int max_exponent_fast_path ();
529
- static inline constexpr int max_exponent_round_to_even ();
530
- static inline constexpr int min_exponent_round_to_even ();
531
- static inline constexpr uint64_t max_mantissa_fast_path (int64_t power);
532
- static inline constexpr uint64_t
530
+ static constexpr int max_exponent_fast_path ();
531
+ static constexpr int max_exponent_round_to_even ();
532
+ static constexpr int min_exponent_round_to_even ();
533
+ static constexpr uint64_t max_mantissa_fast_path (int64_t power);
534
+ static constexpr uint64_t
533
535
max_mantissa_fast_path (); // used when fegetround() == FE_TONEAREST
534
- static inline constexpr int largest_power_of_ten ();
535
- static inline constexpr int smallest_power_of_ten ();
536
- static inline constexpr T exact_power_of_ten (int64_t power);
537
- static inline constexpr size_t max_digits ();
538
- static inline constexpr equiv_uint exponent_mask ();
539
- static inline constexpr equiv_uint mantissa_mask ();
540
- static inline constexpr equiv_uint hidden_bit_mask ();
536
+ static constexpr int largest_power_of_ten ();
537
+ static constexpr int smallest_power_of_ten ();
538
+ static constexpr T exact_power_of_ten (int64_t power);
539
+ static constexpr size_t max_digits ();
540
+ static constexpr equiv_uint exponent_mask ();
541
+ static constexpr equiv_uint mantissa_mask ();
542
+ static constexpr equiv_uint hidden_bit_mask ();
541
543
};
542
544
543
545
template <typename U> struct binary_format_lookup_tables <double , U> {
@@ -710,6 +712,11 @@ inline constexpr uint64_t binary_format<double>::max_mantissa_fast_path() {
710
712
return uint64_t (2 ) << mantissa_explicit_bits ();
711
713
}
712
714
715
+ template <>
716
+ inline constexpr uint64_t binary_format<float >::max_mantissa_fast_path() {
717
+ return uint64_t (2 ) << mantissa_explicit_bits ();
718
+ }
719
+
713
720
// credit: Jakub Jelínek
714
721
#ifdef __STDCPP_FLOAT16_T__
715
722
template <typename U> struct binary_format_lookup_tables <std::float16_t , U> {
@@ -768,6 +775,11 @@ inline constexpr int binary_format<std::float16_t>::max_exponent_fast_path() {
768
775
return 4 ;
769
776
}
770
777
778
+ template <>
779
+ inline constexpr int binary_format<std::float16_t >::mantissa_explicit_bits() {
780
+ return 10 ;
781
+ }
782
+
771
783
template <>
772
784
inline constexpr uint64_t
773
785
binary_format<std::float16_t >::max_mantissa_fast_path() {
@@ -790,43 +802,43 @@ inline constexpr int binary_format<std::float16_t>::min_exponent_fast_path() {
790
802
}
791
803
792
804
template <>
793
- constexpr int binary_format<std::float16_t >::mantissa_explicit_bits() {
794
- return 10 ;
795
- }
796
-
797
- template <>
798
- constexpr int binary_format<std::float16_t >::max_exponent_round_to_even() {
805
+ inline constexpr int
806
+ binary_format<std::float16_t >::max_exponent_round_to_even() {
799
807
return 5 ;
800
808
}
801
809
802
810
template <>
803
- constexpr int binary_format<std::float16_t >::min_exponent_round_to_even() {
811
+ inline constexpr int
812
+ binary_format<std::float16_t >::min_exponent_round_to_even() {
804
813
return -22 ;
805
814
}
806
815
807
- template <> constexpr int binary_format<std::float16_t >::minimum_exponent() {
816
+ template <>
817
+ inline constexpr int binary_format<std::float16_t >::minimum_exponent() {
808
818
return -15 ;
809
819
}
810
820
811
- template <> constexpr int binary_format<std::float16_t >::infinite_power() {
821
+ template <>
822
+ inline constexpr int binary_format<std::float16_t >::infinite_power() {
812
823
return 0x1F ;
813
824
}
814
825
815
- template <> constexpr int binary_format<std::float16_t >::sign_index() {
826
+ template <> inline constexpr int binary_format<std::float16_t >::sign_index() {
816
827
return 15 ;
817
828
}
818
829
819
830
template <>
820
- constexpr int binary_format<std::float16_t >::largest_power_of_ten() {
831
+ inline constexpr int binary_format<std::float16_t >::largest_power_of_ten() {
821
832
return 4 ;
822
833
}
823
834
824
835
template <>
825
- constexpr int binary_format<std::float16_t >::smallest_power_of_ten() {
836
+ inline constexpr int binary_format<std::float16_t >::smallest_power_of_ten() {
826
837
return -27 ;
827
838
}
828
839
829
- template <> constexpr size_t binary_format<std::float16_t >::max_digits() {
840
+ template <>
841
+ inline constexpr size_t binary_format<std::float16_t >::max_digits() {
830
842
return 22 ;
831
843
}
832
844
@@ -887,6 +899,11 @@ binary_format<std::bfloat16_t>::hidden_bit_mask() {
887
899
return 0x0080 ;
888
900
}
889
901
902
+ template <>
903
+ inline constexpr int binary_format<std::bfloat16_t >::mantissa_explicit_bits() {
904
+ return 7 ;
905
+ }
906
+
890
907
template <>
891
908
inline constexpr uint64_t
892
909
binary_format<std::bfloat16_t >::max_mantissa_fast_path() {
@@ -909,43 +926,43 @@ inline constexpr int binary_format<std::bfloat16_t>::min_exponent_fast_path() {
909
926
}
910
927
911
928
template <>
912
- constexpr int binary_format<std::bfloat16_t >::mantissa_explicit_bits() {
913
- return 7 ;
914
- }
915
-
916
- template <>
917
- constexpr int binary_format<std::bfloat16_t >::max_exponent_round_to_even() {
929
+ inline constexpr int
930
+ binary_format<std::bfloat16_t >::max_exponent_round_to_even() {
918
931
return 3 ;
919
932
}
920
933
921
934
template <>
922
- constexpr int binary_format<std::bfloat16_t >::min_exponent_round_to_even() {
935
+ inline constexpr int
936
+ binary_format<std::bfloat16_t >::min_exponent_round_to_even() {
923
937
return -24 ;
924
938
}
925
939
926
- template <> constexpr int binary_format<std::bfloat16_t >::minimum_exponent() {
940
+ template <>
941
+ inline constexpr int binary_format<std::bfloat16_t >::minimum_exponent() {
927
942
return -127 ;
928
943
}
929
944
930
- template <> constexpr int binary_format<std::bfloat16_t >::infinite_power() {
945
+ template <>
946
+ inline constexpr int binary_format<std::bfloat16_t >::infinite_power() {
931
947
return 0xFF ;
932
948
}
933
949
934
- template <> constexpr int binary_format<std::bfloat16_t >::sign_index() {
950
+ template <> inline constexpr int binary_format<std::bfloat16_t >::sign_index() {
935
951
return 15 ;
936
952
}
937
953
938
954
template <>
939
- constexpr int binary_format<std::bfloat16_t >::largest_power_of_ten() {
955
+ inline constexpr int binary_format<std::bfloat16_t >::largest_power_of_ten() {
940
956
return 38 ;
941
957
}
942
958
943
959
template <>
944
- constexpr int binary_format<std::bfloat16_t >::smallest_power_of_ten() {
960
+ inline constexpr int binary_format<std::bfloat16_t >::smallest_power_of_ten() {
945
961
return -60 ;
946
962
}
947
963
948
- template <> constexpr size_t binary_format<std::bfloat16_t >::max_digits() {
964
+ template <>
965
+ inline constexpr size_t binary_format<std::bfloat16_t >::max_digits() {
949
966
return 98 ;
950
967
}
951
968
@@ -961,11 +978,6 @@ binary_format<double>::max_mantissa_fast_path(int64_t power) {
961
978
return (void )max_mantissa[0 ], max_mantissa[power];
962
979
}
963
980
964
- template <>
965
- inline constexpr uint64_t binary_format<float >::max_mantissa_fast_path() {
966
- return uint64_t (2 ) << mantissa_explicit_bits ();
967
- }
968
-
969
981
template <>
970
982
inline constexpr uint64_t
971
983
binary_format<float >::max_mantissa_fast_path(int64_t power) {
@@ -1064,6 +1076,7 @@ to_float(bool negative, adjusted_mantissa am, T &value) {
1064
1076
#endif
1065
1077
}
1066
1078
1079
+ #if 0
1067
1080
#ifdef __STDCPP_FLOAT16_T__
1068
1081
template <>
1069
1082
fastfloat_really_inline void to_float<std::float16_t>(bool negative,
@@ -1091,6 +1104,7 @@ fastfloat_really_inline void to_float<std::bfloat16_t>(bool negative,
1091
1104
}
1092
1105
1093
1106
#endif // __STDCPP_BFLOAT16_T__
1107
+ #endif // 0
1094
1108
1095
1109
template <typename = void > struct space_lut {
1096
1110
static constexpr bool value[] = {
0 commit comments