URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=fa1962681e8e39e3299c2249bbaea3743e218f78
Author: Alyssa Rosenzweig <[email protected]>
Date:   Fri May 12 10:56:07 2023 -0400

    nir/validate: Handle unified atomics
    
    nir_validate checks that the format of an atomic (if specified) is 
compatible
    with the atomic operation. For example, we can't fadd R64_UINT texels. The 
logic
    can't be extended as-is to unified atomics because it's split across 
different
    switch cases for different atomic-op intrinsics. So we add our own 
validation
    case, porting over the logic from the separate existing cases below.
    
    (The redundant logic will be deleted once we delete legacy atomics.)
    
    Signed-off-by: Alyssa Rosenzweig <[email protected]>
    Reviewed-by: Jesse Natalie <[email protected]>
    Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22914>

URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=55f7fd6d0d36e560b55fc12c4baf785f9d0c04ed
Author: Alyssa Rosenzweig <[email protected]>
Date:   Fri May 12 10:55:28 2023 -0400

    nir/opt_uniform_atomics: Handle unified atomics
    
    This is the one place where using nir_atomic_op instead of nir_op directly 
is a
    little annoying, since we need to translate between the two enums, but it's 
not
    a big deal.
    
    Signed-off-by: Alyssa Rosenzweig <[email protected]>
    Reviewed-by: Jesse Natalie <[email protected]>
    Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22914>

URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=b1fd8d27fc516d475808b5e2e826fc7a3124ad5a
Author: Alyssa Rosenzweig <[email protected]>
Date:   Fri May 12 10:54:05 2023 -0400

    nir/lower_ssbo: Handle unified atomics
    
    Signed-off-by: Alyssa Rosenzweig <[email protected]>
    Reviewed-by: Jesse Natalie <[email protected]>
    Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22914>

URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=66f1633ffd5a7a6603c6ab13d79d829f4a64e791
Author: Alyssa Rosenzweig <[email protected]>
Date:   Fri May 12 10:53:41 2023 -0400

    nir/lower_io: Handle unified atomics
    
    Signed-off-by: Alyssa Rosenzweig <[email protected]>
    Reviewed-by: Jesse Natalie <[email protected]>
    Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22914>

URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=1609b413032f22e89723041c0f68836d75587091
Author: Alyssa Rosenzweig <[email protected]>
Date:   Fri May 12 13:16:18 2023 -0400

    nir/lower_task_shader: Handle unified atomics
    
    Signed-off-by: Alyssa Rosenzweig <[email protected]>
    Reviewed-by: Jesse Natalie <[email protected]>
    Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22914>

URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=ca5c869b6d664d56f585b939a6819e2e76d485ac
Author: Jesse Natalie <[email protected]>
Date:   Fri May 12 09:13:37 2023 -0700

    nir: Load/store atomic op indices when lowering image intrinsics
    
    They might not be stored in the same const index after lowering
    
    Reviewed-by: Alyssa Rosenzweig <[email protected]>
    Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22914>

URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=97857731ce875c846cca37059864f08ff47358a5
Author: Alyssa Rosenzweig <[email protected]>
Date:   Fri May 12 10:52:57 2023 -0400

    nir: Handle unified atomics in simple cases
    
    Lots of passes can be made unified-atomics-aware simply by adding extra 
cases in
    their switch statements. This commit fixes a bunch of passes.
    
    Signed-off-by: Alyssa Rosenzweig <[email protected]>
    Reviewed-by: Jesse Natalie <[email protected]>
    Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22914>

URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=ee6ddce6361d761909d36a9cb2a4d851c6f6fb52
Author: Alyssa Rosenzweig <[email protected]>
Date:   Thu May 11 09:58:39 2023 -0400

    ir3: Use unified atomics
    
    Signed-off-by: Alyssa Rosenzweig <[email protected]>
    Reviewed-by: Jesse Natalie <[email protected]>
    Reviewed-by: Rob Clark <[email protected]>
    Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22914>

URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=6ff97776b77b3eb8446fd274913d808c146d1d9d
Author: Karol Herbst <[email protected]>
Date:   Tue May 9 18:15:37 2023 +0200

    nv50/ir: Use unified atomics
    
    Reviewed-by: Alyssa Rosenzweig <[email protected]>
    Reviewed-by: Jesse Natalie <[email protected]>
    Reviewed-by: M Henning <[email protected]>
    Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22914>

URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=b98b7f4d8510800871e28c0b682093addbce55c0
Author: Alyssa Rosenzweig <[email protected]>
Date:   Tue May 9 09:02:00 2023 -0400

    zink: Use unified atomics
    
    Signed-off-by: Alyssa Rosenzweig <[email protected]>
    Reviewed-by: Jesse Natalie <[email protected]>
    Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22914>

URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=ce638eafe26090c37056556fc10e938b442990fe
Author: Alyssa Rosenzweig <[email protected]>
Date:   Wed May 10 19:16:28 2023 -0400

    aco,radv: Use unified atomics
    
    Signed-off-by: Alyssa Rosenzweig <[email protected]>
    Reviewed-by: Jesse Natalie <[email protected]>
    Reviewed-by: Timur Kristóf <[email protected]>
    Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22914>

URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=0241d8894e20d758e7197c29b3cfa0b523267393
Author: Alyssa Rosenzweig <[email protected]>
Date:   Mon May 8 20:40:22 2023 -0400

    ac/llvm: Use unified atomics
    
    Signed-off-by: Alyssa Rosenzweig <[email protected]>
    Reviewed-by: Marek Olšák <[email protected]>
    Reviewed-by: Jesse Natalie <[email protected]>
    Reviewed-by: Timur Kristóf <[email protected]>
    Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22914>

URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=1e9c01523ad5ddfc9e185b8d6057c9c56d3aa809
Author: Alyssa Rosenzweig <[email protected]>
Date:   Mon May 8 20:42:20 2023 -0400

    ac/llvm: Don't handle atomic derefs
    
    Should not be seen, already would be stubbed out.
    
    Signed-off-by: Alyssa Rosenzweig <[email protected]>
    Suggested-by: Marek Olšák <[email protected]>
    Reviewed-by: Jesse Natalie <[email protected]>
    Reviewed-by: Timur Kristóf <[email protected]>
    Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22914>

URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=d0d2292ac0727acf29650717146e0ae82927828c
Author: Alyssa Rosenzweig <[email protected]>
Date:   Mon May 8 20:12:20 2023 -0400

    ntt: Use unified atomics
    
    Nice deduplication of the NIR->TGSI enum translation.
    
    Signed-off-by: Alyssa Rosenzweig <[email protected]>
    Reviewed-by: Jesse Natalie <[email protected]>
    Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22914>

URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=bd0a2b160848fc9810362eba9768fcf79845315f
Author: Alyssa Rosenzweig <[email protected]>
Date:   Mon May 8 19:38:16 2023 -0400

    gallivm: Use unified atomics
    
    This is a huge win because gallivm duplicated the translations in a zillion
    places.
    
    Signed-off-by: Alyssa Rosenzweig <[email protected]>
    Reviewed-by: Jesse Natalie <[email protected]>
    Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22914>

URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=3c823351c0f3fdca664c4e2b436912acf5d33b72
Author: Alyssa Rosenzweig <[email protected]>
Date:   Mon May 8 18:14:14 2023 -0400

    pan/mdg: Use unified atomics
    
    This doesn't actually save anything, since Italo already introduced magic 
macros
    for this, but it ticks off one more driver on the list to convert. It's also
    more legible, so that's nice :-)
    
    Signed-off-by: Alyssa Rosenzweig <[email protected]>
    Reviewed-by: Jesse Natalie <[email protected]>
    Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22914>

URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=133af0d6c945d3aaca8989edd15283a2b7dcc6c7
Author: Alyssa Rosenzweig <[email protected]>
Date:   Mon May 8 16:05:25 2023 -0400

    pan/mdg: Fix icky formatting
    
    clang-format butchered this initializer pretty badly.
    
    Signed-off-by: Alyssa Rosenzweig <[email protected]>
    Reviewed-by: Jesse Natalie <[email protected]>
    Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22914>

URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=e258083e0728396313310b2f2cabe4ae346579d9
Author: Alyssa Rosenzweig <[email protected]>
Date:   Mon May 8 16:04:37 2023 -0400

    pan/bi: Use unified atomics
    
    Signed-off-by: Alyssa Rosenzweig <[email protected]>
    Reviewed-by: Jesse Natalie <[email protected]>
    Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22914>

URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=f5d73a9989e657ef27ef69af4f89aacd404422ec
Author: Alyssa Rosenzweig <[email protected]>
Date:   Mon May 8 15:26:28 2023 -0400

    agx: Use unified atomics
    
    Signed-off-by: Alyssa Rosenzweig <[email protected]>
    Reviewed-by: Jesse Natalie <[email protected]>
    Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22914>

URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=5c9950702880bf68dc87019e410de38739759262
Author: Alyssa Rosenzweig <[email protected]>
Date:   Mon May 8 15:30:06 2023 -0400

    nir: Add pass to lower atomics to unified
    
    In the future, we'd like to have all drivers only ingest unified atomics, 
and
    all frontends only produce unified atomics, and garbage collect the existing
    non-unified atomics. To get to that future, it's a lot nicer to convert 
drivers
    one-by-one. Add a pass to translate old-style atomics to new-style atomics 
so
    drivers can opt-in to the new form one-by-one. Once all drivers are 
converted,
    we can convert producers one-by-one. Finally, we can just drop the calls to 
the
    pass and garbage collect this pass and the old atomics. That's probably a 
while
    out, though, so this will be out bridge to get there.
    
    Signed-off-by: Alyssa Rosenzweig <[email protected]>
    Reviewed-by: Jesse Natalie <[email protected]>
    Reviewed-by: Timur Kristóf <[email protected]>
    Reviewed-by: Rob Clark <[email protected]>
    Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22914>

URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=d51bc95837620a774f6d2b04228f340dfc536fc6
Author: Alyssa Rosenzweig <[email protected]>
Date:   Mon May 8 15:29:31 2023 -0400

    nir: Add unified atomics
    
    Currently, we have an atomic intrinsic for each combination of memory type
    (global, shared, image, etc) and atomic operation (add, sub, etc). So for m
    types of memory supported by the driver and n atomic opcodes, the driver 
has to
    handle O(mn) intrinsics. This makes a total mess in every single backend 
I've
    looked at, without fail.
    
    It would be a lot nicer to unify the intrinsics. There are two obvious ways:
    
    1. Make the memory type a constant index, keep different intrinsics for
       different operations. The problem with this is that different memory 
types
       imply different intrinsic signatures (number of sources, etc).  As an
       example, it doesn't make sense to unify global_atomic_amd with
       global_atomic_2x32, as an example. The first takes 3 scalar sources, the
       second takes 1 vector and 1 scalar. Also, in any single backend, there 
are a
       lot more operations than there are memory types.
    
    2. Make the opcode a constant index, keep different intrinsics for different
       operations. This works well, with one exception: compswap and fcompswap
       take an extra argument that other atomics don't, so there's an extra 
axis of
       variation for the intrinsic signatures.
    
    So, the solution is to have 2 intrinsics for each memory type -- for atomics
    taking 1 argument and atomics taking 2 respectively. Both of these 
intrinsics
    take an nir_atomic_op enum to describe its operation. We don't use a nir_op 
for
    this purpose, as there are some atomics (cmpxchg, inc_wrap, etc) that don't
    cleanly map to any ALU op and it would be weird to force it.
    
    The plan is to transition to these new opcodes gradually. This series adds a
    lowering pass producing these opcodes from the existing opcodes, so that
    backends can opt-in to the new forms one-by-one. Then we can convert 
backends
    separately without any cross-tree flag day. Once everything is converted, 
we can
    convert the producers and core NIR as a flag day, but we have far fewer
    producers than backends so this should be fine. Finally we can drop the old
    stuff.
    
    Signed-off-by: Alyssa Rosenzweig <[email protected]>
    Reviewed-by: Jesse Natalie <[email protected]>
    Reviewed-by: Timur Kristóf <[email protected]>
    Reviewed-by: Rob Clark <[email protected]>
    Reviewed-by: Faith Ekstrand <[email protected]>
    Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22914>

Reply via email to