util: crib SWAP macro from freedreno

we have a bunch of copies across the tree, unify them.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36257>
This commit is contained in:
Alyssa Rosenzweig
2025-07-15 16:43:50 -04:00
committed by Marge Bot
parent 7ce8369985
commit ecfca8ec6f
5 changed files with 14 additions and 38 deletions
@@ -50,6 +50,7 @@
#include "brw_shader.h"
#include "brw_cfg.h"
#include "util/macros.h"
#ifdef __SSE2__
@@ -256,15 +257,6 @@ namespace {
#endif
/**
* Swap \p x and \p y.
*/
#define SWAP(x, y) do { \
__typeof(y) _swap_tmp = y; \
y = x; \
x = _swap_tmp; \
} while (0)
namespace {
/**
* Variable-length vector type intended to represent cycle-count costs for
@@ -50,6 +50,7 @@
#include "elk_fs.h"
#include "elk_cfg.h"
#include "util/macros.h"
#ifdef __SSE2__
@@ -256,15 +257,6 @@ namespace {
#endif
/**
* Swap \p x and \p y.
*/
#define SWAP(x, y) do { \
__typeof(y) _swap_tmp = y; \
y = x; \
x = _swap_tmp; \
} while (0)
namespace {
/**
* Variable-length vector type intended to represent cycle-count costs for