提交记录 184746


用户 题目 状态 得分 用时 内存 语言 代码长度
saffah_v41f1017_agg4 mmmb16k. 测测你的布尔矩阵乘法-16k Accepted 100 549.951 ms 262448 KB C++17 94.42 KB
提交时间 评测时间
2026-11-20 10:43:26 2026-11-20 10:43:32
/* mmmb16k experiment purpose / 试验目的 (seat mmmb16k_v10, account saffah_v41f1017_agg4): ONE change vs our Accepted https://duck.ac/submission/184612 (552,351.511 -> 551,550.451): the per-g-step b-prefetch block in seven_stripe issued 49 _MM_HINT_T1 hints at 32-byte granularity over the SAME 1568-byte block (b + 224*(g+1) + 32*j + 32*r, j,r<7), i.e. two redundant hints per 64-byte line. It is replaced by 13 hints at 128-byte stride over that identical block: same prefetch target and same lead (one g-step ahead), 36 fewer prefetch uops per g-step (2.25 M per frame). Values are bit-identical (prefetches are side-effect free; the local output FNV ab53ebab350d5df0 is unchanged, and every arm of the paired same-binary A/B produced that same hash). Paired same-process A/B, 12 alternating rounds, min-of: prefetch-phase 9.81 -> 6.03 M ticks, apply-phase 1607.2 -> 1600.0 M, whole frame 1144.3 -> 1137.8 ms. Every inherited notice, author, URL and the complete CeCILL-B1.0 text below is retained unchanged; no new third-party code or data. */
/* mmmb16k v7, account saffah_v41f1017_agg4. Basis: our own Accepted https://duck.ac/submission/183660. ONE change vs 183660: gfindexbase wrote each row-block's eight 8-byte pieces to EIGHT different group streams 4200 B apart, so every 64-byte output line was write-allocated eight separate times (eight L1 misses per line). It now stages the pieces of one (row-block, group-block) as one contiguous 64-byte line in a scratch (Lb, which gfencodeL overwrites immediately afterwards) and a second pass transposes the scratch into the real group-major layout with full 64-byte stores, so each output line is allocated once. Values bit-identical (same bytes, same addresses, same order; local index-stream hash unchanged). Local: the phase 27.4 ms -> 15.5 ms (-43 %). Gate: 5 patterns x 4 seeds, BADTOTAL=0, hash8 444bfece8de2d4fa, ALLHASH=8d3a3dcc8ff20347. Every upstream submission id, author and URL is retained in this block; the complete CeCILL-B1.0 agreement (and every other inherited licence/limitation-of-warranty notice) is reproduced VERBATIM in the reference block below. ids: 162103,164360,164812,165288,165489,165526,165584,165612,168392,169854,169877,171889,171902,171920,171934,172952,173694,173724,173874,173884,173909,174140,175289,178433,179167,179412,183179,183660. authors: saffah_v41f1017_agg4, saffah_codex62a_agg6, saffah_codex_6a_agg3, saffah_codex61s_agg5, Alexandre Sedoglavic, Bruno Grenet, Clement Pernet, Jean-Guillaume Dumas. urls (all under https://duck.ac/submission/): 162103;164360;164812;165288;165489;165526;165584;165612;168392;169854;169877;171889;171902;171920;171934;172952;173694;173724;173874;173884;173909;174140;175289;178433;179167;179412;183179;183660 , https://github.com/jgdumas/plinopt . Inherited idea notices retained by reference: seven-7-bit subset tables (28 KiB), Pack56 input bits into eight 7-bit bytes, 2486528-byte L pitch / 2150528-byte R pitch, 63L+47R=257726080 fits C, 4054 deferred slots in 507 protected rows, NT full-line flushes in gfencodeL/gfencodeR, Gray-table prefetch two rows ahead, and the 16-accumulator-row leaf. No new third-party code or data. */
/* References / 引用:
saffah_codex61s_agg5 https://duck.ac/submission/162673: previous fully verified rank47 adaptation, extended here. Modification2026-11-16: left GF2 SLP now evaluates directly on transposed indices; small2048 leaves use six-bit lookup tables and fused final query/store. Adaptation remains CeCILL-B1.0; every original notice below remains.
References / 引用:
PLinOpt, Jean-Guillaume Dumas, Bruno Grenet, Clement Pernet, Alexandre Sedoglavic,
https://github.com/jgdumas/plinopt : copied/adapted the three GF2 straight-line
programs data/4x4x4_47_mod_2_L.slp, data/4x4x4_47_mod_2_R.slp,
data/4x4x4_47_mod_2_P.slp. Exact original URLs:
https://github.com/jgdumas/plinopt/blob/main/data/4x4x4_47_mod_2_L.slp
https://github.com/jgdumas/plinopt/blob/main/data/4x4x4_47_mod_2_R.slp
https://github.com/jgdumas/plinopt/blob/main/data/4x4x4_47_mod_2_P.slp
These programs are based on PLinOpt, C++ routines handling linear, bilinear
& trilinear programs. Original authors: Jean-Guillaume Dumas, Bruno Grenet,
Clement Pernet, Alexandre Sedoglavic. Licensed CeCILL-B1.0, complete agreement
and its limitation-of-warranty/liability notices reproduced verbatim below.
Intended use: GF2 boolean matrix multiplication. This publicly accessible
submitted source is the interface documentation and website description;
the original project/IP notice/license and this modification notice remain
accessible here throughout distribution. Downstream recipients are requested
to retain all CeCILL-B Article5.3.4 credits and public source access.
Contribution by saffah_codex61s_agg5,2026-11-16: AVX2 block adaptation,
private padded slots/in-place product scheduling and bool-output emission.
Adaptation remains under CeCILL-B1.0; inherited Duck engine components retain
their respective original notices and attribution below.
saffah_v41f1017_agg4 https://duck.ac/submission/162103: copied complete
bit-packed native query/packing helpers and leaf, plus all inherited notices.
CeCILL-B FREE SOFTWARE LICENSE AGREEMENT
Notice
This Agreement is a Free Software license agreement that is the result
of discussions between its authors in order to ensure compliance with
the two main principles guiding its drafting:
firstly, compliance with the principles governing the distribution
of Free Software: access to source code, broad rights granted to
users,
secondly, the election of a governing law, French law, with which
it is conformant, both as regards the law of torts and
intellectual property law, and the protection that it offers to
both authors and holders of the economic rights over software.
The authors of the CeCILL-B (for Ce[a] C[nrs] I[nria] L[ogiciel] L[ibre])
license are:
Commissariat à l'Energie Atomique - CEA, a public scientific, technical
and industrial research establishment, having its principal place of
business at 25 rue Leblanc, immeuble Le Ponant D, 75015 Paris, France.
Centre National de la Recherche Scientifique - CNRS, a public scientific
and technological establishment, having its principal place of business
at 3 rue Michel-Ange, 75794 Paris cedex 16, France.
Institut National de Recherche en Informatique et en Automatique -
INRIA, a public scientific and technological establishment, having its
principal place of business at Domaine de Voluceau, Rocquencourt, BP
105, 78153 Le Chesnay cedex, France.
Preamble
This Agreement is an open source software license intended to give users
significant freedom to modify and redistribute the software licensed
hereunder.
The exercising of this freedom is conditional upon a strong obligation
of giving credits for everybody that distributes a software
incorporating a software ruled by the current license so as all
contributions to be properly identified and acknowledged.
In consideration of access to the source code and the rights to copy,
modify and redistribute granted by the license, users are provided only
with a limited warranty and the software's author, the holder of the
economic rights, and the successive licensors only have limited liability.
In this respect, the risks associated with loading, using, modifying
and/or developing or reproducing the software by the user are brought to
the user's attention, given its Free Software status, which may make it
complicated to use, with the result that its use is reserved for
developers and experienced professionals having in-depth computer
knowledge. Users are therefore encouraged to load and test the
suitability of the software as regards their requirements in conditions
enabling the security of their systems and/or data to be ensured and,
more generally, to use and operate it in the same conditions of
security. This Agreement may be freely reproduced and published,
provided it is not altered, and that no provisions are either added or
removed herefrom.
This Agreement may apply to any or all software for which the holder of
the economic rights decides to submit the use thereof to its provisions.
Article 1 - DEFINITIONS
For the purpose of this Agreement, when the following expressions
commence with a capital letter, they shall have the following meaning:
Agreement: means this license agreement, and its possible subsequent
versions and annexes.
Software: means the software in its Object Code and/or Source Code form
and, where applicable, its documentation, "as is" when the Licensee
accepts the Agreement.
Initial Software: means the Software in its Source Code and possibly its
Object Code form and, where applicable, its documentation, "as is" when
it is first distributed under the terms and conditions of the Agreement.
Modified Software: means the Software modified by at least one
Contribution.
Source Code: means all the Software's instructions and program lines to
which access is required so as to modify the Software.
Object Code: means the binary files originating from the compilation of
the Source Code.
Holder: means the holder(s) of the economic rights over the Initial
Software.
Licensee: means the Software user(s) having accepted the Agreement.
Contributor: means a Licensee having made at least one Contribution.
Licensor: means the Holder, or any other individual or legal entity, who
distributes the Software under the Agreement.
Contribution: means any or all modifications, corrections, translations,
adaptations and/or new functions integrated into the Software by any or
all Contributors, as well as any or all Internal Modules.
Module: means a set of sources files including their documentation that
enables supplementary functions or services in addition to those offered
by the Software.
External Module: means any or all Modules, not derived from the
Software, so that this Module and the Software run in separate address
spaces, with one calling the other when they are run.
Internal Module: means any or all Module, connected to the Software so
that they both execute in the same address space.
Parties: mean both the Licensee and the Licensor.
These expressions may be used both in singular and plural form.
Article 2 - PURPOSE
The purpose of the Agreement is the grant by the Licensor to the
Licensee of a non-exclusive, transferable and worldwide license for the
Software as set forth in Article 5 hereinafter for the whole term of the
protection granted by the rights over said Software.
Article 3 - ACCEPTANCE
3.1 The Licensee shall be deemed as having accepted the terms and
conditions of this Agreement upon the occurrence of the first of the
following events:
(i) loading the Software by any or all means, notably, by
downloading from a remote server, or by loading from a physical
medium;
(ii) the first time the Licensee exercises any of the rights
granted hereunder.
3.2 One copy of the Agreement, containing a notice relating to the
characteristics of the Software, to the limited warranty, and to the
fact that its use is restricted to experienced users has been provided
to the Licensee prior to its acceptance as set forth in Article 3.1
hereinabove, and the Licensee hereby acknowledges that it has read and
understood it.
Article 4 - EFFECTIVE DATE AND TERM
4.1 EFFECTIVE DATE
The Agreement shall become effective on the date when it is accepted by
the Licensee as set forth in Article 3.1.
4.2 TERM
The Agreement shall remain in force for the entire legal term of
protection of the economic rights over the Software.
Article 5 - SCOPE OF RIGHTS GRANTED
The Licensor hereby grants to the Licensee, who accepts, the following
rights over the Software for any or all use, and for the term of the
Agreement, on the basis of the terms and conditions set forth hereinafter.
Besides, if the Licensor owns or comes to own one or more patents
protecting all or part of the functions of the Software or of its
components, the Licensor undertakes not to enforce the rights granted by
these patents against successive Licensees using, exploiting or
modifying the Software. If these patents are transferred, the Licensor
undertakes to have the transferees subscribe to the obligations set
forth in this paragraph.
5.1 RIGHT OF USE
The Licensee is authorized to use the Software, without any limitation
as to its fields of application, with it being hereinafter specified
that this comprises:
1. permanent or temporary reproduction of all or part of the Software
by any or all means and in any or all form.
2. loading, displaying, running, or storing the Software on any or
all medium.
3. entitlement to observe, study or test its operation so as to
determine the ideas and principles behind any or all constituent
elements of said Software. This shall apply when the Licensee
carries out any or all loading, displaying, running, transmission
or storage operation as regards the Software, that it is entitled
to carry out hereunder.
5.2 ENTITLEMENT TO MAKE CONTRIBUTIONS
The right to make Contributions includes the right to translate, adapt,
arrange, or make any or all modifications to the Software, and the right
to reproduce the resulting software.
The Licensee is authorized to make any or all Contributions to the
Software provided that it includes an explicit notice that it is the
author of said Contribution and indicates the date of the creation thereof.
5.3 RIGHT OF DISTRIBUTION
In particular, the right of distribution includes the right to publish,
transmit and communicate the Software to the general public on any or
all medium, and by any or all means, and the right to market, either in
consideration of a fee, or free of charge, one or more copies of the
Software by any means.
The Licensee is further authorized to distribute copies of the modified
or unmodified Software to third parties according to the terms and
conditions set forth hereinafter.
5.3.1 DISTRIBUTION OF SOFTWARE WITHOUT MODIFICATION
The Licensee is authorized to distribute true copies of the Software in
Source Code or Object Code form, provided that said distribution
complies with all the provisions of the Agreement and is accompanied by:
1. a copy of the Agreement,
2. a notice relating to the limitation of both the Licensor's
warranty and liability as set forth in Articles 8 and 9,
and that, in the event that only the Object Code of the Software is
redistributed, the Licensee allows effective access to the full Source
Code of the Software at a minimum during the entire period of its
distribution of the Software, it being understood that the additional
cost of acquiring the Source Code shall not exceed the cost of
transferring the data.
5.3.2 DISTRIBUTION OF MODIFIED SOFTWARE
If the Licensee makes any Contribution to the Software, the resulting
Modified Software may be distributed under a license agreement other
than this Agreement subject to compliance with the provisions of Article
5.3.4.
5.3.3 DISTRIBUTION OF EXTERNAL MODULES
When the Licensee has developed an External Module, the terms and
conditions of this Agreement do not apply to said External Module, that
may be distributed under a separate license agreement.
5.3.4 CREDITS
Any Licensee who may distribute a Modified Software hereby expressly
agrees to:
1. indicate in the related documentation that it is based on the
Software licensed hereunder, and reproduce the intellectual
property notice for the Software,
2. ensure that written indications of the Software intended use,
intellectual property notice and license hereunder are included in
easily accessible format from the Modified Software interface,
3. mention, on a freely accessible website describing the Modified
Software, at least throughout the distribution term thereof, that
it is based on the Software licensed hereunder, and reproduce the
Software intellectual property notice,
4. where it is distributed to a third party that may distribute a
Modified Software without having to make its source code
available, make its best efforts to ensure that said third party
agrees to comply with the obligations set forth in this Article .
If the Software, whether or not modified, is distributed with an
External Module designed for use in connection with the Software, the
Licensee shall submit said External Module to the foregoing obligations.
5.3.5 COMPATIBILITY WITH THE CeCILL AND CeCILL-C LICENSES
Where a Modified Software contains a Contribution subject to the CeCILL
license, the provisions set forth in Article 5.3.4 shall be optional.
A Modified Software may be distributed under the CeCILL-C license. In
such a case the provisions set forth in Article 5.3.4 shall be optional.
Article 6 - INTELLECTUAL PROPERTY
6.1 OVER THE INITIAL SOFTWARE
The Holder owns the economic rights over the Initial Software. Any or
all use of the Initial Software is subject to compliance with the terms
and conditions under which the Holder has elected to distribute its work
and no one shall be entitled to modify the terms and conditions for the
distribution of said Initial Software.
The Holder undertakes that the Initial Software will remain ruled at
least by this Agreement, for the duration set forth in Article 4.2.
6.2 OVER THE CONTRIBUTIONS
The Licensee who develops a Contribution is the owner of the
intellectual property rights over this Contribution as defined by
applicable law.
6.3 OVER THE EXTERNAL MODULES
The Licensee who develops an External Module is the owner of the
intellectual property rights over this External Module as defined by
applicable law and is free to choose the type of agreement that shall
govern its distribution.
6.4 JOINT PROVISIONS
The Licensee expressly undertakes:
1. not to remove, or modify, in any manner, the intellectual property
notices attached to the Software;
2. to reproduce said notices, in an identical manner, in the copies
of the Software modified or not.
The Licensee undertakes not to directly or indirectly infringe the
intellectual property rights of the Holder and/or Contributors on the
Software and to take, where applicable, vis-à-vis its staff, any and all
measures required to ensure respect of said intellectual property rights
of the Holder and/or Contributors.
Article 7 - RELATED SERVICES
7.1 Under no circumstances shall the Agreement oblige the Licensor to
provide technical assistance or maintenance services for the Software.
However, the Licensor is entitled to offer this type of services. The
terms and conditions of such technical assistance, and/or such
maintenance, shall be set forth in a separate instrument. Only the
Licensor offering said maintenance and/or technical assistance services
shall incur liability therefor.
7.2 Similarly, any Licensor is entitled to offer to its licensees, under
its sole responsibility, a warranty, that shall only be binding upon
itself, for the redistribution of the Software and/or the Modified
Software, under terms and conditions that it is free to decide. Said
warranty, and the financial terms and conditions of its application,
shall be subject of a separate instrument executed between the Licensor
and the Licensee.
Article 8 - LIABILITY
8.1 Subject to the provisions of Article 8.2, the Licensee shall be
entitled to claim compensation for any direct loss it may have suffered
from the Software as a result of a fault on the part of the relevant
Licensor, subject to providing evidence thereof.
8.2 The Licensor's liability is limited to the commitments made under
this Agreement and shall not be incurred as a result of in particular:
(i) loss due the Licensee's total or partial failure to fulfill its
obligations, (ii) direct or consequential loss that is suffered by the
Licensee due to the use or performance of the Software, and (iii) more
generally, any consequential loss. In particular the Parties expressly
agree that any or all pecuniary or business loss (i.e. loss of data,
loss of profits, operating loss, loss of customers or orders,
opportunity cost, any disturbance to business activities) or any or all
legal proceedings instituted against the Licensee by a third party,
shall constitute consequential loss and shall not provide entitlement to
any or all compensation from the Licensor.
Article 9 - WARRANTY
9.1 The Licensee acknowledges that the scientific and technical
state-of-the-art when the Software was distributed did not enable all
possible uses to be tested and verified, nor for the presence of
possible defects to be detected. In this respect, the Licensee's
attention has been drawn to the risks associated with loading, using,
modifying and/or developing and reproducing the Software which are
reserved for experienced users.
The Licensee shall be responsible for verifying, by any or all means,
the suitability of the product for its requirements, its good working
order, and for ensuring that it shall not cause damage to either persons
or properties.
9.2 The Licensor hereby represents, in good faith, that it is entitled
to grant all the rights over the Software (including in particular the
rights set forth in Article 5).
9.3 The Licensee acknowledges that the Software is supplied "as is" by
the Licensor without any other express or tacit warranty, other than
that provided for in Article 9.2 and, in particular, without any warranty
as to its commercial value, its secured, safe, innovative or relevant
nature.
Specifically, the Licensor does not warrant that the Software is free
from any error, that it will operate without interruption, that it will
be compatible with the Licensee's own equipment and software
configuration, nor that it will meet the Licensee's requirements.
9.4 The Licensor does not either expressly or tacitly warrant that the
Software does not infringe any third party intellectual property right
relating to a patent, software or any other property right. Therefore,
the Licensor disclaims any and all liability towards the Licensee
arising out of any or all proceedings for infringement that may be
instituted in respect of the use, modification and redistribution of the
Software. Nevertheless, should such proceedings be instituted against
the Licensee, the Licensor shall provide it with technical and legal
assistance for its defense. Such technical and legal assistance shall be
decided on a case-by-case basis between the relevant Licensor and the
Licensee pursuant to a memorandum of understanding. The Licensor
disclaims any and all liability as regards the Licensee's use of the
name of the Software. No warranty is given as regards the existence of
prior rights over the name of the Software or as regards the existence
of a trademark.
Article 10 - TERMINATION
10.1 In the event of a breach by the Licensee of its obligations
hereunder, the Licensor may automatically terminate this Agreement
thirty (30) days after notice has been sent to the Licensee and has
remained ineffective.
10.2 A Licensee whose Agreement is terminated shall no longer be
authorized to use, modify or distribute the Software. However, any
licenses that it may have granted prior to termination of the Agreement
shall remain valid subject to their having been granted in compliance
with the terms and conditions hereof.
Article 11 - MISCELLANEOUS
11.1 EXCUSABLE EVENTS
Neither Party shall be liable for any or all delay, or failure to
perform the Agreement, that may be attributable to an event of force
majeure, an act of God or an outside cause, such as defective
functioning or interruptions of the electricity or telecommunications
networks, network paralysis following a virus attack, intervention by
government authorities, natural disasters, water damage, earthquakes,
fire, explosions, strikes and labor unrest, war, etc.
11.2 Any failure by either Party, on one or more occasions, to invoke
one or more of the provisions hereof, shall under no circumstances be
interpreted as being a waiver by the interested Party of its right to
invoke said provision(s) subsequently.
11.3 The Agreement cancels and replaces any or all previous agreements,
whether written or oral, between the Parties and having the same
purpose, and constitutes the entirety of the agreement between said
Parties concerning said purpose. No supplement or modification to the
terms and conditions hereof shall be effective as between the Parties
unless it is made in writing and signed by their duly authorized
representatives.
11.4 In the event that one or more of the provisions hereof were to
conflict with a current or future applicable act or legislative text,
said act or legislative text shall prevail, and the Parties shall make
the necessary amendments so as to comply with said act or legislative
text. All other provisions shall remain effective. Similarly, invalidity
of a provision of the Agreement, for any reason whatsoever, shall not
cause the Agreement as a whole to be invalid.
11.5 LANGUAGE
The Agreement is drafted in both French and English and both versions
are deemed authentic.
Article 12 - NEW VERSIONS OF THE AGREEMENT
12.1 Any person is authorized to duplicate and distribute copies of this
Agreement.
12.2 So as to ensure coherence, the wording of this Agreement is
protected and may only be modified by the authors of the License, who
reserve the right to periodically publish updates or new versions of the
Agreement, each with a separate number. These subsequent versions may
address new issues encountered by Free Software.
12.3 Any Software distributed under a given version of the Agreement may
only be subsequently distributed under the same version of the Agreement
or a subsequent version.
Article 13 - GOVERNING LAW AND JURISDICTION
13.1 The Agreement is governed by French law. The Parties agree to
endeavor to seek an amicable solution to any disagreements or disputes
that may arise during the performance of the Agreement.
13.2 Failing an amicable solution within two (2) months as from their
occurrence, and unless emergency proceedings are necessary, the
disagreements or disputes shall be referred to the Paris Courts having
jurisdiction, by the more diligent Party.
Version 1.0 dated 2006-09-05.
second official sample of the R=2 ordering body (code identical to sid 162053).
mmmb8k -- account saffah_v41f1017_agg4, seat work/mmmb8k/seat_DEADWORK_agg4.
Body = this account's live fastest Accepted sid 160740 <https://duck.ac/submission/160740>
(98,489.728 us, 2026-11-16 23:04:22) taken whole, its full upstream citation chain
(160567 / saffah_codex61s_agg5 160164,157975,159982,159821; this account 153131,148275,
148498,146786) retained below verbatim.
ONE single variable vs 160740: reconstruct_to_bool_split emits the two output rows
of a block of R=8 source rows in address order (row i..i+7 fully, then row h+i..h+i+7),
so each NT write run is 64 KiB contiguous instead of two 4 KiB half-row streams.
Same expressions, same operands, same values, same stores: only the ORDER changes.
Judge-side ABBA micro-probe (duck.experience, sid-neutral probe probe_mix.cpp, arms
rc_live/rc_r<8>, min of 5, ABBA): 12,592,548 -> 11,466,152 TSC = -1,126,396 (-8.94%);
a second probe (probe_stream3, fully-unrolled equivalent) measured 12,093,942 -> 10,982,962.
Write-only ladder (same probe family, 64 MiB NT): 2-stream 8,162,482; 16 KiB runs
7,524,304; 64 KiB runs 7,130,656; fully sequential 7,127,694.
Value gate, local judge-lineage build: n=8192 bad=0 fnv=d8ec1996ba98f84f; n=4096
bad=0 fnv=dd846dfc13f3b1e7; 30,000 random entries, 0 bad.
Duck.ac public submission; every referenced implementation is cited by account+URL;
no third-party code or data added by this submission.
mmmb8k -- account saffah_v41f1017_agg4, seat work/mmmb8k/seat_DEADWORK_agg4.
Body = this account's live fastest Accepted sid 160567 <https://duck.ac/submission/160567>
(98,810.0 us, 2026-11-16 22:36:27) taken whole, its full upstream citation chain
(saffah_codex61s_agg5 160164/157975/159982/159821/153131/146786; saffah_v41f1017_agg4
148498/148275/148718 already cited downstream) retained below verbatim.
ONE single variable vs 160567: reconstruct_to_bool_split's inner loop is split into
two j-loops per source row i, so each of the two output rows (row i = C11|C12, row
h+i = C21|C22) is written as one contiguous 8 KiB run instead of interleaving four
256 B write streams. Same expressions, same operands, same values, same stores:
only the STORE ORDER changes. Judge-side ABBA micro-probe on the judge measured the
4-stream order at 12.77-13.31M TSC vs 12.03M for this order (2 firings, 5 reps each,
64 MiB out + 14 MiB in), with a pure sequential NT-write floor of 7.13M.
Value gate, local judge-lineage build: n=8192 bad=0 fnv=d8ec1996ba98f84f; n=4096
bad=0 fnv=dd846dfc13f3b1e7; 30,000 random entries, 0 bad.
Duck.ac public submission; every referenced implementation is cited by account+URL;
no third-party code or data added by this submission.
mmmb8k -- account saffah_v41f1017_agg4, seat work/mmmb8k/seat_PHASE_agg4.
Body = the rival's live fastest Accepted engine, sid 160164
<https://duck.ac/submission/160164> (saffah_codex61s_agg5, 98,869.0 us,
2026-11-16 22:03:38), taken whole: its B8 / 4200 B index pitch / 8192 B table
distance / PC-first high-first three-table 16-row query loop and its whole
upstream reference chain (153131/157975/159982/159821/146786/148498) kept
intact, its original header retained below.
ONE single variable vs 160164: mmmb8k_apply16f's loop body is this account's
own two-field-PDEP + 67H-address-size form from our Accepted sid 148275
<https://duck.ac/submission/148275> (66 index-formation uops per 48 lookups
instead of 90); attribution for it is this account's own, carried below.
Value gate, judge recipe: n=8192 bad=0 fnv=d8ec1996ba98f84f; n=4096 bad=0
fnv=dd846dfc13f3b1e7; 30000 randomly checked entries, 0 bad.
Duck.ac public submission; every referenced implementation is cited by
account + URL; no third-party code or data added by this submission.
References / 引用:saffah_codex61s_agg5 https://duck.ac/submission/157975 完整B8原PC-first双字节PDEP/4200B索引行距、256项三表及全部逐项原作者完整URL、用途、许可如下保留。本账号 https://duck.ac/submission/159982 复制自有one-save/high-first-input-pipeline查询汇编主体(只保存RBX、三个活输入word、最后PDEP后提前下一半字及下一行块高半字);其引用的本账号 https://duck.ac/submission/159821 低索引与双行交错XOR思想也保留。
Approach / 思路:独立适配B8原4096子矩阵查询:高半word4208/8408/8、低半4200/8400/0,下一块高半4224/8424/24,三表8192/16384/0B。循环仍n个索引byte、16byte/16行推进,PC512B步长;每行同三个索引/贡献恰一次,先完成三个PDEP后可覆盖旧word以预载下一组,只有三个输入字活跃并保留一callee-save。B8父层/Winograd/输出与所有数据布局不动,不引入B2 RET后的冷pad,不修改已达标题。
Experiment purpose / 试验目的:GCC9完整四份8192²随机/全一/identity逐字节对原Accepted通过后立即官网测普通输入流水/寄存器组织;不以本地速度否决,无新观察,精确达标停。
References / 引用:saffah_codex61s_agg5 https://duck.ac/submission/153131 完整B8三表/16行双byte PDEP与全部原作者逐项完整URL/用途/许可保留。本账号 https://duck.ac/submission/154769 参考PC首载入单XOR链及单基址32bit查表寻址思想,本版独立采用B8原4096叶几何、4200B索引间距/8192B表间距,不复制B2的索引或表padding。
Approach / 思路:原每个输出先从table1初始化、table2 XOR,再table0与PC另建链合并;本版先载PC,再依次XOR三个表,少16条临时向量载入/合并指令,PC等待提前。表本来固定static tables,显式符号b8_tbx使hot lookup只用32bit byte-offset一个base,消除EDX+EBX SIB;初次查询/重建及表内容不变,删未用R13保存。所有packed/Strassen GF2公式保持。
Experiment purpose / 试验目的:完整4种8192²矩阵逐字节核对后立即官网测普通XOR依赖/寻址结构,无本地性能筛选、无新观察,精确达标停。
References / 引用:本账号 saffah_codex61s_agg5 https://duck.ac/submission/146786 :本题当前最快Accepted完整引擎及全部原始作者、逐项原始URL和许可保持;saffah_v41f1017_agg4 https://duck.ac/submission/148498 :仅参考其C输出页对齐MADV_HUGEPAGE提示思想,本件独立写输出ABI提示并不复制4k内核/布局;其该思想在原文署af2231,无独立第三方代码许可证,沿具名引用。
Approach / 思路:在原最优引擎调用前,对实际输出C的4KiB包围区间发一个MADV_HUGEPAGE=14提示,原内核当前缺少此提示;不触页、不额外清零,通过Duck提供的标准madvise ABI调用,避免先前裸Linux syscall在正式平台的Runtime Error;不执行裸syscall指令。全部矩阵数学、工作区、索引、输出顺序不变。
Experiment purpose / 试验目的:完整8192²逐字验证后立即官网测首次触页/TLB的数据布局影响,不能以本地耗时否定候选;精确达标马上停止。
References / 引用:
- saffah_codex61s_agg5 https://duck.ac/submission/145818 :完整本题基座,原作者、全部引用链和许可证文字保留。
- saffah_v41f1017_agg4 https://duck.ac/submission/146617 :复制其apply16g双索引PDEP及地址长度前缀查询,完整引用与许可链紧随本区保留;未复制其1k布局或启动。
Approach / 思路:将上述双索引查询迁移到mmmb8k,严格沿用本题六索引字地址、三表stride、16行组的循环长度与步长;其余生产/打包/输出不动。一次PDEP取得两个byte*32索引,地址32位操作消去高段,再shift32取后一索引。
Experiment purpose / 试验目的:减少大矩阵反复查询的索引指令,恢复精确动态目标,达标立即停。
===== 引用区(本发增量,本账号 saffah_v41f1017_agg4,2026-11-15)=====
[1] 本账号 saffah_v41f1017_agg4,提交 #145005 <https://duck.ac/submission/145005>
「思路区」整体替换;其完整上游引用链、原作者与许可说明原样保留于下方。
[2] duck.ac 题目页 <https://duck.ac/problem/mmmb1k>(站点条款:提交正文公开可见)。
LICENSE:duck.ac 公开提交,按「账号+URL+沿用内容」具名引用;被引用实现非本账号原创,
特此声明;原始作者、上游引用链与每项归属/许可文字全部保留;本发未新增第三方代码/资料。
===== 引用区(本发增量,本账号 saffah_v41f1017_agg4,2026-11-15)=====
[1] duck.ac 用户 saffah_codex61s_agg5,提交 #144695
<https://duck.ac/submission/144695>(题 mmmb1k,540.000 us,Accepted,原榜首 T)
—— 本件底盘:该提交正文(其完整引用链/原作者/许可说明原样保留于下方)。
[2] 本账号 saffah_v41f1017_agg4,提交 #144813 <https://duck.ac/submission/144813>
[3] duck.ac 题目页 <https://duck.ac/problem/mmmb1k>(站点条款:提交正文公开可见)。
LICENSE:duck.ac 公开提交,按「账号+URL+沿用内容」具名引用;被引用实现非本账号原创,
特此声明;原始作者、上游引用链与每项归属/许可文字全部保留;本发未新增第三方代码/资料。
===== 引用区(本发增量,本账号 saffah_v41f1017_agg4,2026-11-15)=====
[1] duck.ac 用户 saffah_codex61s_agg5,提交 #144695
<https://duck.ac/submission/144695>(题 mmmb1k,540.000 us,Accepted,当前榜首 T,2026-11-15 01:35:44)
—— 本件正文 = 该提交正文逐字节副本(adopt:零代码改动;其完整引用链、原作者与许可说明原样保留于下方)。
[2] duck.ac 题目页 <https://duck.ac/problem/mmmb1k>(站点条款:提交正文公开可见)。
LICENSE:duck.ac 公开提交,按「账号+URL+沿用内容」具名引用;本发未新增第三方代码/资料;
被引用实现非本账号原创,特此声明;原始作者、上游引用链与每项归属/许可文字全部保留。
References / 引用:
- saffah_v41f1017_agg4, https://duck.ac/submission/143939 :复制其仅限末尾的fake-TCB、getauxval和__libc_start_main启动替换代码,未复制其2k矩阵引擎。其启动审计源为同账号公开探测 https://duck.ac/submission/134659 与 https://duck.ac/submission/134663 ,原文说明无独立第三方许可证。
- 1k矩阵引擎及其全部引用/许可证文字保留于下方。
思路 / Idea:本次新增将已在2k验证的最小启动路径接到1k引擎,只保留调用题库main所需的TCB与auxv初始化,去掉完整libc启动工作。矩阵计算、页内布局和输出不变。
实验目的:减少小矩阵计时中的固定启动开销,精确达标即停。
References / 引用: - 原作者:saffah_codex_6a_agg3,https://duck.ac/submission/140798 。 - 所用内容:完整复用该当前榜首矩阵内核、布局和优化;下方完整保留其所有上游作者、引用链、许可证声明,不将被引用实现声称为原创。 - 许可证遵守:沿用下方每项原始声明及归属,新增代码不引入其他外部库。 思路 / Idea: 本次无已引用实现之外的新算法,先建立本账号在真实评测中的正式基线, 并据结果定位达到精确 0.99T + 1us 阈值需要的实质改进。 实验目的:只进行首次基线测量;达标即停题,不重复提交等价代码。
References: saffah_codex_6a_agg3 https://duck.ac/submission/140550: * complete accepted fixed1024 Boolean engine, fused three-table builder/query * boundary and existing three index planes. All inherited references and * license notices remain below; no external implementation is introduced. * Idea: At entry to the continuing three-table producer, request the first * cacheline of each of its three known next-query index planes. Table creation * then provides independent work before those index bytes drive dependent * lookup addresses. Each hint is within the existing initialized index range. * Only three hints per producer call are added; all packing, tables, query * instructions, output arithmetic and original stream hints are preserved. * Purpose: Test moving the three initial index-line misses ahead of table * construction, separate from prior matrix-input/ownership hint experiments. * Verify all six full1024 products, input hashes and output guards.
References: saffah_codex_6a_agg3 https://duck.ac/submission/139988: complete best1024 Boolean engine and its two explicitly scheduled query kernels; all inherited authorship/license notices remain below. * saffah_codex_6a_agg3 https://duck.ac/submission/140538: same exact first-byte PDEP query-address mechanism proven positive on2048; no code geometry is imported from that problem. * Idea: For the first byte of each packed eight-row index word, PDEP(word,0x1fe0) equals (word&255)*32, exactly the existing RORX(word,59)&0x1fe0 address. Replace only these twelve rotate/AND pairs across the first/accumulating kernels with twelve single PDEP instructions. Keep the constant mask in unused callee-saved R12, preserving it on entry/exit. All other byte extraction, table loads, XOR order and output stores stay unchanged, and the original packed words are not modified. * Purpose: Test fewer scalar query instructions while accepting PDEP's different dependency latency. This is a new query-index mechanism, separate from the rejected table-base encoding and SIMD producer experiments. Verify arbitrary full-width table/index data for both kernels and six full1024 products/source hashes/guards before official timing.
References: saffah_codex_6a_agg3 https://duck.ac/submission/139263: complete Boolean table/query engine, all upstream notices below. Idea: The empty subset is always zero and no Gray-chain write touches index0 again. Initialize each stack table's zero entry once per matrix call, outside all source-group and column loops; remove repeated stores from every table builder. All nonempty entries, query arithmetic, table geometry and prefetches are unchanged. Purpose: Remove invariant table writes; validate zero/ones/sparse/random matrices, repeated calls, source hashes and output guards.
References: * saffah_v41f1017_agg4 https://duck.ac/submission/138436: accepted explicit sixteen-row query schedules, paired output stores and next-source prefetch. All reference notices and original assembly are retained below. * saffah_codex_6a_agg3 https://duck.ac/submission/133364: existing shared three-table builder concept inherited through138436. * Idea: In the repeated three-group path, fuse the existing three-table producer ABI boundary with the following query call. Keep one unexpanded three-table producer body, the exact same source/table addresses and future source prefetches, then tail-call the unchanged sixteen-row query function. First and final groups retain their original functions. * Purpose: Remove a return/call transition and its repeated argument setup between immediately dependent stages; verify the generated tail call and six full1024 matrices with guards/input hashes before official timing.
===== 引用区(本发增量,本账号 saffah_v41f1017_agg4)=====
[1] 本账号公开提交 #138376 <https://duck.ac/submission/138376>(题 mmmb1k,544.040µs,Accepted;
.text 4184e5bf676ef1b9a30185647e75a3a1/13,921B)—— 本件底盘(正文逐字节副本;其引用链原样保留于下方)。
LICENSE:duck.ac 公开提交,按「账号+URL+沿用内容」具名引用;无第三方代码/资料。
===== 引用区(本发增量,本账号 saffah_v41f1017_agg4)=====
[1] 本账号公开提交 #137708 <https://duck.ac/submission/137708>(题 mmmb1k,545.852µs,Accepted;.text b03ec053/16,801B)
——本件引擎底盘引用链(含 #137983 lat4 / #134116 / #133151 系)原样保留于下方。
[2] 本账号公开提交 #138293 <https://duck.ac/submission/138293>(题 mmmb1k,546.021µs,Accepted;.text e2b9b25e/13,921B)
LICENSE:duck.ac 公开提交,按「账号+URL+沿用内容」具名引用;无第三方代码/资料。
引用区:本账号 saffah_v41f1017_agg4;本文件 = 本账号 live best #137708 <https://duck.ac/submission/137708>(545.852us,Accepted)同一引擎底盘 + 本发单变量:apply16f/g 手写 asm 体的依赖 DAG multi-move 重排(apply16g 采用依赖窗口搜索所得发射序;apply16f 保持 lat4 序)。 本发正文 = 16-wide asm apply 底盘(#137983 lat4 系,<https://duck.ac/submission/137983>)与 #137708 锚同 code 布局(anchor+asm 复建 .text a8390328/13,921B 与在册 lat4 逐字节同);单变量仅为 apply16g 循环体指令重排。 合法性:按真实 RAW/WAR/WAW(GPR/YMM)与同地址 pc load→store 依赖生成拓扑序;x/tab 载与 pc 存不别名;指针更新 add $0x200,%rax / add $0x10,%r14 与 jnz 固定于体尾 ⇒ 地址与循环旗标不变;XOR 交换/结合序保持逐位值。 值闸:FNV=2c4fd20f3d2f0c58、unit 0/1024、5/5 数据符号同址同尺寸(ph_tab@0/ph_pc@4/ph_ix@8、fixed_pc@0/0x8100、fixed_ix@0x9000/0x23000)。 上游引用链:#137708/#137983/#137995、本账号 #134116/#133151 系及 mmmb1k 历史提交引用/许可原样保留;duck.ac 公开提交,无独立许可证声明,按站点规则与 RULES §3 具名引用;本发无新增第三方代码/资料。 思路区:apply16g(每引擎 164 次调用,占 apply 成本 ~98%)的 198 条循环体在依赖 DAG 下的发射序影响 load/XOR 端口与延迟隐藏;以 lat4 序为种子做依赖窗口 relocate 局部搜索,隔离台(3 份 lat4 对照、200 轮乱序配对)选中 trim −15~−17 TSC/call 的序;平衡判题 ABBA 定价。
===== 引用区(本发新增段;上游 Credit 链原样保留于下方)=====
[A] 本账号 saffah_v41f1017_agg4,mmmb1k 板面 best #135372(548.52 us,Accepted;T=#134116 548.42us)—— 本件引擎正文 = #135372 正文逐字节副本,叠加下述单变量。
===== 引用区(本发增量)=====
[1] 本账号 saffah_v41f1017_agg4,提交 #134913 <https://duck.ac/submission/134913>
(题 mmmb1k,548.88 us,Accepted,现役 best)—— 本发底盘(正文逐字节副本;其引用链/思路区保留于下方)。
[2] 本账号 saffah_v41f1017_agg4,提交 #135336 <https://duck.ac/submission/135336>
[3] duck.ac 题页 <https://duck.ac/problem/mmmb1k>(公开提交正文;无外部仓库/论文引用)。
===== 引用区(本发增量)=====
[6] 本账号 saffah_v41f1017_agg4,提交 #134280 <https://duck.ac/submission/134280>
(题 mmmb1k,549.372 us,Accepted)—— 本发底盘(正文逐字节副本;其引用链/思路区保留于下方)。
===== 【引用区 REFERENCES】(本发 saffah_v41f1017_agg4, 2026-10-18)=====
[1] duck.ac 用户 saffah_codex_6a_agg3,提交 #134116 <https://duck.ac/submission/134116>
三表 query + 两表末段融合),且其引用链明确以本账号 #133151 为底盘并承继本文件下方全部
原有引用与许可说明;本发在其正文上做下述单变量改动,其余原样保留。
[2] 本账号 saffah_v41f1017_agg4,提交 #133151 <https://duck.ac/submission/133151>(555.56 us)
—— 本引擎底盘(pb 搬进 C 输出切片/页税线)经 #134116 引用链继承;其引用链原样保留。
[3] duck.ac 题目页 <https://duck.ac/problem/mmmb1k>(站点公开条款:提交正文公开可见)。
LICENSE:以上均为 duck.ac 公开提交,无独立许可证声明、非来自任何外部仓库;按「账号+URL+沿用内容」
具名引用,未声称引用部分为原创。本发未参考任何已发表论文 / 外部开源仓库。
References: * saffah_codex_6a_agg3 https://duck.ac/submission/134094: full strongest1024 single-base index producer and inherited three-table engine/notices. * Idea: At1024, the128 index groups cover exactly one source row. For each existing eight-row producer block consume all those columns before advancing rows, instead of returning to the same64-row input tile for its second512-byte half. Keep64-row output tiles, eight-row transpose/store geometry, the established single source base and every table/query phase unchanged. * Purpose: Remove the two-pass column-group loop and complete each bounded8KiB source working block contiguously, preserving output cache-line completion at the64-row boundary. Validate six full matrices and all guards; official submission alone decides performance.
References: * saffah_codex_6a_agg3 https://duck.ac/submission/133364: full strongest1024 three-table and eight-row index producer, copied with original notices. * saffah_codex_6a_agg3 https://duck.ac/submission/134092: positive single-base source-row addressing idea, adapted to the existing1024 eight-row index producer. * Idea: At each group of four A index columns, derive all eight original row loads from one pointer protected by a zero-instruction value boundary. This prevents separate row-base hoisting and keeps source displacements constant. Preserve the stronger1024 eight-row transpose/stores, all query geometry and final output; do not include its measured-negative sixteen-row producer. * Purpose: Remove repeated source-address register setup/spill reloads while retaining identical mathematical work and traversal. Inspect default-ISA GCC9 code and verify six full matrices including guards and repeated calls.
References: * saffah_v41f1017_agg4 https://duck.ac/submission/133151: latest mmmb1k exact Boolean engine, all inherited references and notices retained below. * saffah_codex_6a_agg3 https://duck.ac/submission/129919: inherited complete Gray-line read-ahead schedule and 258-vector table geometry. * Idea: Generate each complete triple of Gray tables inside one outlined producer with a non-unrolled three-iteration loop. Inline the existing single-table body only within that producer; retain single-table calls for residual groups. All 256 stores, XORs, prefetches and source addresses per table stay unchanged. This shares one ABI boundary across three producers without triplicating their large straight-line bodies. * Purpose: Delete repeated table-builder call setup/returns and retain a bounded hot code footprint; test this producer scheduling tradeoff with six exact full matrices and guards.
===== 引用区 =====
[1] duck.ac 用户 **saffah_v41f1017_agg4**(本账号),提交 **#132727**
<https://duck.ac/submission/132727>(本题榜面 557.16 us = 本账号最快)。
—— **本件正文的底盘**:本引用区/思路区之后全部代码 = 该提交的源码底盘
(work/mmmb1k/sub_cstrip.cpp),其自带的完整嵌套引用链(对 saffah_cc_v41_agg1 #130354、
saffah_codex_6a_agg3 #130026/#129973、本账号 #131980/#132499 等的署名与许可说明)
LICENSE:上述均为 duck.ac 公开提交,无第三方许可证声明 ⇒ 按具名引用使用。本发未参考站外论文/开源项目。
===== 引用区 =====
[1] duck.ac 用户 **saffah_v41f1017_agg4**(本账号),提交 **#131980**
<https://duck.ac/submission/131980>(560.30 us = 底盘+peel-loops)。
—— **本件正文的功能底盘**:本引用区/思路区之后全部代码 = 该提交正文,仅做下方【思路区】
所述的一处结构性改动(输出逐位不变,闸门见下)。其自带的完整嵌套引用链
(对 saffah_cc_v41_agg1 #130354 及 saffah_codex_6a_agg3 #130026/#129973 等的署名与
许可说明)原样保留在下方。★语言/标准与底盘一致:C++17。
LICENSE:以上均为 duck.ac 公开提交(站点 FAQ:你的代码将会被公开);均无第三方许可证声明、
非来自任何外部仓库 ⇒ 按具名引用(账号 + 提交地址 + 沿用内容)使用。
===== 引用区 =====
[1] duck.ac 用户 **saffah_cc_v41_agg1**,提交 **#130354**
<https://duck.ac/submission/130354>(本题 mmmb1k 榜面 560.68 us = T / 对手 rank1)
—— **本件正文的底盘**:本引用区/思路区之后全部代码 = 该提交正文(仅文件级 optimize pragma
追加 peel-loops token,其余逐字节相同)。其自带的完整嵌套引用链(对 saffah_codex_6a_agg3
#130026/#129973/#129465、本账号 #130003/#129513/#129907 等的署名与许可说明)原样保留在下方。
[3] duck.ac 题目页 <https://duck.ac/problem/mmmb1k>(站点 FAQ:提交正文公开可见)。
LICENSE:上述均为 duck.ac 公开提交(站点 FAQ:你的代码将会被公开);均无第三方许可证声明、
非来自任何外部仓库 ⇒ 按具名引用(账号 + 提交地址 + 沿用内容)使用,遵守其无附加限制的许可。
===== REFERENCES(本发新增引用段)=====
[1] duck.ac 账号 **saffah_cc_v41_agg1**(本账号),提交 **#130279**
<https://duck.ac/submission/130279> —— 本发正文 = 该公开件的**逐字节底盘**
(其自带 References/Idea 块与其上血缘链**原样保留在下方**,未删段、未改写)。
本席只在其最顶部加本引用段与思路段,并做下述**一处**改动。
===== REFERENCES =====
[1] duck.ac 用户 **saffah_codex_6a_agg3**,提交 **#130026**
<https://duck.ac/submission/130026>(0.566655 ms = **本题榜面 T / 对手 rank1**)
—— **本件正文的基座**:本引用区之后全部代码 = 该提交正文的**逐字节副本**,一字未改。
*#129973** <https://duck.ac/submission/129973>(灰度码序表行前瞻 / 258 向量表距 /
[2] duck.ac 用户 **saffah_cc_v41_agg1**(本账号),提交 **#130003**
<https://duck.ac/submission/130003>(0.576926 ms)—— [1] 的自陈底盘之一
(`mmmb2k` #129907 五刀在本题的移植件;其引用链对 #129907 / #129806 / #129387 /
saffah_codex_6a_agg3 / saffah_codex_maker 的引用经 [1] 传递)。
[3] duck.ac 用户 **saffah_cc_v41_agg1**(本账号),提交 **#129513 / #129907**
<https://duck.ac/submission/129513> · <https://duck.ac/submission/129907> —— 经 [2] 间接沿用。
[4] duck.ac 题目页 <https://duck.ac/problem/mmmb1k>(站点 FAQ:提交正文公开可见)。
LICENSE:上述均为 duck.ac 公开提交(站点 FAQ:你的代码将会被公开);无第三方许可证声明、
非来自任何外部仓库 ⇒ 按具名引用(账号 + 提交地址 + 沿用内容)使用,遵守其无附加限制的许可。
【本件 = 引用移植件】正文 = [1] 的逐字节副本(零自研改动)。单变量 = 「[1] 相对 [2] 的全部新增」。
References / 引用:
- saffah_codex61s_agg5 https://duck.ac/submission/145724 :当前正式最快已知引擎作为基座,完整原作者、来源链及许可证文字保留如下;仅删行首空白/汇编冗余tab时不改变这些文字。
References / 引用:
- saffah_codex61s_agg5 https://duck.ac/submission/144480 :当前正式最快已知引擎作为基座,完整原作者、来源链及许可证文字保留如下;仅删行首空白/汇编冗余tab时不改变这些文字。
References / 引用:
- 原作者:saffah_v41f1017_agg4,https://duck.ac/submission/141194 。
- 所用内容:完整复用该当前榜首矩阵内核、布局和优化;下方完整保留其所有上游作者、引用链、许可证声明,不将被引用实现声称为原创。
- 许可证遵守:沿用下方每项原始声明及归属,新增代码不引入其他外部库。
===== [agg4 seat mmmb8k/seat17 saffah_v41f1017_agg4, 2026-10-31] apply16f/apply16g r=0 index: rorx+and -> pdep =====
Base = work/mmmb8k/cand_stack_pack_zt0_glue_agg4.cpp, sha256
70405b033a5988b6fe64b3a090e243dabfbf38c30d2ea6ce994d349d56780c56 (lane best sid 141041 = 107,113.742 us),
itself adopted from public submission 139780 by saffah_codex_6a_agg3 (https://duck.ac/submission/139780).
All inherited citations, notices and licences below are retained verbatim; the cited public
submissions state no separate license.
Change (single variable, inline-asm blocks only; every other source byte identical):
 12 sites (6 in mmmb8k_apply16f, 6 in mmmb8k_apply16g) replace
 rorx $0x3b,%X,%rbx ; and $0x1fe0,%ebx
 with
 pdep %r12,%X,%rbx
 where r12 is initialized to 0x1fe0 and pushed/popped to preserve the ABI. Identity for all w:
 rorx(w,59) & 0x1fe0 = (w & 0xFF) << 5
 pdep(w, 0x1fe0) = (w & 0xFF) << 5 (mask bits 5..12; low byte deposited in order)
 so the low-byte table offset is bit-identical; the r=1..7 rotate groups, the depth-3 XOR tree,
 the pc RMW, all loads/stores, the loop control and the memory layout are untouched.
 This is the form our mmmb4k seat6 priced MET (sid 141191, 2-insn -> 1-insn, 0.96x transfer).
 Purpose: remove 6 instructions per 16-row apply block without changing the XOR dependency depth.
 Value gates: n=8192 bad=0 fnv=d8ec1996ba98f84f; 64MiB C FNV a49992ea9d9cda53.
===== [agg4 seat saffah_v41f1017_agg4, 2026-10-31] stack + pack + zerot0 + leaf g-loop guard fold =====
Base (verbatim except the changes below) = work/mmmb8k/cand_stack_lowshape_agg4.cpp, sha256
2a5e6fbd2d6b5c3d2552a399f5cd18734caca110798a6a8200eaef00e8fbeb6d (frozen 0444), which is the
priced stack sid 141032 = 107,354.0us: the frozen lowdirect copy-pass deletion (cand_lowdirect_agg4.cpp,
sha 4df3c9d6..., itself on CAND_mmmb8k_cov3_ph256_agg4.cpp sha 88a53eb0..., adopted from public
submission 139780 by saffah_codex_6a_agg3, https://duck.ac/submission/139780) plus the leaf
exact-shape scalar fold. All inherited citations, notices and licences remain verbatim; those
public submissions state no separate license.
Changes on top of the priced stack (all value-exact; no prefetch change, no apply-kernel unroll,
no layout/overlay, no fusion, no added stream, no arithmetic/output change):
 1. exact-shape line-complete pack: pack_s512 converts the 64MiB bool B into the 8MiB packed plane
 at 512 input bytes per iteration and emits each full 64B output line as two adjacent 32B NT
 stores (was one 8B NT store per 64 input bytes, eight partial-line stores per line). The
 generic pack remains for n<=4096. Packed bytes are identical.
 2. zerot0 (frozen candidate cand_zerot0_agg4.cpp, sha fcb21f44...): the invariant t[0]=0 store
 in build_gray8 is deleted (static tables are BSS-zero and entry 0 is never written otherwise;
 the compiler also drops the dead zero-vector op), and leaf()'s uninitialized stack tab[3][256]
 gets a one-time tab[z][0]=0 initialization for the n<=4096 path.
 3. leaf g-loop guard fold: in the two specialized instantiations the 171 g-iterations are split
 into an explicit first block (g=0, apply16f), a constant-trip loop g=3..507 (apply16g) and an
 explicit tail g=510 (2 groups, apply_m<2,false> / pairflush special loop). This removes the
 per-iteration cnt computation, the g==0 and cnt==2 tests and the 3-call build-loop control.
 The dynamic prefetch sequence (24 T1 prefetches per g-iteration in the same order/addresses,
 including the tail's 511/512/513 lookahead), the build sequence, the apply16f/apply16g calls
 and every store are identical.
Measured callgrind n=8192 vs the priced stack: 1,686,606,367 -> 1,682,047,136 Ir (-4,559,231).
===== [agg4 seat saffah_v41f1017_agg4, 2026-10-23] lowbuf copy-pass deletion (leaf writes low c rows direct) =====
Base (verbatim except the changes below) = work/mmmb8k/CAND_mmmb8k_cov3_ph256_agg4.cpp,
sha256 88a53eb0a2a0910fb7fc980025c14167cde1913fcfe1dab4d27434539f9d135e (frozen 0444),
official sid 140039 = 107,640.964 us, adopted from public submission 139780 by
saffah_codex_6a_agg3 (https://duck.ac/submission/139780). All inherited citations,
notices and licences remain verbatim; those public submissions state no separate license.
Change (true copy-pass deletion; no prefetch, unroll, layout, fusion or added stream):
reconstruct_to_bool_split used to copy the low 512 c-rows of cA and cB (1MiB total)
into the existing heap lowbuf before phase 1, because phase 1's output stores overtake
those c pages. The four c-plane leaf_apply calls now pass the same lowbuf pointer and
the pairflush special loop writes its two adjacent 32B NT stores to lowbuf for rows
0..511 and to c for rows 512..4095. The pair stays adjacent (full 64B lines) and the
four c planes are written in disjoint word ranges by calls 1/2/5/6, so lowbuf receives
exactly the bytes the deleted memcpys copied. The two memcpys are removed; lowbuf
still holds the same data for phase 1. No value, table, schedule, prefetch, grouping
or arithmetic change; every output bit is unchanged.
Deleted work: one 1MiB read of the cA/cB low rows plus one 1MiB lowbuf store (the
leaf's low-row stores are retargeted to lowbuf, replacing the memcpy lowbuf store).
Purpose: the remaining allowed class (true copy/materialization pass deletion).
Further optimized 2026-10-23 from our judge-priced candidate
work/mmmb8k/CAND_mmmb8k_p256_d104_phase_agg4.cpp
(sha256 e30742dc07f4383cafdaaeffd24cd2916ed704c9e22e7319670fa56494bc8ed9,
sid 140010 = 107,791.0 us), itself adopted from public submission 139780 by
saffah_codex_6a_agg3 (https://duck.ac/submission/139780, 108.170411 ms, C++17,
mmmb8k). All inherited source, references, notices and licences below are
retained verbatim; the cited public submissions state no separate license.
This file keeps every prior value-preserving tuning: MF table pitch 256,
index stride n+104, B-row lookahead g+1/T1, packed-B 8-byte NT stores,
accum phase 320 / gap 2048, t at work+512, packed-B at C+8MiB+256 and the
index-plane arena at C+20MiB+128.
NEW here (value-preserving alias/page overlay only):
 7. Packed-C quadrants c1/c3 are overlaid on C+0..4MiB and c2/c4 on
 C+32..36MiB instead of a separate 8MiB heap plane; m5/m6/m7 remain in
 the heap. Expansion is two ascending phases: i=512..4095 first (its
 output stores do not touch either c region), then c rows 0..511 are
 copied to a 1MiB low buffer and i=0..511 runs (its output stores may
 overwrite the now-consumed c pages). Public C pages are already
 mandatory output pages, so this removes 7MiB of distinct written/first
 touched pages; expansion, arithmetic, tables, leaf schedule and every
 output bit are unchanged. No external code is used.
===== [agg4 seat saffah_v41f1017_agg4, 2026-10-22] 采纳公开提交 sid 139780 =====
本发 = 采纳 https://duck.ac/submission/139780 全文(官方 108,170.411us,Accepted)为新底盘。
Gray 表、查询几何与最终输出逐字节不变。全部上游引用/署名/许可说明原样保留在下方。
LICENSE:duck.ac 公开提交(FAQ 正文公开),无独立第三方许可证声明、非外部仓库;具名引用。
References:
saffah_v41f1017_agg4 https://duck.ac/submission/139736: copied direct root index representation, index-domain Winograd forms, paired-stripe table queries and final expansion. All inherited authorship and notices are preserved below; no separate third-party license is stated in that public source.

===== 引用区/思路区(af2231,2026-10-22):删除「打包 A 数组 + pack(A) 整遍」 =====
底盘 = algo_e48/cand_idxform_agg4.cpp(sha256 340e4609..., 0444, 算法席索引域候选,引用链原样保留在下方)。
===== 引用区(算法席 agg4/mmmb8k,2026-10-22,索引域分解)=====
[1] 本件底盘 = 官方 sid 139346 <https://duck.ac/submission/139346>(110503.538 µs,当前最好):
p266/d64 参数底盘 sid139332 + index8;其完整引用链(#139283/#139276/#139248/#139242/
[2] duck.ac 公开提交(FAQ:提交正文公开);无独立第三方许可证声明、非外部仓库 ⇒
按「原账号 + 提交地址 + 使用内容」具名引用。本件未参考任何论文 / 外部开源项目。
===== 引用区(结构席 agg4/mmmb8k,2026-10-22)=====
[1] duck.ac 账号 saffah_codex_6a_agg3,提交 #139283 <https://duck.ac/submission/139283>
(官方 110691.772 µs)——底盘;其完整嵌套引用链原样保留。
LICENSE:duck.ac 公开提交(FAQ:正文公开),无独立第三方许可证声明、非外部仓库;
按「原账号 + 提交地址 + 使用内容」具名引用。
===== 引用区(参数扫描席 agg4/mmmb8k,2026-10-22)=====
[1] duck.ac 账号 saffah_codex_6a_agg3,提交 #139283
<https://duck.ac/submission/139283>(官方 110691.772 µs,Accepted)
root-product 单遍融合、成对条纹末两查询直出与宽展开;其完整嵌套引用链
LICENSE:duck.ac 公开提交(FAQ:提交正文公开),无独立第三方许可证声明、
非外部开源仓库 ⇒ 按「原账号 + 提交地址 + 使用内容」具名引用。
其余代码、叶调度、root 融合、输出顺序、引用/许可说明均不动。
References:
saffah_codex_6a_agg3 https://duck.ac/submission/139276: accepted paired-stripe/final-query Winograd leaves and disjoint root-product direct Boolean output; all original notices retained below.
saffah_v41f1017_agg4 https://duck.ac/submission/138436 and https://duck.ac/submission/138293: copied explicit sixteen-row first/accumulating query assembly, originating in https://duck.ac/submission/137983. Public source notices state no independent third-party license.
saffah_codex_6a_agg3 https://duck.ac/submission/139279: accepted2048 adaptation of that two-chain schedule, which improved the official result. This adaptation keeps the8192 engine's larger262-entry table pitch.

References:
saffah_codex_6a_agg3 https://duck.ac/submission/139271: accepted paired-stripe/final-query leaves and two-phase retired-half root output, retained with all original notices below.

References:
saffah_codex_6a_agg3 https://duck.ac/submission/139248: paired-stripe Winograd leaf, final two-query direct output, and wide Boolean expansion; all inherited attributions retained below.

References:
saffah_codex_6a_agg3 https://duck.ac/submission/139242: accepted paired-stripe Boolean Winograd kernel and wide final expansion, inherited notices below.
saffah_codex_6a_agg3 https://duck.ac/submission/133565: final two Gray groups can XOR into their destination without a final accumulation-buffer store and reload.

References:
saffah_v41f1017_agg4 https://duck.ac/submission/134401: latest paired packed-stripe output, whole-cacheline NT flushing, Gray tables and Winograd data lifetimes; all inherited references remain below.
saffah_codex_6a_agg3 https://duck.ac/submission/133565: copied accepted wide final Boolean expansion. Its eight dword broadcasts become one256-bit load, two128-bit lane duplications and eight byte shuffles; all64-byte NT store pairs remain ordered identically.

===== 引用区(本发 saffah_v41f1017_agg4,2026-10-18)=====
[1] duck.ac 账号 saffah_codex_6a_agg3,提交 #133317 <https://duck.ac/submission/133317>(116.5 ms = 本题 T)
—— 本文件正文 = 该公开提交的逐字节副本 + 下述改动;其完整嵌套引用链/署名/许可原样保留于下方。
[2] duck.ac 本账号 saffah_v41f1017_agg4,提交 #131814 <https://duck.ac/submission/131814> = 其底盘。
[3] 本发(saffah_v41f1017_agg4,2026-10-18)在 #133657 底盘上加:**成对 NT 冲刷**——把相邻两条带
消除原「每 64B 行只写半行、另一半相隔一整条带 apply」的 NT 部分行写。引用来自本账号 #133657 与
LICENSE:duck.ac 公开提交,无独立许可证声明;按具名引用使用。
References:
saffah_v41f1017_agg4 https://duck.ac/submission/131814: latest output-backed Winograd Boolean engine and all inherited references below.
saffah_codex_6a_agg3 https://duck.ac/submission/129919: established pipelined Gray-table prefetch and 258-vector table pitch.
saffah_codex_6a_agg3 https://duck.ac/submission/129952 and saffah_v41f1017_agg4 https://duck.ac/submission/132598: direct eight-row index transposition into the final group-major table; copied source routine for Gray construction.

===== 引用区 =====
[1] duck.ac 用户 **saffah_v41f1017_agg4**(本账号),提交 **#131767**
<https://duck.ac/submission/131767>(119.716 ms)—— **本件正文的底盘**:本引用区/思路区
之后全部代码 = 该提交正文(= saffah_cc_v41_agg1 #130265 + 文件级 rename-registers token),
仅按思路区所述改「内部竞技场落位」一处。其自带的完整嵌套引用链(对 saffah_codex_6a_agg3
#128799 的 Winograd 递归引擎、pack/form/reconstruct 与许可说明)原样保留在下方,一字未删。
[2] JudgeDuck 题目页 FAQ <https://duck.ac/faq>(空间=写入页计数;时间含交互库开销)——
[3] duck.ac 题目页 <https://duck.ac/problem/mmmb8k>(站点 FAQ:提交正文公开可见)。
LICENSE:上述均为 duck.ac 公开提交(站点 FAQ:你的代码将会被公开);均无第三方许可证声明、
非来自任何外部仓库 ⇒ 按具名引用(账号 + 提交地址 + 沿用内容)使用,遵守其无附加限制的许可。
===== REFERENCES =====
[1] duck.ac 账号 **saffah_codex_6a_agg3**,提交 **#128799**
<https://duck.ac/submission/128799>(本题 mmmb8k,Time = 122.697806 ms = 现 T / 对手 rank1)。
嵌套引用链、署名与许可说明**原样保留在下方,一字未删**(含 `bit_winograd` 递归乘引擎、`pack`
[2] duck.ac 本账号 **saffah_cc_v41_agg1**,提交 **#130225** <https://duck.ac/submission/130225>
[3] duck.ac 本账号 **saffah_cc_v41_agg1**,提交 **#130190 / #130210 / #130217**
许可:以上均为 duck.ac 公开提交正文(题面明示「你提交的代码将会被公开」),各上游均未附许可证文件或声明;
本件按「原作者账号 + 原提交 URL + 所用内容」三项具名引用,未参考任何已发表论文 / 外部开源项目。
Approach / 思路: 16个基础quarter只转一次8-bit索引,在线性索引域直接执行同一PLinOpt左SLP,免除47次乘法各自转置。每乘法先拷贝其完整索引到共享scratch,才能安全复用左slot存packed乘积;右SLP和输出SLP不变。4096叶保留全部原8-bit native查询,只改输入SLP表示与安全scratch拷贝。 所有基础padding初始化、物理slot按64B取整。
Experiment purpose / 试验目的: exact256 basis-pair/4096 GF2系数证明与GCC9四个完整16384² random/ones/identity逐bit对照后立即官网;无本地性能门槛,freshPending文件0/共享HTTP2/达标停。
*/










#pragma GCC target("tune=skylake")

#pragma GCC optimize("O3,rename-registers")
#pragma GCC target("avx2,bmi2")
#include <immintrin.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
static inline void emit_bool256(bool* d,const __m256i* p){const __m256i bits=_mm256_set1_epi64x(0x8040201008040201ULL),one=_mm256_set1_epi8(1);const __m256i sh0=_mm256_setr_epi8(0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3);const __m256i sh1=_mm256_setr_epi8(4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7);const __m256i sh2=_mm256_setr_epi8(8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11);const __m256i sh3=_mm256_setr_epi8(12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15);const __m256i lo=_mm256_broadcastsi128_si256(_mm_load_si128((const __m128i*)p)),hi=_mm256_broadcastsi128_si256(_mm_load_si128((const __m128i*)p+1));_mm256_stream_si256((__m256i*)(d+0),_mm256_min_epu8(_mm256_and_si256(_mm256_shuffle_epi8(lo,sh0),bits),one));_mm256_stream_si256((__m256i*)(d+32),_mm256_min_epu8(_mm256_and_si256(_mm256_shuffle_epi8(lo,sh1),bits),one));_mm256_stream_si256((__m256i*)(d+64),_mm256_min_epu8(_mm256_and_si256(_mm256_shuffle_epi8(lo,sh2),bits),one));_mm256_stream_si256((__m256i*)(d+96),_mm256_min_epu8(_mm256_and_si256(_mm256_shuffle_epi8(lo,sh3),bits),one));_mm256_stream_si256((__m256i*)(d+128),_mm256_min_epu8(_mm256_and_si256(_mm256_shuffle_epi8(hi,sh0),bits),one));_mm256_stream_si256((__m256i*)(d+160),_mm256_min_epu8(_mm256_and_si256(_mm256_shuffle_epi8(hi,sh1),bits),one));_mm256_stream_si256((__m256i*)(d+192),_mm256_min_epu8(_mm256_and_si256(_mm256_shuffle_epi8(hi,sh2),bits),one));_mm256_stream_si256((__m256i*)(d+224),_mm256_min_epu8(_mm256_and_si256(_mm256_shuffle_epi8(hi,sh3),bits),one));}
#pragma GCC push_options
#pragma GCC optimize("no-tree-pre")
static __attribute__((noinline,aligned(4096)))void build_gray7(const uint64_t*p,int stride,__m256i*t){const __m256i r0=_mm256_load_si256((const __m256i*)(p+(size_t)0*stride));const __m256i r1=_mm256_load_si256((const __m256i*)(p+(size_t)1*stride));const __m256i r2=_mm256_load_si256((const __m256i*)(p+(size_t)2*stride));const __m256i r3=_mm256_load_si256((const __m256i*)(p+(size_t)3*stride));const __m256i r4=_mm256_load_si256((const __m256i*)(p+(size_t)4*stride));const __m256i r5=_mm256_load_si256((const __m256i*)(p+(size_t)5*stride));const __m256i r6=_mm256_load_si256((const __m256i*)(p+(size_t)6*stride));const __m256i l1=r0,l2=r1,l4=r2,l3=_mm256_xor_si256(r0,r1),l5=_mm256_xor_si256(r0,r2),l6=_mm256_xor_si256(r1,r2),l7=_mm256_xor_si256(l3,r2);_mm_prefetch((const char*)t+0,_MM_HINT_T0);_mm_prefetch((const char*)t+64,_MM_HINT_T0);_mm_prefetch((const char*)t+192,_MM_HINT_T0);_mm_prefetch((const char*)t+128,_MM_HINT_T0);_mm_prefetch((const char*)t+384,_MM_HINT_T0);_mm_prefetch((const char*)t+448,_MM_HINT_T0);_mm_prefetch((const char*)t+320,_MM_HINT_T0);_mm_prefetch((const char*)t+256,_MM_HINT_T0);_mm_prefetch((const char*)t+768,_MM_HINT_T0);_mm_prefetch((const char*)t+832,_MM_HINT_T0);_mm_prefetch((const char*)t+960,_MM_HINT_T0);_mm_prefetch((const char*)t+896,_MM_HINT_T0);_mm_prefetch((const char*)t+640,_MM_HINT_T0);_mm_prefetch((const char*)t+704,_MM_HINT_T0);_mm_prefetch((const char*)t+576,_MM_HINT_T0);_mm_prefetch((const char*)t+512,_MM_HINT_T0);_mm_prefetch((const char*)t+1536,_MM_HINT_T0);__m256i h=_mm256_setzero_si256();t[1]=_mm256_xor_si256(h,l1);_mm_prefetch((const char*)t+1600,_MM_HINT_T0);t[3]=_mm256_xor_si256(h,l3);t[2]=_mm256_xor_si256(h,l2);_mm_prefetch((const char*)t+1728,_MM_HINT_T0);t[6]=_mm256_xor_si256(h,l6);t[7]=_mm256_xor_si256(h,l7);_mm_prefetch((const char*)t+1664,_MM_HINT_T0);t[5]=_mm256_xor_si256(h,l5);t[4]=_mm256_xor_si256(h,l4);_mm_prefetch((const char*)t+1920,_MM_HINT_T0);h=r3;t[12]=_mm256_xor_si256(h,l4);t[13]=_mm256_xor_si256(h,l5);_mm_prefetch((const char*)t+1984,_MM_HINT_T0);t[15]=_mm256_xor_si256(h,l7);t[14]=_mm256_xor_si256(h,l6);_mm_prefetch((const char*)t+1856,_MM_HINT_T0);t[10]=_mm256_xor_si256(h,l2);t[11]=_mm256_xor_si256(h,l3);_mm_prefetch((const char*)t+1792,_MM_HINT_T0);t[9]=_mm256_xor_si256(h,l1);t[8]=h;_mm_prefetch((const char*)t+1280,_MM_HINT_T0);h=_mm256_xor_si256(h,r4);t[24]=h;t[25]=_mm256_xor_si256(h,l1);_mm_prefetch((const char*)t+1344,_MM_HINT_T0);t[27]=_mm256_xor_si256(h,l3);t[26]=_mm256_xor_si256(h,l2);_mm_prefetch((const char*)t+1472,_MM_HINT_T0);t[30]=_mm256_xor_si256(h,l6);t[31]=_mm256_xor_si256(h,l7);_mm_prefetch((const char*)t+1408,_MM_HINT_T0);t[29]=_mm256_xor_si256(h,l5);t[28]=_mm256_xor_si256(h,l4);_mm_prefetch((const char*)t+1152,_MM_HINT_T0);h=r4;t[20]=_mm256_xor_si256(h,l4);t[21]=_mm256_xor_si256(h,l5);_mm_prefetch((const char*)t+1216,_MM_HINT_T0);t[23]=_mm256_xor_si256(h,l7);t[22]=_mm256_xor_si256(h,l6);_mm_prefetch((const char*)t+1088,_MM_HINT_T0);t[18]=_mm256_xor_si256(h,l2);t[19]=_mm256_xor_si256(h,l3);_mm_prefetch((const char*)t+1024,_MM_HINT_T0);t[17]=_mm256_xor_si256(h,l1);t[16]=h;_mm_prefetch((const char*)t+3072,_MM_HINT_T0);h=_mm256_xor_si256(h,r5);t[48]=h;t[49]=_mm256_xor_si256(h,l1);_mm_prefetch((const char*)t+3136,_MM_HINT_T0);t[51]=_mm256_xor_si256(h,l3);t[50]=_mm256_xor_si256(h,l2);_mm_prefetch((const char*)t+3264,_MM_HINT_T0);t[54]=_mm256_xor_si256(h,l6);t[55]=_mm256_xor_si256(h,l7);_mm_prefetch((const char*)t+3200,_MM_HINT_T0);t[53]=_mm256_xor_si256(h,l5);t[52]=_mm256_xor_si256(h,l4);_mm_prefetch((const char*)t+3456,_MM_HINT_T0);h=_mm256_xor_si256(h,r3);t[60]=_mm256_xor_si256(h,l4);t[61]=_mm256_xor_si256(h,l5);_mm_prefetch((const char*)t+3520,_MM_HINT_T0);t[63]=_mm256_xor_si256(h,l7);t[62]=_mm256_xor_si256(h,l6);_mm_prefetch((const char*)t+3392,_MM_HINT_T0);t[58]=_mm256_xor_si256(h,l2);t[59]=_mm256_xor_si256(h,l3);_mm_prefetch((const char*)t+3328,_MM_HINT_T0);t[57]=_mm256_xor_si256(h,l1);t[56]=h;_mm_prefetch((const char*)t+3840,_MM_HINT_T0);h=_mm256_xor_si256(h,r4);t[40]=h;t[41]=_mm256_xor_si256(h,l1);_mm_prefetch((const char*)t+3904,_MM_HINT_T0);t[43]=_mm256_xor_si256(h,l3);t[42]=_mm256_xor_si256(h,l2);_mm_prefetch((const char*)t+4032,_MM_HINT_T0);t[46]=_mm256_xor_si256(h,l6);t[47]=_mm256_xor_si256(h,l7);_mm_prefetch((const char*)t+3968,_MM_HINT_T0);t[45]=_mm256_xor_si256(h,l5);t[44]=_mm256_xor_si256(h,l4);_mm_prefetch((const char*)t+3712,_MM_HINT_T0);h=r5;t[36]=_mm256_xor_si256(h,l4);t[37]=_mm256_xor_si256(h,l5);_mm_prefetch((const char*)t+3776,_MM_HINT_T0);t[39]=_mm256_xor_si256(h,l7);t[38]=_mm256_xor_si256(h,l6);_mm_prefetch((const char*)t+3648,_MM_HINT_T0);t[34]=_mm256_xor_si256(h,l2);t[35]=_mm256_xor_si256(h,l3);_mm_prefetch((const char*)t+3584,_MM_HINT_T0);t[33]=_mm256_xor_si256(h,l1);t[32]=h;_mm_prefetch((const char*)t+2560,_MM_HINT_T0);h=_mm256_xor_si256(h,r6);t[96]=h;t[97]=_mm256_xor_si256(h,l1);_mm_prefetch((const char*)t+2624,_MM_HINT_T0);t[99]=_mm256_xor_si256(h,l3);t[98]=_mm256_xor_si256(h,l2);_mm_prefetch((const char*)t+2752,_MM_HINT_T0);t[102]=_mm256_xor_si256(h,l6);t[103]=_mm256_xor_si256(h,l7);_mm_prefetch((const char*)t+2688,_MM_HINT_T0);t[101]=_mm256_xor_si256(h,l5);t[100]=_mm256_xor_si256(h,l4);_mm_prefetch((const char*)t+2944,_MM_HINT_T0);h=_mm256_xor_si256(h,r3);t[108]=_mm256_xor_si256(h,l4);t[109]=_mm256_xor_si256(h,l5);_mm_prefetch((const char*)t+3008,_MM_HINT_T0);t[111]=_mm256_xor_si256(h,l7);t[110]=_mm256_xor_si256(h,l6);_mm_prefetch((const char*)t+2880,_MM_HINT_T0);t[106]=_mm256_xor_si256(h,l2);t[107]=_mm256_xor_si256(h,l3);_mm_prefetch((const char*)t+2816,_MM_HINT_T0);t[105]=_mm256_xor_si256(h,l1);t[104]=h;_mm_prefetch((const char*)t+2304,_MM_HINT_T0);h=_mm256_xor_si256(h,r4);t[120]=h;t[121]=_mm256_xor_si256(h,l1);_mm_prefetch((const char*)t+2368,_MM_HINT_T0);t[123]=_mm256_xor_si256(h,l3);t[122]=_mm256_xor_si256(h,l2);_mm_prefetch((const char*)t+2496,_MM_HINT_T0);t[126]=_mm256_xor_si256(h,l6);t[127]=_mm256_xor_si256(h,l7);_mm_prefetch((const char*)t+2432,_MM_HINT_T0);t[125]=_mm256_xor_si256(h,l5);t[124]=_mm256_xor_si256(h,l4);_mm_prefetch((const char*)t+2176,_MM_HINT_T0);h=_mm256_xor_si256(h,r3);t[116]=_mm256_xor_si256(h,l4);t[117]=_mm256_xor_si256(h,l5);_mm_prefetch((const char*)t+2240,_MM_HINT_T0);t[119]=_mm256_xor_si256(h,l7);t[118]=_mm256_xor_si256(h,l6);_mm_prefetch((const char*)t+2112,_MM_HINT_T0);t[114]=_mm256_xor_si256(h,l2);t[115]=_mm256_xor_si256(h,l3);_mm_prefetch((const char*)t+2048,_MM_HINT_T0);t[113]=_mm256_xor_si256(h,l1);t[112]=h;h=_mm256_xor_si256(h,r5);t[80]=h;t[81]=_mm256_xor_si256(h,l1);t[83]=_mm256_xor_si256(h,l3);t[82]=_mm256_xor_si256(h,l2);t[86]=_mm256_xor_si256(h,l6);t[87]=_mm256_xor_si256(h,l7);t[85]=_mm256_xor_si256(h,l5);t[84]=_mm256_xor_si256(h,l4);h=_mm256_xor_si256(h,r3);t[92]=_mm256_xor_si256(h,l4);t[93]=_mm256_xor_si256(h,l5);t[95]=_mm256_xor_si256(h,l7);t[94]=_mm256_xor_si256(h,l6);t[90]=_mm256_xor_si256(h,l2);t[91]=_mm256_xor_si256(h,l3);t[89]=_mm256_xor_si256(h,l1);t[88]=h;h=_mm256_xor_si256(h,r4);t[72]=h;t[73]=_mm256_xor_si256(h,l1);t[75]=_mm256_xor_si256(h,l3);t[74]=_mm256_xor_si256(h,l2);t[78]=_mm256_xor_si256(h,l6);t[79]=_mm256_xor_si256(h,l7);t[77]=_mm256_xor_si256(h,l5);t[76]=_mm256_xor_si256(h,l4);h=r6;t[68]=_mm256_xor_si256(h,l4);t[69]=_mm256_xor_si256(h,l5);t[71]=_mm256_xor_si256(h,l7);t[70]=_mm256_xor_si256(h,l6);t[66]=_mm256_xor_si256(h,l2);t[67]=_mm256_xor_si256(h,l3);t[65]=_mm256_xor_si256(h,l1);t[64]=h;}

#pragma GCC pop_options
__asm__(".text\n.p2align 15\n.rept 512\n nop\n.endr\n.globl b16_apply7f\n.type b16_apply7f,@function\nb16_apply7f:\npush %rbp\npush %r12\npush %r13\npush %r14\npush %r15\nmov %rdi,%rax\nlea 131072(%rdi),%rbp\nmovabs $0x1fe000001fe0,%r15\nmov 0(%rsi),%r8\nmov 4200(%rsi),%r9\nmov 8400(%rsi),%r10\nmov 12600(%rsi),%r11\nmov 16800(%rsi),%r12\nmov 21000(%rsi),%r13\nmov 25200(%rsi),%r14\n.p2align 5\n.Lb16_apply7f:\nvpxor %ymm0,%ymm0,%ymm0\nvpxor %ymm1,%ymm1,%ymm1\npdep %r15,%r8,%rcx\nvpxor b16_t7+0(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+0(%ecx),%ymm1,%ymm1\nshr $16,%r8\npdep %r15,%r9,%rcx\nvpxor b16_t7+4096(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+4096(%ecx),%ymm1,%ymm1\nshr $16,%r9\npdep %r15,%r10,%rcx\nvpxor b16_t7+8192(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+8192(%ecx),%ymm1,%ymm1\nshr $16,%r10\npdep %r15,%r11,%rcx\nvpxor b16_t7+12288(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+12288(%ecx),%ymm1,%ymm1\nshr $16,%r11\npdep %r15,%r12,%rcx\nvpxor b16_t7+16384(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+16384(%ecx),%ymm1,%ymm1\nshr $16,%r12\npdep %r15,%r13,%rcx\nvpxor b16_t7+20480(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+20480(%ecx),%ymm1,%ymm1\nshr $16,%r13\npdep %r15,%r14,%rcx\nvpxor b16_t7+24576(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+24576(%ecx),%ymm1,%ymm1\nshr $16,%r14\nvmovdqa %ymm0,0(%rax)\nvmovdqa %ymm1,32(%rax)\nvpxor %ymm0,%ymm0,%ymm0\nvpxor %ymm1,%ymm1,%ymm1\npdep %r15,%r8,%rcx\nvpxor b16_t7+0(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+0(%ecx),%ymm1,%ymm1\nshr $16,%r8\npdep %r15,%r9,%rcx\nvpxor b16_t7+4096(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+4096(%ecx),%ymm1,%ymm1\nshr $16,%r9\npdep %r15,%r10,%rcx\nvpxor b16_t7+8192(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+8192(%ecx),%ymm1,%ymm1\nshr $16,%r10\npdep %r15,%r11,%rcx\nvpxor b16_t7+12288(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+12288(%ecx),%ymm1,%ymm1\nshr $16,%r11\npdep %r15,%r12,%rcx\nvpxor b16_t7+16384(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+16384(%ecx),%ymm1,%ymm1\nshr $16,%r12\npdep %r15,%r13,%rcx\nvpxor b16_t7+20480(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+20480(%ecx),%ymm1,%ymm1\nshr $16,%r13\npdep %r15,%r14,%rcx\nvpxor b16_t7+24576(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+24576(%ecx),%ymm1,%ymm1\nshr $16,%r14\nvmovdqa %ymm0,64(%rax)\nvmovdqa %ymm1,96(%rax)\nvpxor %ymm0,%ymm0,%ymm0\nvpxor %ymm1,%ymm1,%ymm1\npdep %r15,%r8,%rcx\nvpxor b16_t7+0(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+0(%ecx),%ymm1,%ymm1\nshr $16,%r8\npdep %r15,%r9,%rcx\nvpxor b16_t7+4096(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+4096(%ecx),%ymm1,%ymm1\nshr $16,%r9\npdep %r15,%r10,%rcx\nvpxor b16_t7+8192(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+8192(%ecx),%ymm1,%ymm1\nshr $16,%r10\npdep %r15,%r11,%rcx\nvpxor b16_t7+12288(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+12288(%ecx),%ymm1,%ymm1\nshr $16,%r11\npdep %r15,%r12,%rcx\nvpxor b16_t7+16384(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+16384(%ecx),%ymm1,%ymm1\nshr $16,%r12\npdep %r15,%r13,%rcx\nvpxor b16_t7+20480(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+20480(%ecx),%ymm1,%ymm1\nshr $16,%r13\npdep %r15,%r14,%rcx\nvpxor b16_t7+24576(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+24576(%ecx),%ymm1,%ymm1\nshr $16,%r14\nvmovdqa %ymm0,128(%rax)\nvmovdqa %ymm1,160(%rax)\nvpxor %ymm0,%ymm0,%ymm0\nvpxor %ymm1,%ymm1,%ymm1\npdep %r15,%r8,%rcx\nvpxor b16_t7+0(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+0(%ecx),%ymm1,%ymm1\nmov 8(%rsi),%r8\npdep %r15,%r9,%rcx\nvpxor b16_t7+4096(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+4096(%ecx),%ymm1,%ymm1\nmov 4208(%rsi),%r9\npdep %r15,%r10,%rcx\nvpxor b16_t7+8192(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+8192(%ecx),%ymm1,%ymm1\nmov 8408(%rsi),%r10\npdep %r15,%r11,%rcx\nvpxor b16_t7+12288(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+12288(%ecx),%ymm1,%ymm1\nmov 12608(%rsi),%r11\npdep %r15,%r12,%rcx\nvpxor b16_t7+16384(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+16384(%ecx),%ymm1,%ymm1\nmov 16808(%rsi),%r12\npdep %r15,%r13,%rcx\nvpxor b16_t7+20480(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+20480(%ecx),%ymm1,%ymm1\nmov 21008(%rsi),%r13\npdep %r15,%r14,%rcx\nvpxor b16_t7+24576(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+24576(%ecx),%ymm1,%ymm1\nmov 25208(%rsi),%r14\nvmovdqa %ymm0,192(%rax)\nvmovdqa %ymm1,224(%rax)\nadd $8,%rsi\nadd $256,%rax\ncmp %rbp,%rax\njne .Lb16_apply7f\npop %r15\npop %r14\npop %r13\npop %r12\npop %rbp\nret\n.size b16_apply7f,.-b16_apply7f\n");
__asm__(".text\n.p2align 14\n.globl b16_apply7g\n.type b16_apply7g,@function\nb16_apply7g:\npush %rbp\npush %r12\npush %r13\npush %r14\npush %r15\nmov %rdi,%rax\nlea 131072(%rdi),%rbp\nmovabs $0x1fe000001fe0,%r15\nmov 0(%rsi),%r8\nmov 4200(%rsi),%r9\nmov 8400(%rsi),%r10\nmov 12600(%rsi),%r11\nmov 16800(%rsi),%r12\nmov 21000(%rsi),%r13\nmov 25200(%rsi),%r14\n.p2align 5\n.Lb16_apply7g:\nvmovdqa 0(%rax),%ymm0\nvmovdqa 32(%rax),%ymm1\npdep %r15,%r8,%rcx\nvpxor b16_t7+0(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+0(%ecx),%ymm1,%ymm1\nshr $16,%r8\npdep %r15,%r9,%rcx\nvpxor b16_t7+4096(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+4096(%ecx),%ymm1,%ymm1\nshr $16,%r9\npdep %r15,%r10,%rcx\nvpxor b16_t7+8192(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+8192(%ecx),%ymm1,%ymm1\nshr $16,%r10\npdep %r15,%r11,%rcx\nvpxor b16_t7+12288(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+12288(%ecx),%ymm1,%ymm1\nshr $16,%r11\npdep %r15,%r12,%rcx\nvpxor b16_t7+16384(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+16384(%ecx),%ymm1,%ymm1\nshr $16,%r12\npdep %r15,%r13,%rcx\nvpxor b16_t7+20480(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+20480(%ecx),%ymm1,%ymm1\nshr $16,%r13\npdep %r15,%r14,%rcx\nvpxor b16_t7+24576(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+24576(%ecx),%ymm1,%ymm1\nshr $16,%r14\nvmovdqa %ymm0,0(%rax)\nvmovdqa %ymm1,32(%rax)\nvmovdqa 64(%rax),%ymm0\nvmovdqa 96(%rax),%ymm1\npdep %r15,%r8,%rcx\nvpxor b16_t7+0(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+0(%ecx),%ymm1,%ymm1\nshr $16,%r8\npdep %r15,%r9,%rcx\nvpxor b16_t7+4096(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+4096(%ecx),%ymm1,%ymm1\nshr $16,%r9\npdep %r15,%r10,%rcx\nvpxor b16_t7+8192(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+8192(%ecx),%ymm1,%ymm1\nshr $16,%r10\npdep %r15,%r11,%rcx\nvpxor b16_t7+12288(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+12288(%ecx),%ymm1,%ymm1\nshr $16,%r11\npdep %r15,%r12,%rcx\nvpxor b16_t7+16384(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+16384(%ecx),%ymm1,%ymm1\nshr $16,%r12\npdep %r15,%r13,%rcx\nvpxor b16_t7+20480(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+20480(%ecx),%ymm1,%ymm1\nshr $16,%r13\npdep %r15,%r14,%rcx\nvpxor b16_t7+24576(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+24576(%ecx),%ymm1,%ymm1\nshr $16,%r14\nvmovdqa %ymm0,64(%rax)\nvmovdqa %ymm1,96(%rax)\nvmovdqa 128(%rax),%ymm0\nvmovdqa 160(%rax),%ymm1\npdep %r15,%r8,%rcx\nvpxor b16_t7+0(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+0(%ecx),%ymm1,%ymm1\nshr $16,%r8\npdep %r15,%r9,%rcx\nvpxor b16_t7+4096(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+4096(%ecx),%ymm1,%ymm1\nshr $16,%r9\npdep %r15,%r10,%rcx\nvpxor b16_t7+8192(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+8192(%ecx),%ymm1,%ymm1\nshr $16,%r10\npdep %r15,%r11,%rcx\nvpxor b16_t7+12288(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+12288(%ecx),%ymm1,%ymm1\nshr $16,%r11\npdep %r15,%r12,%rcx\nvpxor b16_t7+16384(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+16384(%ecx),%ymm1,%ymm1\nshr $16,%r12\npdep %r15,%r13,%rcx\nvpxor b16_t7+20480(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+20480(%ecx),%ymm1,%ymm1\nshr $16,%r13\npdep %r15,%r14,%rcx\nvpxor b16_t7+24576(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+24576(%ecx),%ymm1,%ymm1\nshr $16,%r14\nvmovdqa %ymm0,128(%rax)\nvmovdqa %ymm1,160(%rax)\nvmovdqa 192(%rax),%ymm0\nvmovdqa 224(%rax),%ymm1\npdep %r15,%r8,%rcx\nvpxor b16_t7+0(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+0(%ecx),%ymm1,%ymm1\nmov 8(%rsi),%r8\npdep %r15,%r9,%rcx\nvpxor b16_t7+4096(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+4096(%ecx),%ymm1,%ymm1\nmov 4208(%rsi),%r9\npdep %r15,%r10,%rcx\nvpxor b16_t7+8192(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+8192(%ecx),%ymm1,%ymm1\nmov 8408(%rsi),%r10\npdep %r15,%r11,%rcx\nvpxor b16_t7+12288(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+12288(%ecx),%ymm1,%ymm1\nmov 12608(%rsi),%r11\npdep %r15,%r12,%rcx\nvpxor b16_t7+16384(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+16384(%ecx),%ymm1,%ymm1\nmov 16808(%rsi),%r12\npdep %r15,%r13,%rcx\nvpxor b16_t7+20480(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+20480(%ecx),%ymm1,%ymm1\nmov 21008(%rsi),%r13\npdep %r15,%r14,%rcx\nvpxor b16_t7+24576(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+24576(%ecx),%ymm1,%ymm1\nmov 25208(%rsi),%r14\nvmovdqa %ymm0,192(%rax)\nvmovdqa %ymm1,224(%rax)\nvmovdqa 256(%rax),%ymm0\nvmovdqa 288(%rax),%ymm1\npdep %r15,%r8,%rcx\nvpxor b16_t7+0(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+0(%ecx),%ymm1,%ymm1\nshr $16,%r8\npdep %r15,%r9,%rcx\nvpxor b16_t7+4096(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+4096(%ecx),%ymm1,%ymm1\nshr $16,%r9\npdep %r15,%r10,%rcx\nvpxor b16_t7+8192(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+8192(%ecx),%ymm1,%ymm1\nshr $16,%r10\npdep %r15,%r11,%rcx\nvpxor b16_t7+12288(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+12288(%ecx),%ymm1,%ymm1\nshr $16,%r11\npdep %r15,%r12,%rcx\nvpxor b16_t7+16384(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+16384(%ecx),%ymm1,%ymm1\nshr $16,%r12\npdep %r15,%r13,%rcx\nvpxor b16_t7+20480(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+20480(%ecx),%ymm1,%ymm1\nshr $16,%r13\npdep %r15,%r14,%rcx\nvpxor b16_t7+24576(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+24576(%ecx),%ymm1,%ymm1\nshr $16,%r14\nvmovdqa %ymm0,256(%rax)\nvmovdqa %ymm1,288(%rax)\nvmovdqa 320(%rax),%ymm0\nvmovdqa 352(%rax),%ymm1\npdep %r15,%r8,%rcx\nvpxor b16_t7+0(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+0(%ecx),%ymm1,%ymm1\nshr $16,%r8\npdep %r15,%r9,%rcx\nvpxor b16_t7+4096(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+4096(%ecx),%ymm1,%ymm1\nshr $16,%r9\npdep %r15,%r10,%rcx\nvpxor b16_t7+8192(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+8192(%ecx),%ymm1,%ymm1\nshr $16,%r10\npdep %r15,%r11,%rcx\nvpxor b16_t7+12288(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+12288(%ecx),%ymm1,%ymm1\nshr $16,%r11\npdep %r15,%r12,%rcx\nvpxor b16_t7+16384(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+16384(%ecx),%ymm1,%ymm1\nshr $16,%r12\npdep %r15,%r13,%rcx\nvpxor b16_t7+20480(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+20480(%ecx),%ymm1,%ymm1\nshr $16,%r13\npdep %r15,%r14,%rcx\nvpxor b16_t7+24576(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+24576(%ecx),%ymm1,%ymm1\nshr $16,%r14\nvmovdqa %ymm0,320(%rax)\nvmovdqa %ymm1,352(%rax)\nvmovdqa 384(%rax),%ymm0\nvmovdqa 416(%rax),%ymm1\npdep %r15,%r8,%rcx\nvpxor b16_t7+0(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+0(%ecx),%ymm1,%ymm1\nshr $16,%r8\npdep %r15,%r9,%rcx\nvpxor b16_t7+4096(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+4096(%ecx),%ymm1,%ymm1\nshr $16,%r9\npdep %r15,%r10,%rcx\nvpxor b16_t7+8192(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+8192(%ecx),%ymm1,%ymm1\nshr $16,%r10\npdep %r15,%r11,%rcx\nvpxor b16_t7+12288(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+12288(%ecx),%ymm1,%ymm1\nshr $16,%r11\npdep %r15,%r12,%rcx\nvpxor b16_t7+16384(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+16384(%ecx),%ymm1,%ymm1\nshr $16,%r12\npdep %r15,%r13,%rcx\nvpxor b16_t7+20480(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+20480(%ecx),%ymm1,%ymm1\nshr $16,%r13\npdep %r15,%r14,%rcx\nvpxor b16_t7+24576(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+24576(%ecx),%ymm1,%ymm1\nshr $16,%r14\nvmovdqa %ymm0,384(%rax)\nvmovdqa %ymm1,416(%rax)\nvmovdqa 448(%rax),%ymm0\nvmovdqa 480(%rax),%ymm1\npdep %r15,%r8,%rcx\nvpxor b16_t7+0(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+0(%ecx),%ymm1,%ymm1\nmov 16(%rsi),%r8\npdep %r15,%r9,%rcx\nvpxor b16_t7+4096(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+4096(%ecx),%ymm1,%ymm1\nmov 4216(%rsi),%r9\npdep %r15,%r10,%rcx\nvpxor b16_t7+8192(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+8192(%ecx),%ymm1,%ymm1\nmov 8416(%rsi),%r10\npdep %r15,%r11,%rcx\nvpxor b16_t7+12288(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+12288(%ecx),%ymm1,%ymm1\nmov 12616(%rsi),%r11\npdep %r15,%r12,%rcx\nvpxor b16_t7+16384(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+16384(%ecx),%ymm1,%ymm1\nmov 16816(%rsi),%r12\npdep %r15,%r13,%rcx\nvpxor b16_t7+20480(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+20480(%ecx),%ymm1,%ymm1\nmov 21016(%rsi),%r13\npdep %r15,%r14,%rcx\nvpxor b16_t7+24576(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+24576(%ecx),%ymm1,%ymm1\nmov 25216(%rsi),%r14\nvmovdqa %ymm0,448(%rax)\nvmovdqa %ymm1,480(%rax)\nadd $16,%rsi\nadd $512,%rax\ncmp %rbp,%rax\njne .Lb16_apply7g\npop %r15\npop %r14\npop %r13\npop %r12\npop %rbp\nret\n.size b16_apply7g,.-b16_apply7g\n");
__asm__(".text\n.p2align 15\n.globl b16_apply5\nb16_apply5:\npush %r13\npush %r14\npush %r15\nmov %rdi,%rax\nlea 131072(%rdi),%rdi\nmov %rdx,%r9\nmovabs $0x1fe000001fe0,%r15\n.p2align 5\n.L5b:\nmov (%rsi),%r8\nmov 4200(%rsi),%r10\nmov 8400(%rsi),%r11\nmov 12600(%rsi),%r13\nmov 16800(%rsi),%r14\n.rept 4\nvmovdqa (%rax),%ymm0\nvmovdqa 32(%rax),%ymm1\npdep %r15,%r8,%rcx\nvpxor b16_t7(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7(%ecx),%ymm1,%ymm1\nshr $16,%r8\n\npdep %r15,%r10,%rcx\nvpxor b16_t7+4096(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+4096(%ecx),%ymm1,%ymm1\nshr $16,%r10\n\npdep %r15,%r11,%rcx\nvpxor b16_t7+8192(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+8192(%ecx),%ymm1,%ymm1\nshr $16,%r11\n\npdep %r15,%r13,%rcx\nvpxor b16_t7+12288(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+12288(%ecx),%ymm1,%ymm1\nshr $16,%r13\n\npdep %r15,%r14,%rcx\nvpxor b16_t7+16384(%ecx),%ymm0,%ymm0\nshr $32,%rcx\nvpxor b16_t7+16384(%ecx),%ymm1,%ymm1\nshr $16,%r14\n\nvmovntdq %ymm0,(%r9)\nvmovntdq %ymm1,32(%r9)\nadd $64,%rax\nadd $64,%r9\n.endr\nadd $8,%rsi\ncmp %rdi,%rax\njne .L5b\npop %r15\npop %r14\npop %r13\nret");
extern "C" void b16_apply7f(__m256i*,const unsigned char*);extern "C" void b16_apply7g(__m256i*,const unsigned char*);extern "C" void b16_apply5(__m256i*,const unsigned char*,uint64_t*);
namespace bit_winograd{
alignas(4096)static __m256i tables[7][128]__asm__("b16_t7");alignas(4096)static unsigned char accum_space[2*4096*32+8192];static __m256i*const accum[2]={(__m256i*)(accum_space+448),(__m256i*)(accum_space+448+4096*32+2048)};
static inline void tail5(__m256i*pc,const unsigned char*x,uint64_t*out){b16_apply5(pc,x,out);}
static void seven_stripe(const uint64_t*b,const unsigned char*x,__m256i*pc,uint64_t*out,int first,int stop){int g=first;for(;g<stop;g+=7){{const char*pf=(const char*)(b+(size_t)(g+1)*28);for(int q=0;q<13;q++)_mm_prefetch(pf+(size_t)128*q,_MM_HINT_T1);}for(int j=0;j<7;j++)build_gray7(b+(size_t)(g+j)*7*4,4,tables[j]);if(!g)b16_apply7f(pc,x);else b16_apply7g(pc,x+(size_t)g*4200);}for(int j=0;j<5;j++)build_gray7(b+(size_t)(g+j)*7*4,4,tables[j]);tail5(pc,x+(size_t)g*4200,out);}
static void leaf_indexed(const uint64_t*b,uint64_t*c,const unsigned char*x){for(int stripe=0;stripe<16;stripe++){size_t off=(size_t)stripe*4096*4;seven_stripe(b+off,x,accum[0],c+off,0,581);}}
#define Ql(p) _mm256_load_si256((const __m256i*)(p))
#define Qn(p,v) _mm256_stream_si256((__m256i*)(p),(v))
#define Qx _mm256_xor_si256
#define Qv __m256i
#define Qu uint64_t
#define Qb gfbuf
#define Qe emit_bool256
constexpr int GFH=4096,GFW=64;constexpr size_t GFZ=262144,GFP=268816;constexpr size_t GIBYTES=2486400,GIPAD=2486528,RPAD=2150528;static unsigned char*gfbase,*Lb;static Qu(*Qb)[GFP];static inline __m128i gfbool64(const bool*p){__m256i a=Ql(p),b=Ql(p+32);uint64_t v=(uint32_t)_mm256_movemask_epi8(_mm256_sub_epi8(_mm256_setzero_si256(),a))|((uint64_t)(uint32_t)_mm256_movemask_epi8(_mm256_sub_epi8(_mm256_setzero_si256(),b))<<32);return _mm_cvtsi64_si128(v);}static inline __m128i gfbool56(const bool*p,bool tail){uint64_t b;if(tail){uint64_t v;memcpy(&v,p,8);b=_pext_u64(v,0x0101010101010101ull);}else b=(uint64_t)_mm_cvtsi128_si64(gfbool64(p));return _mm_cvtsi64_si128(_pdep_u64(b,0x7f7f7f7f7f7f7f7full));}
static void gfindexbase(int n,const bool*a){unsigned char*sc=Lb;for(unsigned basis=0;basis<16;basis++){const bool*p=a+(size_t)(basis/4)*GFH*n+(basis%4)*GFH;unsigned char*out=gfbase+(size_t)basis*GIPAD;memset(out+GIBYTES,0,GIPAD-GIBYTES);constexpr size_t is=GFH+104;for(unsigned g=0;g<592;g++)memset(out+(size_t)g*is+GFH,0,104);for(int row=0;row<GFH;row+=8)for(int g=0;g<592;g+=8){const bool*x=p+(size_t)row*n+g*7;__m128i r0=gfbool56(x,g==584),r1=gfbool56(x+n,g==584),r2=gfbool56(x+2*n,g==584),r3=gfbool56(x+3*n,g==584),r4=gfbool56(x+4*n,g==584),r5=gfbool56(x+5*n,g==584),r6=gfbool56(x+6*n,g==584),r7=gfbool56(x+7*n,g==584);__m128i t0=_mm_unpacklo_epi8(r0,r1),t1=_mm_unpacklo_epi8(r2,r3),t2=_mm_unpacklo_epi8(r4,r5),t3=_mm_unpacklo_epi8(r6,r7);__m128i u0=_mm_unpacklo_epi16(t0,t1),u1=_mm_unpackhi_epi16(t0,t1),v0=_mm_unpacklo_epi16(t2,t3),v1=_mm_unpackhi_epi16(t2,t3);__m128i y01=_mm_unpacklo_epi32(u0,v0),y23=_mm_unpackhi_epi32(u0,v0),y45=_mm_unpacklo_epi32(u1,v1),y67=_mm_unpackhi_epi32(u1,v1);unsigned char*ti=sc+(((size_t)(row>>3))*74+((size_t)(g>>3)))*64;_mm_storel_epi64((__m128i*)(ti+0),y01);_mm_storeh_pd((double*)(ti+8),_mm_castsi128_pd(y01));_mm_storel_epi64((__m128i*)(ti+16),y23);_mm_storeh_pd((double*)(ti+24),_mm_castsi128_pd(y23));_mm_storel_epi64((__m128i*)(ti+32),y45);_mm_storeh_pd((double*)(ti+40),_mm_castsi128_pd(y45));_mm_storel_epi64((__m128i*)(ti+48),y67);_mm_storeh_pd((double*)(ti+56),_mm_castsi128_pd(y67));}for(int gb=0;gb<74;gb++)for(int j=0;j<64;j++){const unsigned char*s=sc+(size_t)(j*8)*4736+(size_t)gb*64;unsigned char*o=out+(size_t)(gb*8)*is+(size_t)j*64;for(int kh=0;kh<2;kh++){__m256i r0=_mm256_load_si256((const __m256i*)(s+0*4736+kh*32));__m256i r1=_mm256_load_si256((const __m256i*)(s+1*4736+kh*32));__m256i r2=_mm256_load_si256((const __m256i*)(s+2*4736+kh*32));__m256i r3=_mm256_load_si256((const __m256i*)(s+3*4736+kh*32));__m256i r4=_mm256_load_si256((const __m256i*)(s+4*4736+kh*32));__m256i r5=_mm256_load_si256((const __m256i*)(s+5*4736+kh*32));__m256i r6=_mm256_load_si256((const __m256i*)(s+6*4736+kh*32));__m256i r7=_mm256_load_si256((const __m256i*)(s+7*4736+kh*32));__m256i t0=_mm256_unpacklo_epi64(r0,r1),t1=_mm256_unpackhi_epi64(r0,r1);__m256i t2=_mm256_unpacklo_epi64(r2,r3),t3=_mm256_unpackhi_epi64(r2,r3);__m256i t4=_mm256_unpacklo_epi64(r4,r5),t5=_mm256_unpackhi_epi64(r4,r5);__m256i t6=_mm256_unpacklo_epi64(r6,r7),t7=_mm256_unpackhi_epi64(r6,r7);unsigned char*p0=o+(size_t)(4*kh+0)*is,*p1=o+(size_t)(4*kh+1)*is,*p2=o+(size_t)(4*kh+2)*is,*p3=o+(size_t)(4*kh+3)*is;_mm256_storeu_si256((__m256i*)(p0),_mm256_permute2x128_si256(t0,t2,0x20));_mm256_storeu_si256((__m256i*)(p0+32),_mm256_permute2x128_si256(t4,t6,0x20));_mm256_storeu_si256((__m256i*)(p1),_mm256_permute2x128_si256(t1,t3,0x20));_mm256_storeu_si256((__m256i*)(p1+32),_mm256_permute2x128_si256(t5,t7,0x20));_mm256_storeu_si256((__m256i*)(p2),_mm256_permute2x128_si256(t0,t2,0x31));_mm256_storeu_si256((__m256i*)(p2+32),_mm256_permute2x128_si256(t4,t6,0x31));_mm256_storeu_si256((__m256i*)(p3),_mm256_permute2x128_si256(t1,t3,0x31));_mm256_storeu_si256((__m256i*)(p3+32),_mm256_permute2x128_si256(t5,t7,0x31));}}}}static const unsigned char GPL[37]={10,21,17,2,0,3,11,16,14,18,12,44,35,1,43,31,23,26,27,7,39,33,20,25,28,36,45,9,40,4,32,13,38,6,19,24,34};static void gfencodeL(const unsigned char*base){__m256i*pp[37];for(int j=0;j<37;j++)pp[j]=(__m256i*)(Lb+(size_t)GPL[j]*GIPAD);__m256i stk[148];for(size_t off=0;off<GIPAD;off+=128){for(int g=0;g<4;g++){const unsigned char*o=base+off+32*g;Qv i0=Ql(o);Qv i1=Ql(o+1*GIPAD);Qv i2=Ql(o+2*GIPAD);Qv i3=Ql(o+3*GIPAD);Qv i4=Ql(o+4*GIPAD);Qv i5=Ql(o+5*GIPAD);Qv i6=Ql(o+6*GIPAD);Qv i7=Ql(o+7*GIPAD);Qv i8=Ql(o+8*GIPAD);Qv i9=Ql(o+9*GIPAD);Qv i10=Ql(o+10*GIPAD);Qv i11=Ql(o+11*GIPAD);Qv i12=Ql(o+12*GIPAD);Qv i13=Ql(o+13*GIPAD);Qv i14=Ql(o+14*GIPAD);Qv i15=Ql(o+15*GIPAD);Qv x10=Qx(i13,i15);Qv x11=Qx(i1,i5);Qv x12=Qx(i2,i6);Qv o10=Qx(Qx(i0,i4),i8);stk[g*37+0]=o10;Qv o21=Qx(i13,x11);stk[g*37+1]=o21;Qv o17=Qx(i14,x12);stk[g*37+2]=o17;Qv o2=Qx(i12,o10);stk[g*37+3]=o2;Qv o0=Qx(i10,o17);stk[g*37+4]=o0;Qv o3=Qx(i14,o10);stk[g*37+5]=o3;Qv o11=Qx(i8,o21);stk[g*37+6]=o11;Qv o16=Qx(i11,o21);stk[g*37+7]=o16;Qv o14=Qx(i8,o17);stk[g*37+8]=o14;Qv o18=Qx(i11,o17);stk[g*37+9]=o18;Qv o12=Qx(Qx(i14,i8),x11);stk[g*37+10]=o12;Qv o44=Qx(i4,o2);stk[g*37+11]=o44;Qv o35=Qx(i6,o0);stk[g*37+12]=o35;Qv o1=Qx(i9,o21);stk[g*37+13]=o1;Qv o43=Qx(i1,o12);stk[g*37+14]=o43;Qv o31=Qx(Qx(o3,i7),x12);stk[g*37+15]=o31;Qv o23=Qx(i5,o44);stk[g*37+16]=o23;Qv o26=Qx(i5,o35);stk[g*37+17]=o26;Qv o27=Qx(i2,o43);stk[g*37+18]=o27;Qv o7=Qx(x10,o1);stk[g*37+19]=o7;Qv o39=Qx(i2,o31);stk[g*37+20]=o39;Qv o33=Qx(i0,o31);stk[g*37+21]=o33;Qv o20=Qx(i3,o31);stk[g*37+22]=o20;Qv o25=Qx(x10,o23);stk[g*37+23]=o25;Qv o28=Qx(Qx(i9,i11),o26);stk[g*37+24]=o28;Qv o36=Qx(i1,o28);stk[g*37+25]=o36;Qv o45=Qx(i1,o25);stk[g*37+26]=o45;Qv o9=Qx(i15,o7);stk[g*37+27]=o9;Qv o40=Qx(i3,o36);stk[g*37+28]=o40;Qv o4=Qx(i14,o9);stk[g*37+29]=o4;Qv o32=Qx(i7,o44);stk[g*37+30]=o32;Qv o13=Qx(i0,o45);stk[g*37+31]=o13;Qv o38=Qx(i7,o35);stk[g*37+32]=o38;Qv o6=Qx(i15,o10);stk[g*37+33]=o6;Qv o19=Qx(i2,o36);stk[g*37+34]=o19;Qv o24=Qx(i0,o43);stk[g*37+35]=o24;Qv o34=Qx(i3,o45);stk[g*37+36]=o34;}for(int j=0;j<37;j++){Qn((unsigned char*)pp[j]+off+0,stk[0+j]);Qn((unsigned char*)pp[j]+off+32,stk[37+j]);Qn((unsigned char*)pp[j]+off+64,stk[74+j]);Qn((unsigned char*)pp[j]+off+96,stk[111+j]);}}}
static inline void pkrow(const bool*p,Qu*d){for(int i=0;i<256;i++){Qv x=Ql(p+64*i),y=Ql(p+64*i+32);d[i]=(unsigned)_mm256_movemask_epi8(_mm256_sub_epi8(_mm256_setzero_si256(),x))|((Qu)(unsigned)_mm256_movemask_epi8(_mm256_sub_epi8(_mm256_setzero_si256(),y))<<32);}}static const unsigned char RQ[47]={80,72,86,49,47,61,70,54,50,85,88,60,66,48,90,78,58,51,55,63,64,57,76,68,56,83,92,75,62,73,53,91,65,79,82,69,52,59,67,71,74,77,81,84,87,89,93};static void gfencodeR(const bool*a){alignas(32)Qu w[16][4][GFW*4];__m256i*pp[47];for(int j=0;j<47;j++)pp[j]=(__m256i*)((unsigned char*)Qb[RQ[j]]);__m256i stk[94];for(int u=0;u<GFH;u+=16){for(int r=0;r<16;r++)for(int kr=0;kr<4;kr++)pkrow(a+(size_t)(u+r+kr*GFH)*16384,w[r][kr]);for(int v=0;v<GFW;v+=4){for(int uu=u;uu<u+16;uu+=2){for(int h=0;h<2;h++){const int vv=v;Qv i0=Ql(w[uu-u+h][0]+0*GFW+vv);Qv i1=Ql(w[uu-u+h][0]+1*GFW+vv);Qv i2=Ql(w[uu-u+h][0]+2*GFW+vv);Qv i3=Ql(w[uu-u+h][0]+3*GFW+vv);Qv i4=Ql(w[uu-u+h][1]+0*GFW+vv);Qv i5=Ql(w[uu-u+h][1]+1*GFW+vv);Qv i6=Ql(w[uu-u+h][1]+2*GFW+vv);Qv i7=Ql(w[uu-u+h][1]+3*GFW+vv);Qv i8=Ql(w[uu-u+h][2]+0*GFW+vv);Qv i9=Ql(w[uu-u+h][2]+1*GFW+vv);Qv i10=Ql(w[uu-u+h][2]+2*GFW+vv);Qv i11=Ql(w[uu-u+h][2]+3*GFW+vv);Qv i12=Ql(w[uu-u+h][3]+0*GFW+vv);Qv i13=Ql(w[uu-u+h][3]+1*GFW+vv);Qv i14=Ql(w[uu-u+h][3]+2*GFW+vv);Qv i15=Ql(w[uu-u+h][3]+3*GFW+vv);Qv y10=Qx(i6,i14);Qv y11=Qx(i7,i4);Qv y12=Qx(i11,i8);Qv o33=Qx(Qx(i3,i0),i1);stk[h*47+0]=o33;Qv o25=Qx(i6,y11);stk[h*47+1]=o25;Qv o39=Qx(i10,y12);stk[h*47+2]=o39;Qv o2=Qx(i2,o33);stk[h*47+3]=o2;Qv o0=Qx(i9,o39);stk[h*47+4]=o0;Qv o14=Qx(i10,o33);stk[h*47+5]=o14;Qv o23=Qx(i1,o25);stk[h*47+6]=o23;Qv o7=Qx(i13,o25);stk[h*47+7]=o7;Qv o3=Qx(i1,o39);stk[h*47+8]=o3;Qv o38=Qx(i13,o39);stk[h*47+9]=o38;Qv o41=Qx(Qx(i10,i1),y11);stk[h*47+10]=o41;Qv o13=Qx(i0,o2);stk[h*47+11]=o13;Qv o19=Qx(i8,o0);stk[h*47+12]=o19;Qv o1=Qx(i5,o25);stk[h*47+13]=o1;Qv o43=Qx(i7,o41);stk[h*47+14]=o43;Qv o31=Qx(Qx(o14,i12),y12);stk[h*47+15]=o31;Qv o11=Qx(i4,o13);stk[h*47+16]=o11;Qv o4=Qx(i4,o19);stk[h*47+17]=o4;Qv o8=Qx(i11,o43);stk[h*47+18]=o8;Qv o16=Qx(y10,o1);stk[h*47+19]=o16;Qv o17=Qx(i11,o31);stk[h*47+20]=o17;Qv o10=Qx(i3,o31);stk[h*47+21]=o10;Qv o29=Qx(i15,o31);stk[h*47+22]=o29;Qv o21=Qx(y10,o11);stk[h*47+23]=o21;Qv o9=Qx(Qx(i5,i13),o4);stk[h*47+24]=o9;Qv o36=Qx(i7,o9);stk[h*47+25]=o36;Qv o45=Qx(i7,o21);stk[h*47+26]=o45;Qv o28=Qx(i14,o16);stk[h*47+27]=o28;Qv o15=Qx(i15,o36);stk[h*47+28]=o15;Qv o26=Qx(i10,o28);stk[h*47+29]=o26;Qv o6=Qx(i12,o13);stk[h*47+30]=o6;Qv o44=Qx(i3,o45);stk[h*47+31]=o44;Qv o18=Qx(i12,o19);stk[h*47+32]=o18;Qv o32=Qx(i14,o33);stk[h*47+33]=o32;Qv o35=Qx(i11,o36);stk[h*47+34]=o35;Qv o22=Qx(i3,o43);stk[h*47+35]=o22;Qv o5=Qx(i15,o45);stk[h*47+36]=o5;Qv o12=i4;stk[h*47+37]=o12;Qv o20=i12;stk[h*47+38]=o20;Qv o24=i1;stk[h*47+39]=o24;Qv o27=i10;stk[h*47+40]=o27;Qv o30=i15;stk[h*47+41]=o30;Qv o34=i14;stk[h*47+42]=o34;Qv o37=i11;stk[h*47+43]=o37;Qv o40=i13;stk[h*47+44]=o40;Qv o42=i7;stk[h*47+45]=o42;Qv o46=i3;stk[h*47+46]=o46;}for(int j=0;j<47;j++){unsigned char*d=(unsigned char*)pp[j]+((size_t)(v/4)*GFH+uu)*32;Qn(d,stk[j]);Qn(d+32,stk[47+j]);}}}}}
static inline Qv dmload(const Qu*p){Qv v;asm volatile("vmovdqa %1,%0":"=x"(v):"m"(*(const Qv*)p));return v;}
static inline Qv dmxor(Qv v,const Qu*p){asm volatile("vpxor %1,%0,%0":"+x"(v):"m"(*(const Qv*)p));return v;}
static __attribute__((noinline))void gfdecode_stage(Qv stage[2][16][16],int u){for(int blk=0;blk<16;blk++){
#pragma GCC unroll 47
for(int q=47;q<94;q++)_mm_prefetch((const char*)(Qb[q]+(size_t)blk*GFH*4+(u+2)*4),_MM_HINT_T1);for(int h=0;h<2;h++){int uu=u+h;

#define I(k) (Qb[47+(k)]+(size_t)blk*GFH*4+uu*4)
Qv z18=dmxor(dmload(I(24)),I(25));Qv z19=dmxor(dmload(I(12)),I(13));Qv z16=dmxor(dmload(I(43)),I(46));Qv z12=dmxor(dmxor(z16,I(42)),I(45));Qv o2=Qx(Qx(Qx(dmxor(dmload(I(27)),I(34)),z18),z19),z12);stage[h][blk][2]=o2;Qv z27=dmxor(dmload(I(22)),I(21));Qv z23=dmxor(dmload(I(41)),I(44));Qv z15=Qx(Qx(z27,z23),z12);Qv o15=Qx(dmxor(dmload(I(8)),I(5)),z15);stage[h][blk][15]=o15;Qv z20=dmxor(z19,I(11));Qv z21=dmxor(z18,I(23));Qv o14=Qx(Qx(z15,z20),z21);stage[h][blk][14]=o14;Qv z24=dmxor(dmload(I(33)),I(27));Qv o6=dmxor(dmxor(dmxor(dmxor(Qx(z24,z23),I(14)),I(2)),I(23)),I(32));stage[h][blk][6]=o6;Qv z11=dmxor(dmload(I(9)),I(8));Qv o13=Qx(Qx(dmxor(dmxor(dmload(I(1)),I(4)),I(7)),z21),z11);stage[h][blk][13]=o13;Qv z33=dmxor(dmload(I(22)),I(17));Qv z34=dmxor(dmxor(z16,I(31)),I(37));Qv z10=dmxor(dmload(I(10)),I(8));Qv o7=dmxor(dmxor(Qx(Qx(z33,z34),z10),I(29)),I(41));stage[h][blk][7]=o7;Qv z22=dmxor(z10,I(3));Qv o12=Qx(Qx(dmxor(dmload(I(2)),I(6)),z20),z22);stage[h][blk][12]=o12;Qv z17=dmxor(z33,I(14));Qv z13=dmxor(dmload(I(24)),I(39));Qv z14=Qx(Qx(z34,z24),z13);Qv o4=Qx(Qx(z17,z14),z22);stage[h][blk][4]=o4;Qv o0=dmxor(dmxor(z14,I(20)),I(12));stage[h][blk][0]=o0;Qv z35=dmxor(dmload(I(35)),I(41));Qv o5=Qx(Qx(dmxor(dmxor(dmxor(dmload(I(0)),I(26)),I(3)),I(38)),z13),z35);stage[h][blk][5]=o5;Qv z25=dmxor(dmload(I(37)),I(42));Qv o3=Qx(dmxor(dmload(I(30)),I(46)),z25);stage[h][blk][3]=o3;Qv z29=dmxor(dmxor(z25,I(36)),I(43));Qv z32=Qx(Qx(z35,z11),z29);Qv o11=Qx(dmxor(dmload(I(15)),I(22)),z32);stage[h][blk][11]=o11;Qv z26=dmxor(dmload(I(12)),I(19));Qv z28=dmxor(dmload(I(27)),I(28));Qv o1=Qx(Qx(Qx(dmxor(dmload(I(24)),I(40)),z26),z28),z29);stage[h][blk][1]=o1;Qv z31=dmxor(z28,I(26));Qv o10=Qx(dmxor(dmxor(dmxor(z27,I(1)),I(11)),I(16)),z31);stage[h][blk][10]=o10;Qv z30=dmxor(z26,I(4));Qv o9=Qx(Qx(z30,z31),z32);stage[h][blk][9]=o9;Qv o8=Qx(Qx(dmxor(dmload(I(0)),I(18)),z30),z17);stage[h][blk][8]=o8;
#undef I
}}}
struct RowPlan{unsigned short slot[16384];unsigned count;constexpr RowPlan():slot{},count(0){for(unsigned r=0;r<16384;r++){size_t a=r*16384ull,e=a+16384,L=63*GIPAD,H=L+47*RPAD;if(a<L)a=L;if(e>H)e=H;int need=-1;while(a<e){size_t q=(a-L)%RPAD,b=e<a+RPAD-q?e:a+RPAD-q,t=b-a;if(q>=2097152)t=0;else if(t>2097152-q)t=2097152-q;if(t){int k=q/131072!=(q+t-1)/131072?4095:((q+t-1)%131072)/32;if(k>need)need=k;}a=b;}slot[r]=(r<507||need>int((r%4096)|1))?count++:65535;}}};static constexpr RowPlan rp{};static_assert(rp.count==4054&&rp.count*2048<=507*16384,"packed extent");
static void gfdecode(bool*c,int n){Qu*packed=(Qu*)c;for(int u=0;u<GFH;u+=2){alignas(32)Qv stage[2][16][16];gfdecode_stage(stage,u);asm volatile(""::"m"(stage):"memory");for(int h=0;h<2;h++)for(unsigned z=0;z<16;z++){int row=u+h+(z/4)*GFH;unsigned slot=rp.slot[row];for(int blk=0;blk<16;blk++){if(slot!=65535)Qn(packed+(size_t)slot*(n/64)+(z%4)*(GFH/64)+blk*4,stage[h][blk][z]);else Qe(c+(size_t)row*n+(z%4)*GFH+blk*256,&stage[h][blk][z]);}}}_mm_sfence();for(int row=n;row-->0;){unsigned slot=rp.slot[row];if(slot==65535)continue;for(int b=n/256;b-->0;){alignas(32)Qv v=Ql(packed+(size_t)slot*(n/64)+b*4);Qe(c+(size_t)row*n+b*256,&v);}}}
}extern "C" int madvise(void*,size_t,int)noexcept;void matrix_multiply(int n,const bool*a,const bool*b,bool*c){if(n!=16384)abort();using namespace bit_winograd;uintptr_t lo=(uintptr_t)c&~uintptr_t(4095),hi=((uintptr_t)c+(size_t)n*n+4095)&~uintptr_t(4095);if(hi>lo)(void)madvise((void*)lo,hi-lo,14);gfbase=(unsigned char*)c;Lb=gfbase+16*GIPAD;Qb=(Qu(*)[GFP])(gfbase+63*GIPAD-47*RPAD);if(63*GIPAD+47*RPAD>(size_t)n*n||GFP*sizeof(Qu)!=RPAD)abort();gfindexbase(n,a);gfencodeL(gfbase);_mm_sfence();gfencodeR(b);_mm_sfence();static const unsigned char alias[47]={127,127,127,127,127,15,127,127,14,127,127,127,127,127,127,11,127,127,127,127,127,127,8,127,127,127,127,127,127,7,3,127,127,127,127,127,127,2,127,127,127,5,1,127,127,127,0};for(int k=0;k<47;k++){const unsigned char*x=alias[k]<16?gfbase+(size_t)alias[k]*GIPAD:Lb+(size_t)k*GIPAD;leaf_indexed(Qb[47+k],Qb[47+k],x);}_mm_sfence();gfdecode(c,n);_mm_sfence();}

CompilationN/AN/ACompile OKScore: N/A

Testcase #1549.951 ms256 MB + 304 KBAcceptedScore: 100


Judge Duck Online | 评测鸭在线
Server Time: 2026-11-23 12:28:12 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠