Mesa (main): llvmpipe: use c11 alignas instead of PIPE_ALIGN_VAR

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jun 14 15:50:07 UTC 2022


Module: Mesa
Branch: main
Commit: 69d2d38f6eae83b3fac0591340c8f64f04267381
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=69d2d38f6eae83b3fac0591340c8f64f04267381

Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date:   Wed Jun  8 11:00:54 2022 +0200

llvmpipe: use c11 alignas instead of PIPE_ALIGN_VAR

Reviewed-by: Jesse Natalie <jenatali at microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16908>

---

 src/gallium/drivers/llvmpipe/lp_linear.c          | 2 +-
 src/gallium/drivers/llvmpipe/lp_linear_priv.h     | 6 +++---
 src/gallium/drivers/llvmpipe/lp_memory.c          | 2 +-
 src/gallium/drivers/llvmpipe/lp_memory.h          | 2 +-
 src/gallium/drivers/llvmpipe/lp_setup_analysis.c  | 8 ++++----
 src/gallium/drivers/llvmpipe/lp_setup_tri.c       | 8 ++++----
 src/gallium/drivers/llvmpipe/lp_state_fs_linear.c | 6 +++---
 src/gallium/drivers/llvmpipe/lp_test_conv.c       | 4 ++--
 src/gallium/drivers/llvmpipe/lp_test_format.c     | 6 +++---
 9 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_linear.c b/src/gallium/drivers/llvmpipe/lp_linear.c
index 9777061ff8e..41970d287ea 100644
--- a/src/gallium/drivers/llvmpipe/lp_linear.c
+++ b/src/gallium/drivers/llvmpipe/lp_linear.c
@@ -232,7 +232,7 @@ check_linear_interp_mask_a(struct lp_fragment_shader_variant *variant)
    struct lp_linear_sampler samp[LP_MAX_LINEAR_TEXTURES];
    struct lp_linear_interp interp[LP_MAX_LINEAR_INPUTS];
    uint8_t constants[LP_MAX_LINEAR_CONSTANTS][4];
-   PIPE_ALIGN_VAR(16) uint8_t color0[TILE_SIZE*4];
+   alignas(16) uint8_t color0[TILE_SIZE*4];
 
    int nr_inputs = info->base.file_max[TGSI_FILE_INPUT]+1;
    int nr_tex = info->num_texs;
diff --git a/src/gallium/drivers/llvmpipe/lp_linear_priv.h b/src/gallium/drivers/llvmpipe/lp_linear_priv.h
index 6ae1f77aeb9..6d4d6de79ae 100644
--- a/src/gallium/drivers/llvmpipe/lp_linear_priv.h
+++ b/src/gallium/drivers/llvmpipe/lp_linear_priv.h
@@ -29,8 +29,8 @@ struct lp_linear_sampler {
    int width;
    boolean axis_aligned;
 
-   PIPE_ALIGN_VAR(16) uint32_t row[64];
-   PIPE_ALIGN_VAR(16) uint32_t stretched_row[2][64];
+   alignas(16) uint32_t row[64];
+   alignas(16) uint32_t stretched_row[2][64];
 
    /**
     * y coordinate of the rows stored in the stretched_row.
@@ -60,7 +60,7 @@ struct lp_linear_interp {
 
    int width;                   /* rounded up to multiple of 4 */
 
-   PIPE_ALIGN_VAR(16) uint32_t row[64];
+   alignas(16) uint32_t row[64];
 };
 
 
diff --git a/src/gallium/drivers/llvmpipe/lp_memory.c b/src/gallium/drivers/llvmpipe/lp_memory.c
index 712e28ea3f8..bba786802b0 100644
--- a/src/gallium/drivers/llvmpipe/lp_memory.c
+++ b/src/gallium/drivers/llvmpipe/lp_memory.c
@@ -31,6 +31,6 @@
 
 /* A single dummy tile used in a couple of out-of-memory situations. 
  */
-PIPE_ALIGN_VAR(LP_MIN_VECTOR_ALIGN)
+alignas(LP_MIN_VECTOR_ALIGN)
 uint8_t lp_dummy_tile[TILE_SIZE * TILE_SIZE * 4];
 
diff --git a/src/gallium/drivers/llvmpipe/lp_memory.h b/src/gallium/drivers/llvmpipe/lp_memory.h
index 0acd4e6b8ef..aee3c39ef76 100644
--- a/src/gallium/drivers/llvmpipe/lp_memory.h
+++ b/src/gallium/drivers/llvmpipe/lp_memory.h
@@ -34,7 +34,7 @@
 #include "lp_limits.h"
 #include "gallivm/lp_bld_type.h"
 
-extern PIPE_ALIGN_VAR(LP_MIN_VECTOR_ALIGN)
+extern alignas(LP_MIN_VECTOR_ALIGN)
 uint8_t lp_dummy_tile[TILE_SIZE * TILE_SIZE * 4];
 
 #endif /* LP_MEMORY_H */
diff --git a/src/gallium/drivers/llvmpipe/lp_setup_analysis.c b/src/gallium/drivers/llvmpipe/lp_setup_analysis.c
index 68457e96d42..f1a1cf98fb9 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup_analysis.c
+++ b/src/gallium/drivers/llvmpipe/lp_setup_analysis.c
@@ -239,10 +239,10 @@ check_elts24(struct lp_setup_context *setup, const void *vb, int stride)
     * commands for this triangle list directly.  Instead, introduce
     * some new vertices and feed to the rectangle setup code:
     */
-   PIPE_ALIGN_VAR(16) float vA[2][4];
-   PIPE_ALIGN_VAR(16) float vB[2][4];
-   PIPE_ALIGN_VAR(16) float vC[2][4];
-   PIPE_ALIGN_VAR(16) float vD[2][4];
+   alignas(16) float vA[2][4];
+   alignas(16) float vB[2][4];
+   alignas(16) float vC[2][4];
+   alignas(16) float vD[2][4];
 
    float as, bs;
    float at, bt;
diff --git a/src/gallium/drivers/llvmpipe/lp_setup_tri.c b/src/gallium/drivers/llvmpipe/lp_setup_tri.c
index 89ff598f179..c9ca7e1430a 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup_tri.c
+++ b/src/gallium/drivers/llvmpipe/lp_setup_tri.c
@@ -585,7 +585,7 @@ do_triangle_ccw(struct lp_setup_context *setup,
       __m128i eo, p0, p1, p2;
       __m128i_union vshuf_mask;
       __m128i zero = vec_splats((unsigned char) 0);
-      PIPE_ALIGN_VAR(16) int32_t temp_vec[4];
+      alignas(16) int32_t temp_vec[4];
 
 #if UTIL_ARCH_LITTLE_ENDIAN
       vshuf_mask.i[0] = 0x07060504;
@@ -1155,7 +1155,7 @@ static void triangle_cw(struct lp_setup_context *setup,
                         const float (*v1)[4],
                         const float (*v2)[4])
 {
-   PIPE_ALIGN_VAR(16) struct fixed_position position;
+   alignas(16) struct fixed_position position;
    struct llvmpipe_context *lp_context = (struct llvmpipe_context *)setup->pipe;
 
    if (lp_context->active_statistics_queries) {
@@ -1181,7 +1181,7 @@ static void triangle_ccw(struct lp_setup_context *setup,
                          const float (*v1)[4],
                          const float (*v2)[4])
 {
-   PIPE_ALIGN_VAR(16) struct fixed_position position;
+   alignas(16) struct fixed_position position;
    struct llvmpipe_context *lp_context = (struct llvmpipe_context *)setup->pipe;
 
    if (lp_context->active_statistics_queries) {
@@ -1202,7 +1202,7 @@ static void triangle_both(struct lp_setup_context *setup,
                           const float (*v1)[4],
                           const float (*v2)[4])
 {
-   PIPE_ALIGN_VAR(16) struct fixed_position position;
+   alignas(16) struct fixed_position position;
    struct llvmpipe_context *lp_context = (struct llvmpipe_context *)setup->pipe;
 
    if (lp_context->active_statistics_queries) {
diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs_linear.c b/src/gallium/drivers/llvmpipe/lp_state_fs_linear.c
index fb710701b16..1310448bab6 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_fs_linear.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_fs_linear.c
@@ -47,7 +47,7 @@
 
 
 struct nearest_sampler {
-   PIPE_ALIGN_VAR(16) uint32_t out[64];
+   alignas(16) uint32_t out[64];
 
    const struct lp_jit_texture *texture;
    float fsrc_x;                /* src_x0 */
@@ -64,7 +64,7 @@ struct nearest_sampler {
 
 
 struct linear_interp {
-   PIPE_ALIGN_VAR(16) uint32_t out[64];
+   alignas(16) uint32_t out[64];
    __m128i a0;
    __m128i dadx;
    __m128i dady;
@@ -88,7 +88,7 @@ struct color_blend {
  * in one place.
  */
 struct shader {
-   PIPE_ALIGN_VAR(16) uint32_t out0[64];
+   alignas(16) uint32_t out0[64];
    const uint32_t *src0;
    const uint32_t *src1;
    __m128i const0;
diff --git a/src/gallium/drivers/llvmpipe/lp_test_conv.c b/src/gallium/drivers/llvmpipe/lp_test_conv.c
index 43e051fbeeb..d040ea3f978 100644
--- a/src/gallium/drivers/llvmpipe/lp_test_conv.c
+++ b/src/gallium/drivers/llvmpipe/lp_test_conv.c
@@ -235,8 +235,8 @@ test_one(unsigned verbose,
    for(i = 0; i < n && success; ++i) {
       unsigned src_stride = src_type.length*src_type.width/8;
       unsigned dst_stride = dst_type.length*dst_type.width/8;
-      PIPE_ALIGN_VAR(LP_MIN_VECTOR_ALIGN) uint8_t src[LP_MAX_VECTOR_LENGTH*LP_MAX_VECTOR_LENGTH];
-      PIPE_ALIGN_VAR(LP_MIN_VECTOR_ALIGN) uint8_t dst[LP_MAX_VECTOR_LENGTH*LP_MAX_VECTOR_LENGTH];
+      alignas(LP_MIN_VECTOR_ALIGN) uint8_t src[LP_MAX_VECTOR_LENGTH*LP_MAX_VECTOR_LENGTH];
+      alignas(LP_MIN_VECTOR_ALIGN) uint8_t dst[LP_MAX_VECTOR_LENGTH*LP_MAX_VECTOR_LENGTH];
       double fref[LP_MAX_VECTOR_LENGTH*LP_MAX_VECTOR_LENGTH];
       uint8_t ref[LP_MAX_VECTOR_LENGTH*LP_MAX_VECTOR_LENGTH];
       int64_t start_counter = 0;
diff --git a/src/gallium/drivers/llvmpipe/lp_test_format.c b/src/gallium/drivers/llvmpipe/lp_test_format.c
index 38b3c48b294..f8013fe2d25 100644
--- a/src/gallium/drivers/llvmpipe/lp_test_format.c
+++ b/src/gallium/drivers/llvmpipe/lp_test_format.c
@@ -143,8 +143,8 @@ test_format_float(unsigned verbose, FILE *fp,
    struct gallivm_state *gallivm;
    LLVMValueRef fetch = NULL;
    fetch_ptr_t fetch_ptr;
-   PIPE_ALIGN_VAR(16) uint8_t packed[UTIL_FORMAT_MAX_PACKED_BYTES];
-   PIPE_ALIGN_VAR(16) float unpacked[4];
+   alignas(16) uint8_t packed[UTIL_FORMAT_MAX_PACKED_BYTES];
+   alignas(16) float unpacked[4];
    boolean first = TRUE;
    boolean success = TRUE;
    unsigned i, j, k, l;
@@ -244,7 +244,7 @@ test_format_unorm8(unsigned verbose, FILE *fp,
    struct gallivm_state *gallivm;
    LLVMValueRef fetch = NULL;
    fetch_ptr_t fetch_ptr;
-   PIPE_ALIGN_VAR(16) uint8_t packed[UTIL_FORMAT_MAX_PACKED_BYTES];
+   alignas(16) uint8_t packed[UTIL_FORMAT_MAX_PACKED_BYTES];
    uint8_t unpacked[4];
    boolean first = TRUE;
    boolean success = TRUE;



More information about the mesa-commit mailing list