Commit 31699d5
committed
Refactor ABI tag deduction and rebinding
ChangeLog:
* constexpr_tests.cpp: Adjust and test for more expected ABI
tags.
* generic-traits_tests.cpp: Add tests for __float_from,
__abi_tag, __native_abi, _Abi::_S_resize, and __abi_rebind.
* include/bits/simd_complex.h (__to_cx_ileav): Deduce new ABI
tag from __abi_rebind. Handle size 1 / bool case.
(basic_mask): Constrain to size >= 2.
(basic_mask::_DataType): Use __component_mask_for_ileav /
__component_mask_for_ctgus.
(basic_mask::_M_get_ileav_data): New.
(basic_mask::_M_chunk): Simplify and fix chunking to array of
size 1 masks.
(basic_mask::_S_concat): Use _M_get_ileav_data instead of
_M_data.
(basic_vec): Constrain to size >= 2.
(basic_vec::_M_get_ileav_data): Renamed from _M_get_ileav.
(basic_vec::_M_chunk): Deduce intermediate chunk type from
_TSimd.
(basic_vec::_S_concat): Use _M_get_ileav_data instead of
_M_data.
(basic_mask::_S_unwrap_cx_ctgus): Remove in favor of
_M_get_ctgus_data.
(basic_mask::_M_get_ctgus_data): New.
(basic_mask::_S_concat): Use _M_get_ctgus_data.
(_CxCtgus basic_vec): Also take _CxIleav size 1 vecs.
(basic_vec::_S_is_scalar): Determine from
_RealSimd::_S_is_scalar.
(basic_vec::_M_concat_data): Implement for size one.
(basic_vec::_M_get_ileav_data, _S_init): New.
* include/bits/simd_details.h (__float_from): New.
(_ScalarAbi::_S_resize): Rename from _M_resize and declare
static.
(_Abi): Allow _S_size == _S_nreg.
(_Abi::_DataType, _MaskDataType): Return scalar type / bool for
size 1. Allow _Cx variants.
(_Abi::_S_resize): Rename from _M_resize, declare static, and
return _Abi<1, 1, ...> for size 1.
(__abi_tag, __deduce_abi): Adjust for _S_resize change.
(__abi_rebind): Make more use of _S_resize and stick with either
_Abi or _ScalarAbi.
(__component_mask_for_ileav, __component_mask_for_ctgus): New.
(__similar_resized_vec): Remove. __similar_vec is sufficient
now.
* include/bits/simd_mask.h (resize): Constrain to _Np >= 1.
Simplify constraint to basic_vec.
(__extract_simd_at): Extend condition from __scalar_abi_tag to
size 1.
(basic_mask): Adjust constraint to also cover size 1 _Cx masks.
(basic_mask;:_S_has_bool_member, _S_is_scalar): Derive from the
type of _DataType.
(basic_mask::_M_get_ileav_data, _M_get_ctgus_data): New.
(basic_mask::_Abi0, _Abi1): Use _S_resize with pre-determined
size and number of registers to find the member ABI tags.
(basic_mask::basic_mask(basic_mask)): Handle, simplfy, and fix
conversion to size 1 members.
* include/bits/simd_vec.h (basic_vec): Generalize _S_is_scalar
to any size 1 and ensure _S_use_bitmask is not true for a simple
bool mask.
* include/bits/simd_x86.h: Move __float_from to simd_details.h.1 parent 2bebaa1 commit 31699d5
7 files changed
Lines changed: 279 additions & 139 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
62 | 69 | | |
63 | 70 | | |
64 | 71 | | |
65 | 72 | | |
66 | | - | |
67 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
68 | 76 | | |
69 | 77 | | |
70 | 78 | | |
| |||
88 | 96 | | |
89 | 97 | | |
90 | 98 | | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
| 99 | + | |
100 | 100 | | |
101 | 101 | | |
| 102 | + | |
102 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
103 | 136 | | |
104 | 137 | | |
105 | 138 | | |
| |||
108 | 141 | | |
109 | 142 | | |
110 | 143 | | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | 144 | | |
118 | 145 | | |
119 | 146 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
43 | 50 | | |
44 | 51 | | |
45 | 52 | | |
| |||
48 | 55 | | |
49 | 56 | | |
50 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
51 | 97 | | |
52 | 98 | | |
53 | 99 | | |
| |||
0 commit comments