llvmpipe: use aligned loads/stores for plane values
authorKeith Whitwell <keithw@vmware.com>
Fri, 15 Oct 2010 12:52:00 +0000 (13:52 +0100)
committerKeith Whitwell <keithw@vmware.com>
Fri, 15 Oct 2010 12:52:00 +0000 (13:52 +0100)
src/gallium/drivers/llvmpipe/lp_rast_tri.c
src/gallium/drivers/llvmpipe/lp_setup_tri.c

index 659eb1cac3ab74d0ffd099ac4235effd6643cf9c..042c315635e2749c2c9274b44a873188f3b6dd59 100644 (file)
@@ -261,9 +261,9 @@ lp_rast_triangle_3_16(struct lp_rasterizer_task *task,
    struct { unsigned mask:16; unsigned i:8; unsigned j:8; } out[16];
    unsigned nr = 0;
 
-   __m128i p0 = _mm_loadu_si128((__m128i *)&plane[0]); /* c, dcdx, dcdy, eo */
-   __m128i p1 = _mm_loadu_si128((__m128i *)&plane[1]); /* c, dcdx, dcdy, eo */
-   __m128i p2 = _mm_loadu_si128((__m128i *)&plane[2]); /* c, dcdx, dcdy, eo */
+   __m128i p0 = _mm_load_si128((__m128i *)&plane[0]); /* c, dcdx, dcdy, eo */
+   __m128i p1 = _mm_load_si128((__m128i *)&plane[1]); /* c, dcdx, dcdy, eo */
+   __m128i p2 = _mm_load_si128((__m128i *)&plane[2]); /* c, dcdx, dcdy, eo */
    __m128i zero = _mm_setzero_si128();
 
    __m128i c;
@@ -367,9 +367,9 @@ lp_rast_triangle_3_4(struct lp_rasterizer_task *task,
    int x = (arg.triangle.plane_mask & 0xff) + task->x;
    int y = (arg.triangle.plane_mask >> 8) + task->y;
 
-   __m128i p0 = _mm_loadu_si128((__m128i *)&plane[0]); /* c, dcdx, dcdy, eo */
-   __m128i p1 = _mm_loadu_si128((__m128i *)&plane[1]); /* c, dcdx, dcdy, eo */
-   __m128i p2 = _mm_loadu_si128((__m128i *)&plane[2]); /* c, dcdx, dcdy, eo */
+   __m128i p0 = _mm_load_si128((__m128i *)&plane[0]); /* c, dcdx, dcdy, eo */
+   __m128i p1 = _mm_load_si128((__m128i *)&plane[1]); /* c, dcdx, dcdy, eo */
+   __m128i p2 = _mm_load_si128((__m128i *)&plane[2]); /* c, dcdx, dcdy, eo */
    __m128i zero = _mm_setzero_si128();
 
    __m128i c;
index 49ded9e0452745462c4067fbd6551e8beb7995b7..c6cb9afda47a5356b4ab941a2c918443bd569ab5 100644 (file)
@@ -382,9 +382,9 @@ do_triangle_ccw(struct lp_setup_context *setup,
       transpose4_epi32(&c, &dcdx, &dcdy, &eo,
                        &p0, &p1, &p2, &unused);
 
-      _mm_storeu_si128((__m128i *)&plane[0], p0);
-      _mm_storeu_si128((__m128i *)&plane[1], p1);
-      _mm_storeu_si128((__m128i *)&plane[2], p2);
+      _mm_store_si128((__m128i *)&plane[0], p0);
+      _mm_store_si128((__m128i *)&plane[1], p1);
+      _mm_store_si128((__m128i *)&plane[2], p2);
    }
 #else
    {