Commit graph

181669 commits

Author SHA1 Message Date
Yonggang Luo
adf81143a1 clover: Rename function align to align_vector to avoid conflict with global align
align is a global function, do not conflict with it

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25997>
2023-12-07 02:30:53 +00:00
Yonggang Luo
0f5688eb2c intel: Remove unused ALIGN macro
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25997>
2023-12-07 02:30:53 +00:00
Yonggang Luo
ff306c5f8c meson/win32: There is no need install OpenGL headers on win32
The libraries that use OpenGL already handling the non-exist of OpenGL headers for both
MSVC and MINGW, so there is no need install them

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14019>
2023-12-07 00:58:25 +00:00
Faith Ekstrand
112900075b nak: Add barriers on Volta
The warp barriers go back to SM70, not SM75.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Faith Ekstrand
186baba000 nak: Clean up compiler warnings
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Benjamin Lee
ad89613dc4 nak: implement VOTE on SM50
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Benjamin Lee
8fd7ee2a4f nak: implement SHFL on SM50
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Benjamin Lee
2d63f3dad6 nak: encode Dst::None as RZ on SM50
This case came up when testing VOTE, but likely occurs elsewhere.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Benjamin Lee
ebfd651361 nak: implement IMUL for SM50
IMAD64 does not exist on SM50, so we're using IMUL instead for
nir_op_{i,u}mul_high and nir_op{i,u}mul_2x32_64. Longer-term we may want
to replace this with XMAD for better perf.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Benjamin Lee
00be041ffc nak: implement SHL and SHR on SM50
SHF.{L,R} is supported, but it seems to always write 0 to dst when the
shift value is a register. The only case in nak_from_nir that actually
uses the 64-bit shift is nir_op_isign, which has an immediate shift
value.

This also avoids the SHF.I32 issue, since the only usage is now SHF.I64.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Benjamin Lee
286b832f74 nak: make as_imm_not_{i,f}20 helper methods public
These are useful for SM50 legalize, which is in a different module.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Mary Guillemard
cb3263560f nak: sm50: Implement FFMA
Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Faith Ekstrand
f02b2866bc nak/sm50: Drop src_mod_has* in favor of core helpers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Daniel Almeida
89f727b1bd nak/sm50: remove *fmod* calls from iabs
I see no mention of NOT and ABS in codegen's encoding for I2I

Also, this is an integer instruction, so calling into the float
helpers seem wrong.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Daniel Almeida
546edfde83 nak/sm50: remove ALUSrc and friends
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Daniel Almeida
592d8fa436 nak: sm50: remove encode_alu() and friends
This method was too complex. Remove it as we have now rewritten all other
methods not to rely on it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Daniel Almeida
f32c560e82 nak: sm50: rewrite encode_prmt to not use encode_alu()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Daniel Almeida
63c85c9cf7 nak: sm50: rewrite encode_popc to not use encode_alu()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Daniel Almeida
78efdf9755 nak: convert encode_imad to not use encode_alu()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Daniel Almeida
04d4f1b512 nak: sm50: rewrite encode_f2f to not use encode_alu()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Daniel Almeida
cb9318b8ef nak: sm50: convert i2f to not use encode_alu()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Daniel Almeida
bfb091e227 nak: sm50: convert sel to not use encode_alu()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Daniel Almeida
2adf5a3437 nak: sm50: rewrite iabs to not use encode_alu
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Daniel Almeida
9f34a3c61d nak: sm50: rewrite fset to not use encode_alu
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Daniel Almeida
3ab0cea646 nak: sm50: rewrite fmul to not use encode_alu
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Daniel Almeida
b7bc6cebaa nak: sm50: Rewrite fmnmx to not use encode_alu
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Daniel Almeida
01c7f16755 nak: sm50: rewrite fsetp to not use encode_alu
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Benjamin Lee
4b8a8b2a28 nak: use carry register file for IADD2
This allows detecting dependencies between IADD.X and IADD.CC, which is
necessary for SM50 sched and DCE.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Benjamin Lee
9d6c487a75 nak: move iadd64 construction to a builder method
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Benjamin Lee
6323cae9f9 nak: add carry register file
There is only one carry-register, so representing it as a register file
is a little weird, but it makes calculating instruction deps simpler.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Faith Ekstrand
1ae43d2606 nak/sm50: Stop using ALUSrc for IADD2
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Faith Ekstrand
998c470f58 nak/sm50: Add better helpers for encoding sources with modifiers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Daniel Almeida
43160df14e nak/sm50: rewrite encode_iadd2 to not use encode_alu()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Faith Ekstrand
e5d70d303f nak: Drop the SM50 encoding of BREV
We should add an OpBfe instead of this mess.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Faith Ekstrand
a1af8129a6 nak/sm50: Rewrite the encoding for OpMov
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Faith Ekstrand
0adb7c52f8 nak: Implement FS input interpolation on SM50
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Faith Ekstrand
bdf0c300e1 nak/sm50: Rewrite the encoding for OpIMnMx
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Faith Ekstrand
20176035f6 nak: Rewrite the SM50 encoding of OpF2I
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Faith Ekstrand
426b27ef04 nak/sm50: Wire up tex ops
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Faith Ekstrand
bb41f2815f nak/nv50: Rewrite the encoding of OpShf
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Faith Ekstrand
08ac17789b nak: Rework nvfuzz for SM50
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Faith Ekstrand
899c58606d nak: Only split texture destinations on Volta+
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Faith Ekstrand
c57bf36c0a nak: Add SM50 encodings for ALD and AST
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Benjamin Lee
08cab9a57e nak: add ATOM{G,S} encoding for SM50
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:36 +00:00
Benjamin Lee
cd7ac4b0c5 nak: implement ST* and LD* on SM50
LDG was previously encoded, but the opcode and field offsets were incorrect.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:35 +00:00
Benjamin Lee
8a82f426a2 nak: add IADD instruction for SM50
For now, we're just using this in place of IAdd3x for 64-bit adds. IADD3
with carry flags is supported on SM50, but it works completely
differently from SM75. Longer-term we'll probably want to emit this in
all of the places that we're currently using IADD3.

Also need to hook the carry register up to calc_deps, but for now I'm
just using NAK_DEBUG=serial.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:35 +00:00
Benjamin Lee
588cfcaec7 nak: Legalize a bunch of instructions for SM50
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:35 +00:00
Faith Ekstrand
bbd2de34c5 nak: Rework the SM50 encoding of isetp
Drop the ALU stuff and hand-encode it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:35 +00:00
Faith Ekstrand
e404877a02 nak: Use OpLop2 and OpPSetP pre-SM70
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:35 +00:00
Faith Ekstrand
36e80caac9 nak: Rename LogicOp to LogicOp3
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26114>
2023-12-07 00:36:35 +00:00