lib/simd/src/parity.zig
daab053ee43316e1809a84551d573ddd1e5bf3d2
1 const std = @import("std");
2 const builtin = @import("builtin");
3
4 pub const upstream_revision = "9e0fb74769a904eef000f9ded7002740a2c553a9";
5 pub const upstream_source_manifest_sha256 = "8cd0dc8865a805fd64de4283baa092c4dfc2985d5d1e1aa2574685a36f89897e";
6 pub const upstream_source_files: usize = 251;
7 pub const upstream_top_level_files: usize = 58;
8 pub const upstream_ops_files: usize = 18;
9 pub const upstream_contrib_files: usize = 108;
10 pub const upstream_tests_directory_files: usize = 67;
11
12 pub const Callable = struct {
13 upstream: []const u8,
14 zig: []const u8,
15 };
16
17 pub const core_callables = [_]Callable{
18 .{ .upstream = "AESInvMixColumns", .zig = "aesInvMixColumns" },
19 .{ .upstream = "AESKeyGenAssist", .zig = "aesKeyGenAssist" },
20 .{ .upstream = "AESLastRound", .zig = "aesLastRound" },
21 .{ .upstream = "AESLastRoundInv", .zig = "aesLastRoundInv" },
22 .{ .upstream = "AESRound", .zig = "aesRound" },
23 .{ .upstream = "AESRoundInv", .zig = "aesRoundInv" },
24 .{ .upstream = "Abs", .zig = "abs" },
25 .{ .upstream = "AbsDiff", .zig = "absDiff" },
26 .{ .upstream = "AddSub", .zig = "addSub" },
27 .{ .upstream = "AllBits0", .zig = "allBits0" },
28 .{ .upstream = "AllBits1", .zig = "allBits1" },
29 .{ .upstream = "AllFalse", .zig = "allFalse" },
30 .{ .upstream = "AllTrue", .zig = "allTrue" },
31 .{ .upstream = "And", .zig = "and" },
32 .{ .upstream = "AndNot", .zig = "andNot" },
33 .{ .upstream = "AndXor", .zig = "andXor" },
34 .{ .upstream = "ApproximateReciprocal", .zig = "approximateReciprocal" },
35 .{ .upstream = "ApproximateReciprocalSqrt", .zig = "approximateReciprocalSqrt" },
36 .{ .upstream = "AverageRound", .zig = "averageRound" },
37 .{ .upstream = "BitCast", .zig = "bitCast" },
38 .{ .upstream = "BitShuffle", .zig = "bitShuffle" },
39 .{ .upstream = "BitsFromMask", .zig = "bitsFromMask" },
40 .{ .upstream = "BitwiseIfThenElse", .zig = "bitwiseIfThenElse" },
41 .{ .upstream = "BlendedStore", .zig = "blendedStore" },
42 .{ .upstream = "Blocks", .zig = "blocks" },
43 .{ .upstream = "Broadcast", .zig = "broadcast" },
44 .{ .upstream = "BroadcastBlock", .zig = "broadcastBlock" },
45 .{ .upstream = "BroadcastLane", .zig = "broadcastLane" },
46 .{ .upstream = "BroadcastSignBit", .zig = "broadcastSignBit" },
47 .{ .upstream = "CLMulLower", .zig = "clMulLower" },
48 .{ .upstream = "CLMulUpper", .zig = "clMulUpper" },
49 .{ .upstream = "Ceil", .zig = "ceil" },
50 .{ .upstream = "CeilInt", .zig = "ceilInt" },
51 .{ .upstream = "Clamp", .zig = "clamp" },
52 .{ .upstream = "Combine", .zig = "combine" },
53 .{ .upstream = "CombineMasks", .zig = "combineMasks" },
54 .{ .upstream = "CombineShiftRightBytes", .zig = "combineShiftRightBytes" },
55 .{ .upstream = "CombineShiftRightLanes", .zig = "combineShiftRightLanes" },
56 .{ .upstream = "ComplexConj", .zig = "complexConj" },
57 .{ .upstream = "Compress", .zig = "compress" },
58 .{ .upstream = "CompressBits", .zig = "compressBits" },
59 .{ .upstream = "CompressBitsStore", .zig = "compressBitsStore" },
60 .{ .upstream = "CompressBlendedStore", .zig = "compressBlendedStore" },
61 .{ .upstream = "CompressBlocksNot", .zig = "compressBlocksNot" },
62 .{ .upstream = "CompressNot", .zig = "compressNot" },
63 .{ .upstream = "CompressStore", .zig = "compressStore" },
64 .{ .upstream = "ConcatEven", .zig = "concatEven" },
65 .{ .upstream = "ConcatLowerLower", .zig = "concatLowerLower" },
66 .{ .upstream = "ConcatLowerUpper", .zig = "concatLowerUpper" },
67 .{ .upstream = "ConcatOdd", .zig = "concatOdd" },
68 .{ .upstream = "ConcatUpperLower", .zig = "concatUpperLower" },
69 .{ .upstream = "ConcatUpperUpper", .zig = "concatUpperUpper" },
70 .{ .upstream = "ConvertInRangeTo", .zig = "convertInRangeTo" },
71 .{ .upstream = "ConvertTo", .zig = "convertTo" },
72 .{ .upstream = "CopySign", .zig = "copySign" },
73 .{ .upstream = "CopySignToAbs", .zig = "copySignToAbs" },
74 .{ .upstream = "CountTrue", .zig = "countTrue" },
75 .{ .upstream = "Create2", .zig = "create2" },
76 .{ .upstream = "Create3", .zig = "create3" },
77 .{ .upstream = "Create4", .zig = "create4" },
78 .{ .upstream = "DemoteInRangeTo", .zig = "demoteInRangeTo" },
79 .{ .upstream = "DemoteMaskTo", .zig = "demoteMaskTo" },
80 .{ .upstream = "DemoteTo", .zig = "demoteTo" },
81 .{ .upstream = "DemoteToNearestInt", .zig = "demoteToNearestInt" },
82 .{ .upstream = "Dup128MaskFromMaskBits", .zig = "dup128MaskFromMaskBits" },
83 .{ .upstream = "Dup128VecFromValues", .zig = "dup128VecFromValues" },
84 .{ .upstream = "DupEven", .zig = "dupEven" },
85 .{ .upstream = "DupOdd", .zig = "dupOdd" },
86 .{ .upstream = "Eq128", .zig = "eq128" },
87 .{ .upstream = "Eq128Upper", .zig = "eq128Upper" },
88 .{ .upstream = "ExclusiveNeither", .zig = "exclusiveNeither" },
89 .{ .upstream = "Expand", .zig = "expand" },
90 .{ .upstream = "ExtractBlock", .zig = "extractBlock" },
91 .{ .upstream = "ExtractLane", .zig = "extractLane" },
92 .{ .upstream = "FindFirstTrue", .zig = "findFirstTrue" },
93 .{ .upstream = "FindKnownFirstTrue", .zig = "findKnownFirstTrue" },
94 .{ .upstream = "FindKnownLastTrue", .zig = "findKnownLastTrue" },
95 .{ .upstream = "FindLastTrue", .zig = "findLastTrue" },
96 .{ .upstream = "FirstN", .zig = "firstN" },
97 .{ .upstream = "Floor", .zig = "floor" },
98 .{ .upstream = "FloorInt", .zig = "floorInt" },
99 .{ .upstream = "FlushCacheline", .zig = "flushCacheline" },
100 .{ .upstream = "FlushStream", .zig = "flushStream" },
101 .{ .upstream = "GatherIndex", .zig = "gatherIndex" },
102 .{ .upstream = "GatherIndexN", .zig = "gatherIndexN" },
103 .{ .upstream = "GatherOffset", .zig = "gatherOffset" },
104 .{ .upstream = "Get2", .zig = "get2" },
105 .{ .upstream = "Get3", .zig = "get3" },
106 .{ .upstream = "Get4", .zig = "get4" },
107 .{ .upstream = "GetBiasedExponent", .zig = "getBiasedExponent" },
108 .{ .upstream = "GetExponent", .zig = "getExponent" },
109 .{ .upstream = "GetLane", .zig = "getLane" },
110 .{ .upstream = "HighestSetBitIndex", .zig = "highestSetBitIndex" },
111 .{ .upstream = "IfNegativeThenElse", .zig = "ifNegativeThenElse" },
112 .{ .upstream = "IfNegativeThenElseZero", .zig = "ifNegativeThenElseZero" },
113 .{ .upstream = "IfNegativeThenNegOrUndefIfZero", .zig = "ifNegativeThenNegOrUndefIfZero" },
114 .{ .upstream = "IfNegativeThenZeroElse", .zig = "ifNegativeThenZeroElse" },
115 .{ .upstream = "IfThenElse", .zig = "ifThenElse" },
116 .{ .upstream = "IfThenElseZero", .zig = "ifThenElseZero" },
117 .{ .upstream = "IfThenZeroElse", .zig = "ifThenZeroElse" },
118 .{ .upstream = "IfVecThenElse", .zig = "ifVecThenElse" },
119 .{ .upstream = "IndicesFromVec", .zig = "indicesFromVec" },
120 .{ .upstream = "InsertBlock", .zig = "insertBlock" },
121 .{ .upstream = "InsertIntoUpper", .zig = "insertIntoUpper" },
122 .{ .upstream = "InsertLane", .zig = "insertLane" },
123 .{ .upstream = "InterleaveEven", .zig = "interleaveEven" },
124 .{ .upstream = "InterleaveEvenBlocks", .zig = "interleaveEvenBlocks" },
125 .{ .upstream = "InterleaveLower", .zig = "interleaveLower" },
126 .{ .upstream = "InterleaveLowerBlocks", .zig = "interleaveLowerBlocks" },
127 .{ .upstream = "InterleaveOdd", .zig = "interleaveOdd" },
128 .{ .upstream = "InterleaveOddBlocks", .zig = "interleaveOddBlocks" },
129 .{ .upstream = "InterleaveUpper", .zig = "interleaveUpper" },
130 .{ .upstream = "InterleaveUpperBlocks", .zig = "interleaveUpperBlocks" },
131 .{ .upstream = "InterleaveWholeLower", .zig = "interleaveWholeLower" },
132 .{ .upstream = "InterleaveWholeUpper", .zig = "interleaveWholeUpper" },
133 .{ .upstream = "Iota", .zig = "iota" },
134 .{ .upstream = "IsEitherNaN", .zig = "isEitherNaN" },
135 .{ .upstream = "IsFinite", .zig = "isFinite" },
136 .{ .upstream = "IsInf", .zig = "isInf" },
137 .{ .upstream = "IsNaN", .zig = "isNaN" },
138 .{ .upstream = "IsNegative", .zig = "isNegative" },
139 .{ .upstream = "LeadingZeroCount", .zig = "leadingZeroCount" },
140 .{ .upstream = "Load", .zig = "load" },
141 .{ .upstream = "LoadDup128", .zig = "loadDup128" },
142 .{ .upstream = "LoadExpand", .zig = "loadExpand" },
143 .{ .upstream = "LoadInterleaved2", .zig = "loadInterleaved2" },
144 .{ .upstream = "LoadInterleaved3", .zig = "loadInterleaved3" },
145 .{ .upstream = "LoadInterleaved4", .zig = "loadInterleaved4" },
146 .{ .upstream = "LoadMaskBits", .zig = "loadMaskBits" },
147 .{ .upstream = "LoadN", .zig = "loadN" },
148 .{ .upstream = "LoadNOr", .zig = "loadNOr" },
149 .{ .upstream = "LoadU", .zig = "loadU" },
150 .{ .upstream = "Lookup16", .zig = "lookup16" },
151 .{ .upstream = "Lookup32", .zig = "lookup32" },
152 .{ .upstream = "Lookup8", .zig = "lookup8" },
153 .{ .upstream = "LowerHalf", .zig = "lowerHalf" },
154 .{ .upstream = "LowerHalfOfMask", .zig = "lowerHalfOfMask" },
155 .{ .upstream = "Lt128", .zig = "lt128" },
156 .{ .upstream = "Lt128Upper", .zig = "lt128Upper" },
157 .{ .upstream = "MaskFalse", .zig = "maskFalse" },
158 .{ .upstream = "MaskFromVec", .zig = "maskFromVec" },
159 .{ .upstream = "MaskedAbs", .zig = "maskedAbs" },
160 .{ .upstream = "MaskedAbsOr", .zig = "maskedAbsOr" },
161 .{ .upstream = "MaskedAdd", .zig = "maskedAdd" },
162 .{ .upstream = "MaskedAddOr", .zig = "maskedAddOr" },
163 .{ .upstream = "MaskedApproximateReciprocal", .zig = "maskedApproximateReciprocal" },
164 .{ .upstream = "MaskedApproximateReciprocalSqrt", .zig = "maskedApproximateReciprocalSqrt" },
165 .{ .upstream = "MaskedConvertTo", .zig = "maskedConvertTo" },
166 .{ .upstream = "MaskedDiv", .zig = "maskedDiv" },
167 .{ .upstream = "MaskedDivOr", .zig = "maskedDivOr" },
168 .{ .upstream = "MaskedEq", .zig = "maskedEq" },
169 .{ .upstream = "MaskedGatherIndex", .zig = "maskedGatherIndex" },
170 .{ .upstream = "MaskedGatherIndexOr", .zig = "maskedGatherIndexOr" },
171 .{ .upstream = "MaskedGe", .zig = "maskedGe" },
172 .{ .upstream = "MaskedGt", .zig = "maskedGt" },
173 .{ .upstream = "MaskedIsNaN", .zig = "maskedIsNaN" },
174 .{ .upstream = "MaskedLe", .zig = "maskedLe" },
175 .{ .upstream = "MaskedLeadingZeroCount", .zig = "maskedLeadingZeroCount" },
176 .{ .upstream = "MaskedLoad", .zig = "maskedLoad" },
177 .{ .upstream = "MaskedLoadOr", .zig = "maskedLoadOr" },
178 .{ .upstream = "MaskedLt", .zig = "maskedLt" },
179 .{ .upstream = "MaskedMax", .zig = "maskedMax" },
180 .{ .upstream = "MaskedMaxOr", .zig = "maskedMaxOr" },
181 .{ .upstream = "MaskedMinOr", .zig = "maskedMinOr" },
182 .{ .upstream = "MaskedModOr", .zig = "maskedModOr" },
183 .{ .upstream = "MaskedMul", .zig = "maskedMul" },
184 .{ .upstream = "MaskedMulAdd", .zig = "maskedMulAdd" },
185 .{ .upstream = "MaskedMulAddOr", .zig = "maskedMulAddOr" },
186 .{ .upstream = "MaskedMulComplexConj", .zig = "maskedMulComplexConj" },
187 .{ .upstream = "MaskedMulComplexConjAdd", .zig = "maskedMulComplexConjAdd" },
188 .{ .upstream = "MaskedMulComplexOr", .zig = "maskedMulComplexOr" },
189 .{ .upstream = "MaskedMulFixedPoint15", .zig = "maskedMulFixedPoint15" },
190 .{ .upstream = "MaskedMulOr", .zig = "maskedMulOr" },
191 .{ .upstream = "MaskedMulSub", .zig = "maskedMulSub" },
192 .{ .upstream = "MaskedMulSubOr", .zig = "maskedMulSubOr" },
193 .{ .upstream = "MaskedNe", .zig = "maskedNe" },
194 .{ .upstream = "MaskedNegMulAdd", .zig = "maskedNegMulAdd" },
195 .{ .upstream = "MaskedNegMulAddOr", .zig = "maskedNegMulAddOr" },
196 .{ .upstream = "MaskedNegMulSub", .zig = "maskedNegMulSub" },
197 .{ .upstream = "MaskedNegMulSubOr", .zig = "maskedNegMulSubOr" },
198 .{ .upstream = "MaskedOr", .zig = "maskedOr" },
199 .{ .upstream = "MaskedOrOr", .zig = "maskedOrOr" },
200 .{ .upstream = "MaskedReduceMax", .zig = "maskedReduceMax" },
201 .{ .upstream = "MaskedReduceMin", .zig = "maskedReduceMin" },
202 .{ .upstream = "MaskedReduceSum", .zig = "maskedReduceSum" },
203 .{ .upstream = "MaskedSatAddOr", .zig = "maskedSatAddOr" },
204 .{ .upstream = "MaskedSatSubOr", .zig = "maskedSatSubOr" },
205 .{ .upstream = "MaskedSaturatedAdd", .zig = "maskedSaturatedAdd" },
206 .{ .upstream = "MaskedSaturatedSub", .zig = "maskedSaturatedSub" },
207 .{ .upstream = "MaskedScatterIndex", .zig = "maskedScatterIndex" },
208 .{ .upstream = "MaskedSet", .zig = "maskedSet" },
209 .{ .upstream = "MaskedSetOr", .zig = "maskedSetOr" },
210 .{ .upstream = "MaskedShiftLeft", .zig = "maskedShiftLeft" },
211 .{ .upstream = "MaskedShiftLeftOr", .zig = "maskedShiftLeftOr" },
212 .{ .upstream = "MaskedShiftRight", .zig = "maskedShiftRight" },
213 .{ .upstream = "MaskedShiftRightOr", .zig = "maskedShiftRightOr" },
214 .{ .upstream = "MaskedShl", .zig = "maskedShl" },
215 .{ .upstream = "MaskedShlOr", .zig = "maskedShlOr" },
216 .{ .upstream = "MaskedShr", .zig = "maskedShr" },
217 .{ .upstream = "MaskedShrOr", .zig = "maskedShrOr" },
218 .{ .upstream = "MaskedSqrt", .zig = "maskedSqrt" },
219 .{ .upstream = "MaskedSqrtOr", .zig = "maskedSqrtOr" },
220 .{ .upstream = "MaskedSub", .zig = "maskedSub" },
221 .{ .upstream = "MaskedSubOr", .zig = "maskedSubOr" },
222 .{ .upstream = "MaskedWidenMulPairwiseAdd", .zig = "maskedWidenMulPairwiseAdd" },
223 .{ .upstream = "MaskedXor", .zig = "maskedXor" },
224 .{ .upstream = "MaskedXorOr", .zig = "maskedXorOr" },
225 .{ .upstream = "Max", .zig = "max" },
226 .{ .upstream = "Max128", .zig = "max128" },
227 .{ .upstream = "Max128Upper", .zig = "max128Upper" },
228 .{ .upstream = "MaxMagnitude", .zig = "maxMagnitude" },
229 .{ .upstream = "MaxNumber", .zig = "maxNumber" },
230 .{ .upstream = "MaxOfLanes", .zig = "maxOfLanes" },
231 .{ .upstream = "Min", .zig = "min" },
232 .{ .upstream = "Min128", .zig = "min128" },
233 .{ .upstream = "Min128Upper", .zig = "min128Upper" },
234 .{ .upstream = "MinMagnitude", .zig = "minMagnitude" },
235 .{ .upstream = "MinNumber", .zig = "minNumber" },
236 .{ .upstream = "MinOfLanes", .zig = "minOfLanes" },
237 .{ .upstream = "MulAdd", .zig = "mulAdd" },
238 .{ .upstream = "MulAddSub", .zig = "mulAddSub" },
239 .{ .upstream = "MulByFloorPow2", .zig = "mulByFloorPow2" },
240 .{ .upstream = "MulByPow2", .zig = "mulByPow2" },
241 .{ .upstream = "MulComplex", .zig = "mulComplex" },
242 .{ .upstream = "MulComplexAdd", .zig = "mulComplexAdd" },
243 .{ .upstream = "MulComplexConj", .zig = "mulComplexConj" },
244 .{ .upstream = "MulComplexConjAdd", .zig = "mulComplexConjAdd" },
245 .{ .upstream = "MulEven", .zig = "mulEven" },
246 .{ .upstream = "MulEvenAdd", .zig = "mulEvenAdd" },
247 .{ .upstream = "MulFixedPoint15", .zig = "mulFixedPoint15" },
248 .{ .upstream = "MulHigh", .zig = "mulHigh" },
249 .{ .upstream = "MulOdd", .zig = "mulOdd" },
250 .{ .upstream = "MulOddAdd", .zig = "mulOddAdd" },
251 .{ .upstream = "MulRound", .zig = "mulRound" },
252 .{ .upstream = "MulSub", .zig = "mulSub" },
253 .{ .upstream = "MulSubAdd", .zig = "mulSubAdd" },
254 .{ .upstream = "MultiRotateRight", .zig = "multiRotateRight" },
255 .{ .upstream = "Ne128", .zig = "ne128" },
256 .{ .upstream = "Ne128Upper", .zig = "ne128Upper" },
257 .{ .upstream = "NearestInt", .zig = "nearestInt" },
258 .{ .upstream = "Neg", .zig = "neg" },
259 .{ .upstream = "NegMulAdd", .zig = "negMulAdd" },
260 .{ .upstream = "NegMulSub", .zig = "negMulSub" },
261 .{ .upstream = "Not", .zig = "not" },
262 .{ .upstream = "OddEven", .zig = "oddEven" },
263 .{ .upstream = "OddEvenBlocks", .zig = "oddEvenBlocks" },
264 .{ .upstream = "Or", .zig = "or" },
265 .{ .upstream = "Or3", .zig = "or3" },
266 .{ .upstream = "OrAnd", .zig = "orAnd" },
267 .{ .upstream = "OrderedDemote2MasksTo", .zig = "orderedDemote2MasksTo" },
268 .{ .upstream = "OrderedDemote2To", .zig = "orderedDemote2To" },
269 .{ .upstream = "OrderedRoundingShiftRightAndDemote2To", .zig = "orderedRoundingShiftRightAndDemote2To" },
270 .{ .upstream = "OrderedShiftRightAndDemote2To", .zig = "orderedShiftRightAndDemote2To" },
271 .{ .upstream = "OrderedTruncate2To", .zig = "orderedTruncate2To" },
272 .{ .upstream = "PairwiseAdd", .zig = "pairwiseAdd" },
273 .{ .upstream = "PairwiseAdd128", .zig = "pairwiseAdd128" },
274 .{ .upstream = "PairwiseSub", .zig = "pairwiseSub" },
275 .{ .upstream = "PairwiseSub128", .zig = "pairwiseSub128" },
276 .{ .upstream = "Pause", .zig = "pause" },
277 .{ .upstream = "Per4LaneBlockShuffle", .zig = "per4LaneBlockShuffle" },
278 .{ .upstream = "PopulationCount", .zig = "populationCount" },
279 .{ .upstream = "Prefetch", .zig = "prefetch" },
280 .{ .upstream = "Print", .zig = "writeVector" },
281 .{ .upstream = "PromoteEvenTo", .zig = "promoteEvenTo" },
282 .{ .upstream = "PromoteInRangeEvenTo", .zig = "promoteInRangeEvenTo" },
283 .{ .upstream = "PromoteInRangeLowerTo", .zig = "promoteInRangeLowerTo" },
284 .{ .upstream = "PromoteInRangeOddTo", .zig = "promoteInRangeOddTo" },
285 .{ .upstream = "PromoteInRangeTo", .zig = "promoteInRangeTo" },
286 .{ .upstream = "PromoteInRangeUpperTo", .zig = "promoteInRangeUpperTo" },
287 .{ .upstream = "PromoteLowerTo", .zig = "promoteLowerTo" },
288 .{ .upstream = "PromoteMaskTo", .zig = "promoteMaskTo" },
289 .{ .upstream = "PromoteOddTo", .zig = "promoteOddTo" },
290 .{ .upstream = "PromoteTo", .zig = "promoteTo" },
291 .{ .upstream = "PromoteUpperTo", .zig = "promoteUpperTo" },
292 .{ .upstream = "RearrangeToOddPlusEven", .zig = "rearrangeToOddPlusEven" },
293 .{ .upstream = "RebindMask", .zig = "rebindMask" },
294 .{ .upstream = "ReduceMax", .zig = "reduceMax" },
295 .{ .upstream = "ReduceMin", .zig = "reduceMin" },
296 .{ .upstream = "ReduceSum", .zig = "reduceSum" },
297 .{ .upstream = "ReorderDemote2To", .zig = "reorderDemote2To" },
298 .{ .upstream = "ReorderRoundingShiftRightAndDemote2To", .zig = "reorderRoundingShiftRightAndDemote2To" },
299 .{ .upstream = "ReorderShiftRightAndDemote2To", .zig = "reorderShiftRightAndDemote2To" },
300 .{ .upstream = "ReorderWidenMulAccumulate", .zig = "reorderWidenMulAccumulate" },
301 .{ .upstream = "ResizeBitCast", .zig = "resizeBitCast" },
302 .{ .upstream = "Reverse", .zig = "reverse" },
303 .{ .upstream = "Reverse2", .zig = "reverse2" },
304 .{ .upstream = "Reverse4", .zig = "reverse4" },
305 .{ .upstream = "Reverse8", .zig = "reverse8" },
306 .{ .upstream = "ReverseBits", .zig = "reverseBits" },
307 .{ .upstream = "ReverseBlocks", .zig = "reverseBlocks" },
308 .{ .upstream = "ReverseLaneBytes", .zig = "reverseLaneBytes" },
309 .{ .upstream = "Rol", .zig = "rol" },
310 .{ .upstream = "Ror", .zig = "ror" },
311 .{ .upstream = "RotateLeft", .zig = "rotateLeft" },
312 .{ .upstream = "RotateLeftSame", .zig = "rotateLeftSame" },
313 .{ .upstream = "RotateRight", .zig = "rotateRight" },
314 .{ .upstream = "RotateRightSame", .zig = "rotateRightSame" },
315 .{ .upstream = "Round", .zig = "round" },
316 .{ .upstream = "RoundingShiftRight", .zig = "roundingShiftRight" },
317 .{ .upstream = "RoundingShiftRightAndDemoteTo", .zig = "roundingShiftRightAndDemoteTo" },
318 .{ .upstream = "RoundingShiftRightSame", .zig = "roundingShiftRightSame" },
319 .{ .upstream = "RoundingShr", .zig = "roundingShr" },
320 .{ .upstream = "SafeCopyN", .zig = "safeCopyN" },
321 .{ .upstream = "SafeFillN", .zig = "safeFillN" },
322 .{ .upstream = "SatWidenMulAccumFixedPoint", .zig = "satWidenMulAccumFixedPoint" },
323 .{ .upstream = "SatWidenMulPairwiseAccumulate", .zig = "satWidenMulPairwiseAccumulate" },
324 .{ .upstream = "SatWidenMulPairwiseAdd", .zig = "satWidenMulPairwiseAdd" },
325 .{ .upstream = "SaturatedAbs", .zig = "saturatedAbs" },
326 .{ .upstream = "SaturatedAdd", .zig = "saturatedAdd" },
327 .{ .upstream = "SaturatedNeg", .zig = "saturatedNeg" },
328 .{ .upstream = "SaturatedSub", .zig = "saturatedSub" },
329 .{ .upstream = "ScatterIndex", .zig = "scatterIndex" },
330 .{ .upstream = "ScatterIndexN", .zig = "scatterIndexN" },
331 .{ .upstream = "ScatterOffset", .zig = "scatterOffset" },
332 .{ .upstream = "Set", .zig = "set" },
333 .{ .upstream = "Set2", .zig = "set2" },
334 .{ .upstream = "Set3", .zig = "set3" },
335 .{ .upstream = "Set4", .zig = "set4" },
336 .{ .upstream = "SetAtOrAfterFirst", .zig = "setAtOrAfterFirst" },
337 .{ .upstream = "SetAtOrBeforeFirst", .zig = "setAtOrBeforeFirst" },
338 .{ .upstream = "SetBeforeFirst", .zig = "setBeforeFirst" },
339 .{ .upstream = "SetMask", .zig = "setMask" },
340 .{ .upstream = "SetOnlyFirst", .zig = "setOnlyFirst" },
341 .{ .upstream = "SetTableIndices", .zig = "setTableIndices" },
342 .{ .upstream = "ShiftLeft", .zig = "shiftLeft" },
343 .{ .upstream = "ShiftLeftBytes", .zig = "shiftLeftBytes" },
344 .{ .upstream = "ShiftLeftLanes", .zig = "shiftLeftLanes" },
345 .{ .upstream = "ShiftLeftSame", .zig = "shiftLeftSame" },
346 .{ .upstream = "ShiftRight", .zig = "shiftRight" },
347 .{ .upstream = "ShiftRightAndDemoteTo", .zig = "shiftRightAndDemoteTo" },
348 .{ .upstream = "ShiftRightBytes", .zig = "shiftRightBytes" },
349 .{ .upstream = "ShiftRightLanes", .zig = "shiftRightLanes" },
350 .{ .upstream = "ShiftRightSame", .zig = "shiftRightSame" },
351 .{ .upstream = "Shuffle01", .zig = "shuffle01" },
352 .{ .upstream = "Shuffle0123", .zig = "shuffle0123" },
353 .{ .upstream = "Shuffle0321", .zig = "shuffle0321" },
354 .{ .upstream = "Shuffle1032", .zig = "shuffle1032" },
355 .{ .upstream = "Shuffle2103", .zig = "shuffle2103" },
356 .{ .upstream = "Shuffle2301", .zig = "shuffle2301" },
357 .{ .upstream = "SignBit", .zig = "signBit" },
358 .{ .upstream = "Slide1Down", .zig = "slide1Down" },
359 .{ .upstream = "Slide1DownOr", .zig = "slide1DownOr" },
360 .{ .upstream = "Slide1Up", .zig = "slide1Up" },
361 .{ .upstream = "Slide1UpOr", .zig = "slide1UpOr" },
362 .{ .upstream = "SlideDownBlocks", .zig = "slideDownBlocks" },
363 .{ .upstream = "SlideDownLanes", .zig = "slideDownLanes" },
364 .{ .upstream = "SlideDownLanesOr", .zig = "slideDownLanesOr" },
365 .{ .upstream = "SlideMask1Down", .zig = "slideMask1Down" },
366 .{ .upstream = "SlideMask1Up", .zig = "slideMask1Up" },
367 .{ .upstream = "SlideMaskDownLanes", .zig = "slideMaskDownLanes" },
368 .{ .upstream = "SlideMaskUpLanes", .zig = "slideMaskUpLanes" },
369 .{ .upstream = "SlideUpBlocks", .zig = "slideUpBlocks" },
370 .{ .upstream = "SlideUpLanes", .zig = "slideUpLanes" },
371 .{ .upstream = "SlideUpLanesOr", .zig = "slideUpLanesOr" },
372 .{ .upstream = "Sqrt", .zig = "sqrt" },
373 .{ .upstream = "Store", .zig = "store" },
374 .{ .upstream = "StoreInterleaved2", .zig = "storeInterleaved2" },
375 .{ .upstream = "StoreInterleaved3", .zig = "storeInterleaved3" },
376 .{ .upstream = "StoreInterleaved4", .zig = "storeInterleaved4" },
377 .{ .upstream = "StoreMaskBits", .zig = "storeMaskBits" },
378 .{ .upstream = "StoreN", .zig = "storeN" },
379 .{ .upstream = "StoreU", .zig = "storeU" },
380 .{ .upstream = "Stream", .zig = "stream" },
381 .{ .upstream = "SumOfLanes", .zig = "sumOfLanes" },
382 .{ .upstream = "SumOfMulQuadAccumulate", .zig = "sumOfMulQuadAccumulate" },
383 .{ .upstream = "SumsOf2", .zig = "sumsOf2" },
384 .{ .upstream = "SumsOf4", .zig = "sumsOf4" },
385 .{ .upstream = "SumsOf8", .zig = "sumsOf8" },
386 .{ .upstream = "SumsOf8AbsDiff", .zig = "sumsOf8AbsDiff" },
387 .{ .upstream = "SumsOfAdjQuadAbsDiff", .zig = "sumsOfAdjQuadAbsDiff" },
388 .{ .upstream = "SumsOfShuffledQuadAbsDiff", .zig = "sumsOfShuffledQuadAbsDiff" },
389 .{ .upstream = "SwapAdjacentBlocks", .zig = "swapAdjacentBlocks" },
390 .{ .upstream = "TableLookupBytes", .zig = "tableLookupBytes" },
391 .{ .upstream = "TableLookupBytesOr0", .zig = "tableLookupBytesOr0" },
392 .{ .upstream = "TableLookupLanes", .zig = "tableLookupLanes" },
393 .{ .upstream = "TestBit", .zig = "testBit" },
394 .{ .upstream = "TrailingZeroCount", .zig = "trailingZeroCount" },
395 .{ .upstream = "Trunc", .zig = "trunc" },
396 .{ .upstream = "TruncateStore", .zig = "truncateStore" },
397 .{ .upstream = "TruncateTo", .zig = "truncateTo" },
398 .{ .upstream = "TwoTablesLookupLanes", .zig = "twoTablesLookupLanes" },
399 .{ .upstream = "U8FromU32", .zig = "u8FromU32" },
400 .{ .upstream = "Undefined", .zig = "undefined" },
401 .{ .upstream = "UpperHalf", .zig = "upperHalf" },
402 .{ .upstream = "UpperHalfOfMask", .zig = "upperHalfOfMask" },
403 .{ .upstream = "VecFromMask", .zig = "vecFromMask" },
404 .{ .upstream = "WidenMulAccumulate", .zig = "widenMulAccumulate" },
405 .{ .upstream = "WidenMulPairwiseAdd", .zig = "widenMulPairwiseAdd" },
406 .{ .upstream = "Xor", .zig = "xor" },
407 .{ .upstream = "Xor3", .zig = "xor3" },
408 .{ .upstream = "XorAndNot", .zig = "xorAndNot" },
409 .{ .upstream = "Zero", .zig = "zero" },
410 .{ .upstream = "ZeroExtendResizeBitCast", .zig = "zeroExtendResizeBitCast" },
411 .{ .upstream = "ZeroExtendVector", .zig = "zeroExtendVector" },
412 .{ .upstream = "ZeroIfNegative", .zig = "zeroIfNegative" },
413 .{ .upstream = "ZipLower", .zig = "zipLower" },
414 .{ .upstream = "ZipUpper", .zig = "zipUpper" },
415 };
416
417 pub const supplemental_callables = [_]Callable{
418 .{ .upstream = "Add", .zig = "add" },
419 .{ .upstream = "BF16FromF32", .zig = "bf16FromF32" },
420 .{ .upstream = "BF16FromF64", .zig = "bf16FromF64" },
421 .{ .upstream = "BlockDFromD", .zig = "BlockDFromD" },
422 .{ .upstream = "CanLookup16", .zig = "canLookup16" },
423 .{ .upstream = "CanLookup32", .zig = "canLookup32" },
424 .{ .upstream = "CanLookup8", .zig = "canLookup8" },
425 .{ .upstream = "CappedTag", .zig = "CappedTag" },
426 .{ .upstream = "CappedTag<T,kLimit,kPow2>", .zig = "CappedTagPow2" },
427 .{ .upstream = "CappedTagIfFixed", .zig = "CappedTagIfFixed" },
428 .{ .upstream = "CappedTagIfFixed<T,kLimit,kPow2>", .zig = "CappedTagIfFixedPow2" },
429 .{ .upstream = "CuckooBuildAlgo", .zig = "CuckooBuildAlgo" },
430 .{ .upstream = "DFromV", .zig = "DFromV" },
431 .{ .upstream = "Div", .zig = "div" },
432 .{ .upstream = "Divisor", .zig = "Divisor" },
433 .{ .upstream = "Divisor64", .zig = "Divisor64" },
434 .{ .upstream = "Eq", .zig = "eq" },
435 .{ .upstream = "F32FromBF16", .zig = "f32FromBF16" },
436 .{ .upstream = "FixedTag", .zig = "FixedTag" },
437 .{ .upstream = "FloatFromSize", .zig = "FloatFromSize" },
438 .{ .upstream = "Full128", .zig = "Full128" },
439 .{ .upstream = "Full16", .zig = "Full16" },
440 .{ .upstream = "Full32", .zig = "Full32" },
441 .{ .upstream = "Full64", .zig = "Full64" },
442 .{ .upstream = "GatherIndexNOr", .zig = "gatherIndexNOr" },
443 .{ .upstream = "Ge", .zig = "ge" },
444 .{ .upstream = "Gt", .zig = "gt" },
445 .{ .upstream = "Half", .zig = "Half" },
446 .{ .upstream = "Inf", .zig = "inf" },
447 .{ .upstream = "IsAligned", .zig = "isDescriptorAligned" },
448 .{ .upstream = "IsFloat", .zig = "isFloat" },
449 .{ .upstream = "IsFloat3264", .zig = "isFloat3264" },
450 .{ .upstream = "IsIntegerLaneType", .zig = "isIntegerLane" },
451 .{ .upstream = "IsSigned", .zig = "isSigned" },
452 .{ .upstream = "IsSpecialFloat", .zig = "isSpecialFloat" },
453 .{ .upstream = "IsUnsigned", .zig = "isUnsigned" },
454 .{ .upstream = "K32V32", .zig = "K32V32" },
455 .{ .upstream = "K64V64", .zig = "K64V64" },
456 .{ .upstream = "Lanes", .zig = "laneCount" },
457 .{ .upstream = "Le", .zig = "le" },
458 .{ .upstream = "LemireMod", .zig = "lemireMod" },
459 .{ .upstream = "Lt", .zig = "lt" },
460 .{ .upstream = "MFromD", .zig = "MFromD" },
461 .{ .upstream = "MakeFloat", .zig = "MakeFloat" },
462 .{ .upstream = "MakeNarrow", .zig = "MakeNarrow" },
463 .{ .upstream = "MakeSigned", .zig = "MakeSigned" },
464 .{ .upstream = "MakeUnsigned", .zig = "MakeUnsigned" },
465 .{ .upstream = "MakeWide", .zig = "MakeWide" },
466 .{ .upstream = "Mask", .zig = "Mask" },
467 .{ .upstream = "MaxBlocks", .zig = "maxBlocks" },
468 .{ .upstream = "MaxBytes", .zig = "maxBytes" },
469 .{ .upstream = "MaxLanes", .zig = "maxLanes" },
470 .{ .upstream = "Mod", .zig = "mod" },
471 .{ .upstream = "Mul", .zig = "mul" },
472 .{ .upstream = "NaN", .zig = "nan" },
473 .{ .upstream = "Ne", .zig = "ne" },
474 .{ .upstream = "PerBlock2x2MatMul", .zig = "perBlock2x2MatMul" },
475 .{ .upstream = "Pow2", .zig = "pow2" },
476 .{ .upstream = "Rebind", .zig = "Rebind" },
477 .{ .upstream = "RebindToFloat", .zig = "RebindToFloat" },
478 .{ .upstream = "RebindToSigned", .zig = "RebindToSigned" },
479 .{ .upstream = "RebindToUnsigned", .zig = "RebindToUnsigned" },
480 .{ .upstream = "Repartition", .zig = "Repartition" },
481 .{ .upstream = "RepartitionToNarrow", .zig = "RepartitionToNarrow" },
482 .{ .upstream = "RepartitionToWide", .zig = "RepartitionToWide" },
483 .{ .upstream = "RepartitionToWideX2", .zig = "RepartitionToWideX2" },
484 .{ .upstream = "RepartitionToWideX3", .zig = "RepartitionToWideX3" },
485 .{ .upstream = "ScalableTag", .zig = "ScalableTag" },
486 .{ .upstream = "ScalableTag<T,kPow2>", .zig = "ScalableTagPow2" },
487 .{ .upstream = "Shl", .zig = "shl" },
488 .{ .upstream = "Shr", .zig = "shr" },
489 .{ .upstream = "SignedFromSize", .zig = "SignedFromSize" },
490 .{ .upstream = "Sub", .zig = "sub" },
491 .{ .upstream = "TFromD", .zig = "TFromD" },
492 .{ .upstream = "TFromV", .zig = "TFromV" },
493 .{ .upstream = "Twice", .zig = "Twice" },
494 .{ .upstream = "UnsignedFromSize", .zig = "UnsignedFromSize" },
495 .{ .upstream = "VFromD", .zig = "VFromD" },
496 .{ .upstream = "Vec", .zig = "Vec" },
497 .{ .upstream = "bfloat16_t", .zig = "BFloat16" },
498 };
499
500 pub const Substitution = struct {
501 upstream: []const u8,
502 zig: []const u8,
503 disposition: Disposition,
504 };
505
506 pub const substitutions = [_]Substitution{
507 .{ .upstream = "AddWithWraparound", .zig = "+% for integers; + or BFloat16.add for floats", .disposition = .compiler },
508 .{ .upstream = "BitCastScalar", .zig = "@bitCast", .disposition = .compiler },
509 .{ .upstream = "CappedLanes on RVV", .zig = "@min(cap, laneCount(D)) in fixed Zig vector owners", .disposition = .compiler },
510 .{ .upstream = "CeilLog2", .zig = "std.math.log2_int_ceil", .disposition = .compiler },
511 .{ .upstream = "ConvertScalarTo", .zig = "explicit Zig scalar casts and BFloat16 conversion methods", .disposition = .compiler },
512 .{ .upstream = "CopyBytes", .zig = "@memcpy", .disposition = .compiler },
513 .{ .upstream = "CopySameSize", .zig = "@memcpy", .disposition = .compiler },
514 .{ .upstream = "DFromM", .zig = "caller-retained descriptor for @Vector(N, bool)", .disposition = .compiler },
515 .{ .upstream = "DFromV for BFloat16 storage", .zig = "caller-retained BFloat16 descriptor for @Vector(N, u16)", .disposition = .compiler },
516 .{ .upstream = "DeclVal", .zig = "comptime type checking", .disposition = .compiler },
517 .{ .upstream = "DivCeil", .zig = "std.math.divCeil", .disposition = .compiler },
518 .{ .upstream = "EnableIf", .zig = "comptime parameters and @compileError", .disposition = .compiler },
519 .{ .upstream = "Epsilon", .zig = "std.math.floatEps, integer one, or BFloat16.fromBits", .disposition = .compiler },
520 .{ .upstream = "ExponentBits", .zig = "@bitSizeOf minus mantissa and sign bits", .disposition = .compiler },
521 .{ .upstream = "ExponentMask", .zig = "comptime IEEE bit mask", .disposition = .compiler },
522 .{ .upstream = "F16FromF32", .zig = "@floatCast to f16", .disposition = .compiler },
523 .{ .upstream = "F16FromF64", .zig = "@floatCast to f16", .disposition = .compiler },
524 .{ .upstream = "F32FromBF16Mem", .zig = "std.mem.bytesToValue and BFloat16.toF32", .disposition = .compiler },
525 .{ .upstream = "F32FromF16", .zig = "@floatCast from f16", .disposition = .compiler },
526 .{ .upstream = "F32FromF16Mem", .zig = "std.mem.bytesToValue and @floatCast", .disposition = .compiler },
527 .{ .upstream = "FillBytes", .zig = "@memset", .disposition = .compiler },
528 .{ .upstream = "FloatTag", .zig = "@typeInfo float branch", .disposition = .compiler },
529 .{ .upstream = "FloorLog2", .zig = "std.math.log2_int", .disposition = .compiler },
530 .{ .upstream = "HighestValue", .zig = "std.math maxInt or floatMax; BFloat16.fromBits", .disposition = .compiler },
531 .{ .upstream = "If", .zig = "comptime if", .disposition = .compiler },
532 .{ .upstream = "IsArray", .zig = "@typeInfo array branch", .disposition = .compiler },
533 .{ .upstream = "IsAssignable", .zig = "Zig compile-time assignment checking", .disposition = .compiler },
534 .{ .upstream = "IsConst", .zig = "pointer child constness in @typeInfo", .disposition = .compiler },
535 .{ .upstream = "IsConsteval", .zig = "@inComptime", .disposition = .compiler },
536 .{ .upstream = "IsConvertible", .zig = "Zig compile-time coercion checking", .disposition = .compiler },
537 .{ .upstream = "IsFloatTag", .zig = "@typeInfo float branch", .disposition = .compiler },
538 .{ .upstream = "IsInteger", .zig = "@typeInfo int branch", .disposition = .compiler },
539 .{ .upstream = "IsSame", .zig = "type equality", .disposition = .compiler },
540 .{ .upstream = "IsSameEither", .zig = "type equality disjunction", .disposition = .compiler },
541 .{ .upstream = "IsStaticCastable", .zig = "Zig compile-time cast checking", .disposition = .compiler },
542 .{ .upstream = "LimitsMax", .zig = "std.math.maxInt", .disposition = .compiler },
543 .{ .upstream = "LimitsMin", .zig = "std.math.minInt or zero", .disposition = .compiler },
544 .{ .upstream = "LowestValue", .zig = "std.math minInt or negative floatMax; BFloat16.fromBits", .disposition = .compiler },
545 .{ .upstream = "MakeLaneTypeIfInteger", .zig = "@typeInfo and tag size relations", .disposition = .compiler },
546 .{ .upstream = "MantissaBits", .zig = "std.math.floatMantissaBits or BF16 bit width", .disposition = .compiler },
547 .{ .upstream = "MantissaEnd", .zig = "comptime IEEE exponent construction", .disposition = .compiler },
548 .{ .upstream = "MantissaMask", .zig = "comptime IEEE bit mask", .disposition = .compiler },
549 .{ .upstream = "MaxExponentField", .zig = "comptime IEEE exponent mask", .disposition = .compiler },
550 .{ .upstream = "MaxExponentTimes2", .zig = "comptime IEEE exponent mask", .disposition = .compiler },
551 .{ .upstream = "Mul128", .zig = "u128 or i128 multiply and truncation", .disposition = .compiler },
552 .{ .upstream = "NativeFromLittleEndian", .zig = "std.mem.littleToNative", .disposition = .compiler },
553 .{ .upstream = "NegativeInfOrLowestValue", .zig = "std.math.inf, finite limit, or BFloat16.fromBits", .disposition = .compiler },
554 .{ .upstream = "NonFloatTag", .zig = "@typeInfo non-float branch", .disposition = .compiler },
555 .{ .upstream = "Num0BitsAboveMS1Bit_Nonzero32", .zig = "@clz", .disposition = .compiler },
556 .{ .upstream = "Num0BitsAboveMS1Bit_Nonzero64", .zig = "@clz", .disposition = .compiler },
557 .{ .upstream = "Num0BitsBelowLS1Bit_Nonzero32", .zig = "@ctz", .disposition = .compiler },
558 .{ .upstream = "Num0BitsBelowLS1Bit_Nonzero64", .zig = "@ctz", .disposition = .compiler },
559 .{ .upstream = "PopCount", .zig = "@popCount", .disposition = .compiler },
560 .{ .upstream = "PositiveInfOrHighestValue", .zig = "std.math.inf, finite limit, or BFloat16.fromBits", .disposition = .compiler },
561 .{ .upstream = "PreventElision", .zig = "std.mem.doNotOptimizeAway", .disposition = .compiler },
562 .{ .upstream = "RemoveConst", .zig = "Zig values do not encode top-level const in their type", .disposition = .compiler },
563 .{ .upstream = "RemoveCvRef", .zig = "Zig value types and @typeInfo pointer children", .disposition = .compiler },
564 .{ .upstream = "RemovePtr", .zig = "@typeInfo pointer child", .disposition = .compiler },
565 .{ .upstream = "RemoveRef", .zig = "Zig pointer/value distinction", .disposition = .compiler },
566 .{ .upstream = "RemoveVolatile", .zig = "volatile pointer access rather than qualified value types", .disposition = .compiler },
567 .{ .upstream = "RoundDownTo", .zig = "subtraction by remainder", .disposition = .compiler },
568 .{ .upstream = "RoundDownToPow2", .zig = "zero-to-one branch then std.math.floorPowerOfTwo", .disposition = .compiler },
569 .{ .upstream = "RoundUpTo", .zig = "std.math.divCeil and multiplication", .disposition = .compiler },
570 .{ .upstream = "RoundUpToPow2", .zig = "zero-to-one branch then std.math.ceilPowerOfTwo", .disposition = .compiler },
571 .{ .upstream = "ScalarAbs", .zig = "@abs for floats; wrapping unsigned magnitude for signed integers", .disposition = .compiler },
572 .{ .upstream = "ScalarByteSwap", .zig = "@byteSwap", .disposition = .compiler },
573 .{ .upstream = "ScalarCopySign", .zig = "std.math.copysign or BFloat16 sign-bit composition", .disposition = .compiler },
574 .{ .upstream = "ScalarIsFinite", .zig = "std.math.isFinite or true for integers", .disposition = .compiler },
575 .{ .upstream = "ScalarIsInf", .zig = "std.math.isInf", .disposition = .compiler },
576 .{ .upstream = "ScalarIsNaN", .zig = "std.math.isNan", .disposition = .compiler },
577 .{ .upstream = "ScalarShr", .zig = ">>", .disposition = .compiler },
578 .{ .upstream = "ScalarSignBit", .zig = "std.math.signbit or top-bit test", .disposition = .compiler },
579 .{ .upstream = "SignMask", .zig = "comptime top-bit mask", .disposition = .compiler },
580 .{ .upstream = "SignedTag", .zig = "@typeInfo signed-int branch", .disposition = .compiler },
581 .{ .upstream = "SizeTag", .zig = "comptime integer or enum tags", .disposition = .compiler },
582 .{ .upstream = "SmallestNormal", .zig = "std.math.floatMin", .disposition = .compiler },
583 .{ .upstream = "SpecialTag", .zig = "BFloat16 structural marker", .disposition = .compiler },
584 .{ .upstream = "TFromV for BFloat16 storage", .zig = "BFloat16 descriptor Scalar alongside @Vector(N, u16)", .disposition = .compiler },
585 .{ .upstream = "TableLookupLanesOr0", .zig = "unused self-recursive wasm256 backend artifact with no caller or test", .disposition = .upstream_defect },
586 .{ .upstream = "TypeTag", .zig = "@typeInfo and BFloat16 structural marker", .disposition = .compiler },
587 .{ .upstream = "UnsignedTag", .zig = "@typeInfo unsigned-int branch", .disposition = .compiler },
588 .{ .upstream = "Vec2", .zig = "[2]D.Vector", .disposition = .compiler },
589 .{ .upstream = "Vec3", .zig = "[3]D.Vector", .disposition = .compiler },
590 .{ .upstream = "Vec4", .zig = "[4]D.Vector", .disposition = .compiler },
591 .{ .upstream = "WidenMulEven", .zig = "even-lane products composed inside widenMulPairwiseAdd", .disposition = .ported },
592 .{ .upstream = "ZeroBytes", .zig = "@memset", .disposition = .compiler },
593 .{ .upstream = "bfloat16_t arithmetic", .zig = "BFloat16 arithmetic methods", .disposition = .ported },
594 .{ .upstream = "float16_t", .zig = "f16", .disposition = .compiler },
595 .{ .upstream = "float16_t arithmetic", .zig = "Zig f16 operators", .disposition = .compiler },
596 .{ .upstream = "float32_t", .zig = "f32", .disposition = .compiler },
597 .{ .upstream = "float64_t", .zig = "f64", .disposition = .compiler },
598 .{ .upstream = "operator!=", .zig = "Zig vector !=", .disposition = .compiler },
599 .{ .upstream = "operator%", .zig = "Zig vector %", .disposition = .compiler },
600 .{ .upstream = "operator&", .zig = "Zig vector &", .disposition = .compiler },
601 .{ .upstream = "operator*", .zig = "Zig vector *", .disposition = .compiler },
602 .{ .upstream = "operator+", .zig = "Zig vector +", .disposition = .compiler },
603 .{ .upstream = "operator-", .zig = "Zig vector -", .disposition = .compiler },
604 .{ .upstream = "operator/", .zig = "Zig vector /", .disposition = .compiler },
605 .{ .upstream = "operator<", .zig = "Zig vector <", .disposition = .compiler },
606 .{ .upstream = "operator<<", .zig = "Zig vector <<", .disposition = .compiler },
607 .{ .upstream = "operator<=", .zig = "Zig vector <=", .disposition = .compiler },
608 .{ .upstream = "operator==", .zig = "Zig vector ==", .disposition = .compiler },
609 .{ .upstream = "operator>", .zig = "Zig vector >", .disposition = .compiler },
610 .{ .upstream = "operator>=", .zig = "Zig vector >=", .disposition = .compiler },
611 .{ .upstream = "operator>>", .zig = "Zig vector >>", .disposition = .compiler },
612 .{ .upstream = "operator^", .zig = "Zig vector ^", .disposition = .compiler },
613 .{ .upstream = "operator|", .zig = "Zig vector |", .disposition = .compiler },
614 .{ .upstream = "uint128_t", .zig = "u128", .disposition = .compiler },
615 };
616
617 pub const target_header_extras = [_][]const u8{
618 "CappedLanes on RVV",
619 "TableLookupLanesOr0",
620 "WidenMulEven",
621 };
622
623 pub const Disposition = enum {
624 ported,
625 repository,
626 compiler,
627 upstream_defect,
628 };
629
630 pub const Owner = struct {
631 upstream: []const u8,
632 source: []const u8,
633 property: []const u8,
634 profile: []const u8,
635 disposition: Disposition,
636 external: bool = false,
637 };
638
639 pub const owners = [_]Owner{
640 .{
641 .upstream = "hwy/abort*; hwy/base.h abort and warn",
642 .source = "../../pretty/core/src/diagnostic.zig",
643 .property = "../../pretty/core/src/test.zig",
644 .profile = "",
645 .disposition = .repository,
646 .external = true,
647 },
648 .{ .upstream = "hwy/aligned_allocator*", .source = "aligned.zig", .property = "properties/aligned.zig", .profile = "profiling/aligned.zig", .disposition = .ported },
649 .{ .upstream = "hwy/auto_tune*", .source = "autotune.zig", .property = "properties/autotune.zig", .profile = "profiling/autotune.zig", .disposition = .ported },
650 .{ .upstream = "hwy/base.h Divisor; Divisor64", .source = "intdiv.zig", .property = "properties/math.zig", .profile = "profiling/math.zig", .disposition = .ported },
651 .{ .upstream = "hwy/base.h K32V32; K64V64", .source = "sort/key.zig", .property = "properties/sort.zig", .profile = "profiling/sort.zig", .disposition = .ported },
652 .{ .upstream = "hwy/base.h LemireMod", .source = "hash.zig", .property = "properties/hash.zig", .profile = "profiling/hash.zig", .disposition = .ported },
653 .{ .upstream = "hwy/base.h bfloat16_t and conversions", .source = "bfloat.zig", .property = "properties/numeric.zig", .profile = "profiling/dot.zig", .disposition = .ported },
654 .{ .upstream = "hwy/base.h compiler-native scalar and type utilities", .source = "parity.zig", .property = "parity.zig", .profile = "profiling/root.zig", .disposition = .compiler },
655 .{ .upstream = "hwy/base.h descriptor lane type relations", .source = "tag.zig", .property = "properties/layout.zig", .profile = "profiling/layout.zig", .disposition = .ported },
656 .{ .upstream = "hwy/base.h float16_t", .source = "parity.zig", .property = "properties/numeric.zig", .profile = "profiling/root.zig", .disposition = .compiler },
657 .{ .upstream = "hwy/base.h uint128_t", .source = "parity.zig", .property = "properties/sort.zig", .profile = "profiling/sort.zig", .disposition = .compiler },
658 .{ .upstream = "hwy/base_test.cc", .source = "root.zig", .property = "properties/numeric.zig", .profile = "profiling/root.zig", .disposition = .repository },
659 .{ .upstream = "hwy/bit_set*", .source = "bitset.zig", .property = "properties/bitset.zig", .profile = "profiling/bitset.zig", .disposition = .ported },
660 .{ .upstream = "hwy/cache_control.h", .source = "cache.zig", .property = "properties/cache.zig", .profile = "profiling/cache.zig", .disposition = .ported },
661 .{ .upstream = "hwy/contrib/algo/*", .source = "algo.zig", .property = "properties/algo.zig", .profile = "profiling/algo.zig", .disposition = .ported },
662 .{ .upstream = "hwy/contrib/bit_pack/*", .source = "bitpack.zig", .property = "properties/bitpack.zig", .profile = "profiling/bitpack.zig", .disposition = .ported },
663 .{ .upstream = "hwy/contrib/dot/*", .source = "dot.zig", .property = "properties/dot.zig", .profile = "profiling/dot.zig", .disposition = .ported },
664 .{ .upstream = "hwy/contrib/hash/cuckoo-inl.h; hwy/contrib/hash/cuckoo_test.cc", .source = "cuckoo/root.zig", .property = "properties/cuckoo.zig", .profile = "profiling/cuckoo.zig", .disposition = .ported },
665 .{ .upstream = "hwy/contrib/hash/cuckoo2x2*", .source = "cuckoo2x2.zig", .property = "properties/cuckoo2x2.zig", .profile = "profiling/cuckoo2x2.zig", .disposition = .ported },
666 .{ .upstream = "hwy/contrib/hash/cuckoo_load_factor_sweep.cc", .source = "profiling/cuckoo.zig", .property = "properties/cuckoo.zig", .profile = "profiling/cuckoo.zig", .disposition = .ported },
667 .{ .upstream = "hwy/contrib/hash/hash-inl.h; hwy/contrib/hash/hash_test.cc", .source = "hash.zig", .property = "properties/hash.zig", .profile = "profiling/hash.zig", .disposition = .ported },
668 .{ .upstream = "hwy/contrib/hash/hash_bench.cc", .source = "profiling/hash.zig", .property = "properties/hash.zig", .profile = "profiling/hash.zig", .disposition = .ported },
669 .{ .upstream = "hwy/contrib/hash/hash_eval.cc", .source = "hash.zig", .property = "properties/hash.zig", .profile = "profiling/hash.zig", .disposition = .repository },
670 .{ .upstream = "hwy/contrib/hash/hash_prospector16.cc", .source = "hash.zig", .property = "properties/hash.zig", .profile = "profiling/hash.zig", .disposition = .repository },
671 .{ .upstream = "hwy/contrib/hash/phast-inl.h; hwy/contrib/hash/phast.cc; hwy/contrib/hash/phast.h; hwy/contrib/hash/phast_test.cc", .source = "phast/root.zig", .property = "properties/phast.zig", .profile = "profiling/phast.zig", .disposition = .ported },
672 .{ .upstream = "hwy/contrib/hash/phast_bench.cc", .source = "profiling/phast.zig", .property = "properties/phast.zig", .profile = "profiling/phast.zig", .disposition = .ported },
673 .{ .upstream = "hwy/contrib/hash/shardmul*", .source = "shardmul.zig", .property = "properties/shardmul.zig", .profile = "profiling/shardmul.zig", .disposition = .ported },
674 .{ .upstream = "hwy/contrib/image/*", .source = "image/root.zig", .property = "properties/image.zig", .profile = "profiling/image.zig", .disposition = .ported },
675 .{ .upstream = "hwy/contrib/intdiv/*", .source = "intdiv.zig", .property = "properties/math.zig", .profile = "profiling/math.zig", .disposition = .ported },
676 .{ .upstream = "hwy/contrib/math/fast_math*; hwy/contrib/math/fp_arith-inl.h; hwy/contrib/math/math-inl.h; hwy/contrib/math/math_*test*", .source = "math.zig", .property = "properties/math.zig", .profile = "profiling/math.zig", .disposition = .ported },
677 .{ .upstream = "hwy/contrib/math/math_benchmark.cc", .source = "profiling/math.zig", .property = "properties/math.zig", .profile = "profiling/math.zig", .disposition = .ported },
678 .{ .upstream = "hwy/contrib/matvec/*", .source = "matvec.zig", .property = "properties/matvec.zig", .profile = "profiling/matvec.zig", .disposition = .ported },
679 .{ .upstream = "hwy/contrib/random/*", .source = "random.zig", .property = "properties/random.zig", .profile = "profiling/random.zig", .disposition = .ported },
680 .{ .upstream = "hwy/contrib/sort/algo-inl.h; order.h; result-inl.h; shared-inl.h; sort*_test.cc; sorting_networks-inl.h; traits*; vqsort*", .source = "sort/root.zig", .property = "properties/sort.zig", .profile = "profiling/sort.zig", .disposition = .ported },
681 .{ .upstream = "hwy/contrib/sort/bench_parallel.cc", .source = "profiling/sort.zig", .property = "properties/sort.zig", .profile = "profiling/sort.zig", .disposition = .ported },
682 .{ .upstream = "hwy/contrib/sort/bench_sort.cc", .source = "profiling/sort.zig", .property = "properties/sort.zig", .profile = "profiling/sort.zig", .disposition = .ported },
683 .{ .upstream = "hwy/contrib/sort/print_network.cc", .source = "sort/network.zig", .property = "properties/sort.zig", .profile = "profiling/sort.zig", .disposition = .repository },
684 .{ .upstream = "hwy/contrib/thread_pool/thread_pool*; futex.h; index_range.h; spin.h", .source = "thread/root.zig", .property = "properties/thread.zig", .profile = "profiling/thread.zig", .disposition = .ported },
685 .{ .upstream = "hwy/contrib/thread_pool/topology*", .source = "topology/root.zig", .property = "properties/topology.zig", .profile = "profiling/topology.zig", .disposition = .ported },
686 .{ .upstream = "hwy/contrib/unroller/*", .source = "unroller.zig", .property = "properties/unroller.zig", .profile = "profiling/unroller.zig", .disposition = .ported },
687 .{ .upstream = "hwy/detect_compiler_arch.h; hwy/foreach_target.h; hwy/highway_export.h", .source = "target.zig", .property = "properties/target.zig", .profile = "profiling/target.zig", .disposition = .compiler },
688 .{ .upstream = "hwy/detect_targets.h; hwy/targets*; hwy/per_target*; hwy/x86_cpuid.h", .source = "target.zig", .property = "properties/target.zig", .profile = "profiling/target.zig", .disposition = .ported },
689 .{ .upstream = "hwy/examples/*", .source = "root.zig", .property = "properties/root.zig", .profile = "profiling/root.zig", .disposition = .repository },
690 .{ .upstream = "hwy/highway.h; hwy/highway_test.cc", .source = "root.zig", .property = "properties/laws.zig", .profile = "profiling/arithmetic.zig", .disposition = .ported },
691 .{ .upstream = "hwy/nanobenchmark*; hwy/timer*", .source = "../../bench/src/root.zig", .property = "../../bench/src/properties/root.zig", .profile = "../../bench/src/timing.zig", .disposition = .repository, .external = true },
692 .{ .upstream = "hwy/ops/* PerBlock2x2MatMul; hwy/tests/matmul_op_test.cc", .source = "matmul.zig", .property = "properties/matmul.zig", .profile = "profiling/matmul.zig", .disposition = .ported },
693 .{ .upstream = "hwy/ops/* descriptor and carrier substitutions", .source = "parity.zig", .property = "properties/layout.zig", .profile = "profiling/layout.zig", .disposition = .compiler },
694 .{ .upstream = "hwy/ops/* vector operations", .source = "root.zig", .property = "properties/laws.zig", .profile = "profiling/arithmetic.zig", .disposition = .ported },
695 .{ .upstream = "hwy/perf_counters*", .source = "../../sys/src/perf.zig", .property = "../../sys/src/properties/perf.zig", .profile = "../../bench/src/instrumentation.zig", .disposition = .repository, .external = true },
696 .{ .upstream = "hwy/print*", .source = "print.zig", .property = "properties/print.zig", .profile = "profiling/print.zig", .disposition = .ported },
697 .{ .upstream = "hwy/profiler*", .source = "../../bench/src/instrumentation.zig", .property = "../../coz/src/properties/root.zig", .profile = "../../coz/src/root.zig", .disposition = .repository, .external = true },
698 .{ .upstream = "hwy/robust_statistics.h", .source = "robust.zig", .property = "properties/robust.zig", .profile = "profiling/robust.zig", .disposition = .ported },
699 .{ .upstream = "hwy/stats.h; hwy/stats.cc", .source = "stats.zig", .property = "properties/stats.zig", .profile = "profiling/stats.zig", .disposition = .ported },
700 .{ .upstream = "hwy/tests/*; hwy/highway_test.cc", .source = "root.zig", .property = "properties/root.zig", .profile = "profiling/root.zig", .disposition = .repository },
701 };
702
703 pub const upstream_active_programs = [_][]const u8{
704 "hwy/contrib/hash/cuckoo_load_factor_sweep.cc",
705 "hwy/contrib/hash/hash_bench.cc",
706 "hwy/contrib/hash/hash_eval.cc",
707 "hwy/contrib/hash/hash_prospector16.cc",
708 "hwy/contrib/hash/phast_bench.cc",
709 "hwy/contrib/math/math_benchmark.cc",
710 "hwy/contrib/sort/bench_parallel.cc",
711 "hwy/contrib/sort/bench_sort.cc",
712 "hwy/contrib/sort/print_network.cc",
713 };
714
715 test "pinned Highway callable ledger is sorted and unique" {
716 try std.testing.expectEqual(@as(usize, 397), core_callables.len);
717 for (core_callables[1..], 1..) |callable, index| {
718 try std.testing.expect(std.mem.order(u8, core_callables[index - 1].upstream, callable.upstream) == .lt);
719 }
720 }
721
722 test "pinned Highway source manifest partitions the complete C++ tree" {
723 try std.testing.expectEqual(@as(usize, 64), upstream_source_manifest_sha256.len);
724 try std.testing.expectEqual(
725 upstream_source_files,
726 upstream_top_level_files + upstream_ops_files +
727 upstream_contrib_files + upstream_tests_directory_files,
728 );
729 }
730
731 test "pinned Highway supplemental declaration ledger is sorted and unique" {
732 try std.testing.expectEqual(@as(usize, 80), supplemental_callables.len);
733 for (supplemental_callables[1..], 1..) |callable, index| {
734 try std.testing.expect(
735 std.mem.order(
736 u8,
737 supplemental_callables[index - 1].upstream,
738 callable.upstream,
739 ) == .lt,
740 );
741 }
742 }
743
744 test "pinned Highway substitutions are explicit sorted and unique" {
745 try std.testing.expectEqual(@as(usize, 108), substitutions.len);
746 var operator_count: usize = 0;
747 var defect_count: usize = 0;
748 for (substitutions, 0..) |substitution, index| {
749 try std.testing.expect(substitution.upstream.len != 0);
750 try std.testing.expect(substitution.zig.len != 0);
751 if (std.mem.startsWith(u8, substitution.upstream, "operator")) {
752 operator_count += 1;
753 }
754 defect_count += @intFromBool(substitution.disposition == .upstream_defect);
755 if (index != 0) {
756 try std.testing.expect(
757 std.mem.order(
758 u8,
759 substitutions[index - 1].upstream,
760 substitution.upstream,
761 ) == .lt,
762 );
763 }
764 }
765 try std.testing.expectEqual(@as(usize, 16), operator_count);
766 try std.testing.expectEqual(@as(usize, 1), defect_count);
767 }
768
769 test "pinned Highway target-header extras have explicit dispositions" {
770 try std.testing.expectEqual(@as(usize, 3), target_header_extras.len);
771 for (target_header_extras) |name| {
772 var found = false;
773 for (substitutions) |substitution| {
774 found = found or std.mem.eql(u8, name, substitution.upstream);
775 }
776 try std.testing.expect(found);
777 }
778 }
779
780 test "pinned Highway compiler substitutions preserve base scalar semantics" {
781 try std.testing.expectEqual(@as(u32, 4), try std.math.divCeil(u32, 10, 3));
782 try std.testing.expectEqual(@as(u32, 12), (try std.math.divCeil(u32, 10, 3)) * 3);
783 try std.testing.expectEqual(@as(u32, 9), 10 - 10 % 3);
784 try std.testing.expectEqual(@as(usize, 3), std.math.log2_int(usize, 9));
785 try std.testing.expectEqual(@as(usize, 4), std.math.log2_int_ceil(usize, 9));
786 try std.testing.expectEqual(@as(usize, 1), if (0 == 0) 1 else std.math.floorPowerOfTwo(usize, 0));
787 try std.testing.expectEqual(@as(usize, 8), std.math.floorPowerOfTwo(usize, 9));
788 try std.testing.expectEqual(@as(usize, 16), try std.math.ceilPowerOfTwo(usize, 9));
789
790 const unsigned_product = @as(u128, std.math.maxInt(u64)) * 2;
791 try std.testing.expectEqual(@as(u64, std.math.maxInt(u64) - 1), @as(u64, @truncate(unsigned_product)));
792 try std.testing.expectEqual(@as(u64, 1), @as(u64, @truncate(unsigned_product >> 64)));
793 const signed_product = @as(i128, -7) * 11;
794 try std.testing.expectEqual(@as(i64, -77), @as(i64, @truncate(signed_product)));
795 try std.testing.expectEqual(@as(i64, -1), @as(i64, @truncate(signed_product >> 64)));
796
797 try std.testing.expectEqual(@as(u16, 0x3412), @byteSwap(@as(u16, 0x1234)));
798 const little_value = std.mem.littleToNative(u32, 0x0102_0304);
799 const expected_little = if (builtin.target.cpu.arch.endian() == .little)
800 @as(u32, 0x0102_0304)
801 else
802 @as(u32, 0x0403_0201);
803 try std.testing.expectEqual(expected_little, little_value);
804 try std.testing.expectEqual(@as(u6, 12), @ctz(@as(u32, 0x1000)));
805 try std.testing.expectEqual(@as(u6, 19), @clz(@as(u32, 0x1000)));
806 try std.testing.expectEqual(@as(u6, 16), @popCount(@as(u32, 0xf0f0_f0f0)));
807 try std.testing.expectEqual(@as(u8, 0), @as(u8, 255) +% 1);
808 const min_i32_bits: u32 = @bitCast(@as(i32, std.math.minInt(i32)));
809 try std.testing.expectEqual(@as(u32, 0x8000_0000), 0 -% min_i32_bits);
810
811 var copied: [8]u8 = undefined;
812 const source = [_]u8{ 0, 1, 2, 3, 4, 5, 6, 7 };
813 @memcpy(&copied, &source);
814 try std.testing.expectEqual(source, copied);
815 @memset(&copied, 0xa5);
816 try std.testing.expectEqual(@as([8]u8, @splat(0xa5)), copied);
817 std.mem.doNotOptimizeAway(&copied);
818
819 const half: f16 = @floatCast(@as(f32, 1.5));
820 try std.testing.expectEqual(@as(f32, 1.5), @as(f32, @floatCast(half)));
821 try std.testing.expectEqual(@as(f32, -3), std.math.copysign(@as(f32, 3), @as(f32, -1)));
822 try std.testing.expect(std.math.signbit(@as(f32, -0.0)));
823 try std.testing.expect(std.math.isFinite(@as(f64, 1)));
824 try std.testing.expect(std.math.isInf(std.math.inf(f64)));
825 try std.testing.expect(std.math.isNan(std.math.nan(f64)));
826 }
827
828 test "pinned Highway owner ledger is sorted and its port paths are live" {
829 try std.testing.expectEqual(@as(usize, 54), owners.len);
830 try std.testing.expectEqual(@as(usize, 9), upstream_active_programs.len);
831 for (owners, 0..) |owner, index| {
832 try std.testing.expect(owner.upstream.len != 0);
833 try std.testing.expect(owner.source.len != 0);
834 if (index != 0) {
835 try std.testing.expect(std.mem.order(u8, owners[index - 1].upstream, owner.upstream) == .lt);
836 }
837 if (owner.disposition == .ported or owner.disposition == .compiler) {
838 try std.testing.expect(owner.property.len != 0);
839 try std.testing.expect(owner.profile.len != 0);
840 }
841 if (owner.external) {
842 try std.testing.expect(std.mem.startsWith(u8, owner.source, "../../"));
843 if (owner.property.len != 0) {
844 try std.testing.expect(std.mem.startsWith(u8, owner.property, "../../"));
845 }
846 if (owner.profile.len != 0) {
847 try std.testing.expect(std.mem.startsWith(u8, owner.profile, "../../"));
848 }
849 }
850 }
851 for (upstream_active_programs) |program| {
852 var found = false;
853 for (owners) |owner| {
854 found = found or std.mem.eql(u8, program, owner.upstream);
855 }
856 try std.testing.expect(found);
857 }
858 inline for (owners) |owner| {
859 if (!owner.external) {
860 _ = @embedFile(owner.source);
861 if (owner.property.len != 0) _ = @embedFile(owner.property);
862 if (owner.profile.len != 0) _ = @embedFile(owner.profile);
863 }
864 }
865 }