summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/mesa/Android.gen.mk17
-rw-r--r--src/mesa/Android.mesa_gen_matypes.mk47
-rw-r--r--src/mesa/Android.mk1
-rw-r--r--src/mesa/SConscript17
-rw-r--r--src/mesa/math/m_matrix.c5
-rw-r--r--src/mesa/math/m_vector.c7
-rw-r--r--src/mesa/math/m_vector.h11
-rw-r--r--src/mesa/math/m_vector_asm.h57
-rw-r--r--src/mesa/meson.build17
-rw-r--r--src/mesa/x86-64/xform4.S3
-rw-r--r--src/mesa/x86/3dnow_xform1.S3
-rw-r--r--src/mesa/x86/3dnow_xform2.S3
-rw-r--r--src/mesa/x86/3dnow_xform3.S3
-rw-r--r--src/mesa/x86/3dnow_xform4.S3
-rw-r--r--src/mesa/x86/common_x86_asm.S1
-rw-r--r--src/mesa/x86/gen_matypes.c146
-rw-r--r--src/mesa/x86/mmx_blend.S3
-rw-r--r--src/mesa/x86/sse_normal.S3
-rw-r--r--src/mesa/x86/sse_xform1.S3
-rw-r--r--src/mesa/x86/sse_xform2.S3
-rw-r--r--src/mesa/x86/sse_xform3.S3
-rw-r--r--src/mesa/x86/sse_xform4.S3
-rw-r--r--src/mesa/x86/x86_cliptest.S3
-rw-r--r--src/mesa/x86/x86_xform2.S3
-rw-r--r--src/mesa/x86/x86_xform3.S3
-rw-r--r--src/mesa/x86/x86_xform4.S3
26 files changed, 101 insertions, 270 deletions
diff --git a/src/mesa/Android.gen.mk b/src/mesa/Android.gen.mk
index ee2d1dec2c7..ff4f5e4e4d8 100644
--- a/src/mesa/Android.gen.mk
+++ b/src/mesa/Android.gen.mk
@@ -47,13 +47,6 @@ LOCAL_SRC_FILES := $(filter-out $(sources), $(LOCAL_SRC_FILES))
LOCAL_C_INCLUDES += $(intermediates)/main
-ifeq ($(strip $(MESA_ENABLE_ASM)),true)
-ifeq ($(TARGET_ARCH),x86)
-sources += x86/matypes.h
-LOCAL_C_INCLUDES += $(intermediates)/x86
-endif
-endif
-
sources := $(addprefix $(intermediates)/, $(sources))
LOCAL_GENERATED_SOURCES += $(sources)
@@ -70,16 +63,6 @@ define es-gen
$(hide) $(PRIVATE_SCRIPT) $(1) $(PRIVATE_XML) > $@
endef
-matypes_deps := \
- $(BUILD_OUT_EXECUTABLES)/mesa_gen_matypes$(BUILD_EXECUTABLE_SUFFIX) \
- $(LOCAL_PATH)/main/mtypes.h \
- $(LOCAL_PATH)/tnl/t_context.h
-
-$(intermediates)/x86/matypes.h: $(matypes_deps)
- @mkdir -p $(dir $@)
- @echo "MATYPES: $(PRIVATE_MODULE) <= $(notdir $@)"
- $(hide) $< > $@
-
$(intermediates)/main/dispatch.h: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(glapi)/gl_table.py
$(intermediates)/main/dispatch.h: PRIVATE_XML := -f $(glapi)/gl_and_es_API.xml
diff --git a/src/mesa/Android.mesa_gen_matypes.mk b/src/mesa/Android.mesa_gen_matypes.mk
deleted file mode 100644
index 4fcf73a631d..00000000000
--- a/src/mesa/Android.mesa_gen_matypes.mk
+++ /dev/null
@@ -1,47 +0,0 @@
-# Copyright 2012 Intel Corporation
-# Copyright (C) 2010-2011 Chia-I Wu <[email protected]>
-# Copyright (C) 2010-2011 LunarG Inc.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the "Software"),
-# to deal in the Software without restriction, including without limitation
-# the rights to use, copy, modify, merge, publish, distribute, sublicense,
-# and/or sell copies of the Software, and to permit persons to whom the
-# Software is furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included
-# in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-# DEALINGS IN THE SOFTWARE.
-
-# ---------------------------------------------------------------------
-# host executable: mesa_gen_matypes
-# ---------------------------------------------------------------------
-
-ifeq ($(strip $(MESA_ENABLE_ASM)),true)
-ifeq ($(TARGET_ARCH),x86)
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := mesa_gen_matypes
-LOCAL_IS_HOST_MODULE := true
-
-LOCAL_C_INCLUDES := \
- $(MESA_TOP)/src/mapi
-
-LOCAL_SRC_FILES := \
- x86/gen_matypes.c
-
-include $(MESA_COMMON_MK)
-include $(BUILD_HOST_EXECUTABLE)
-
-endif # x86
-endif # MESA_ENABLE_ASM
diff --git a/src/mesa/Android.mk b/src/mesa/Android.mk
index e89de82f4ed..a740c2d2220 100644
--- a/src/mesa/Android.mk
+++ b/src/mesa/Android.mk
@@ -20,7 +20,6 @@
LOCAL_PATH := $(call my-dir)
-include $(LOCAL_PATH)/Android.mesa_gen_matypes.mk
include $(LOCAL_PATH)/Android.libmesa_glsl_utils.mk
include $(LOCAL_PATH)/Android.libmesa_dricore.mk
include $(LOCAL_PATH)/Android.libmesa_st_mesa.mk
diff --git a/src/mesa/SConscript b/src/mesa/SConscript
index eaf23fbae18..da003743f59 100644
--- a/src/mesa/SConscript
+++ b/src/mesa/SConscript
@@ -103,23 +103,6 @@ if env['platform'] not in ('cygwin', 'darwin', 'windows', 'haiku'):
else:
pass
- # Generate matypes.h
- if env['machine'] in ('x86', 'x86_64'):
- # See http://www.scons.org/wiki/UsingCodeGenerators
- gen_matypes = env.Program(
- target = 'gen_matypes',
- source = 'x86/gen_matypes.c',
- )
- matypes = env.Command(
- 'matypes.h',
- gen_matypes,
- gen_matypes[0].abspath + ' > $TARGET',
- )
- # Add the dir containing the generated header (somewhere inside the
- # build dir) to the include path
- env.Prepend(CPPPATH = [matypes[0].dir])
-
-
# The marshal_generated.c file is generated from the GL/ES API.xml file
env.CodeGenerate(
target = 'main/marshal_generated.c',
diff --git a/src/mesa/math/m_matrix.c b/src/mesa/math/m_matrix.c
index 57a49533de2..6f91dbd1915 100644
--- a/src/mesa/math/m_matrix.c
+++ b/src/mesa/math/m_matrix.c
@@ -39,6 +39,8 @@
#include "main/glheader.h"
#include "main/imports.h"
#include "main/macros.h"
+#define MATH_ASM_PTR_SIZE sizeof(void *)
+#include "math/m_vector_asm.h"
#include "m_matrix.h"
@@ -1137,6 +1139,9 @@ _math_matrix_viewport(GLmatrix *m, const float scale[3],
void
_math_matrix_set_identity( GLmatrix *mat )
{
+ STATIC_ASSERT(MATRIX_M == offsetof(GLmatrix, m));
+ STATIC_ASSERT(MATRIX_INV == offsetof(GLmatrix, inv));
+
memcpy( mat->m, Identity, sizeof(Identity) );
memcpy( mat->inv, Identity, sizeof(Identity) );
diff --git a/src/mesa/math/m_vector.c b/src/mesa/math/m_vector.c
index 831f953d655..0f7c52a4ff1 100644
--- a/src/mesa/math/m_vector.c
+++ b/src/mesa/math/m_vector.c
@@ -79,6 +79,13 @@ static const GLubyte size_bits[5] = {
void
_mesa_vector4f_init( GLvector4f *v, GLbitfield flags, GLfloat (*storage)[4] )
{
+ STATIC_ASSERT(V4F_DATA == offsetof(GLvector4f, data));
+ STATIC_ASSERT(V4F_START == offsetof(GLvector4f, start));
+ STATIC_ASSERT(V4F_COUNT == offsetof(GLvector4f, count));
+ STATIC_ASSERT(V4F_STRIDE == offsetof(GLvector4f, stride));
+ STATIC_ASSERT(V4F_SIZE == offsetof(GLvector4f, size));
+ STATIC_ASSERT(V4F_FLAGS == offsetof(GLvector4f, flags));
+
v->stride = 4 * sizeof(GLfloat);
v->size = 2; /* may change: 2-4 for vertices and 1-4 for texcoords */
v->data = storage;
diff --git a/src/mesa/math/m_vector.h b/src/mesa/math/m_vector.h
index 5bd76b8987d..2065324556b 100644
--- a/src/mesa/math/m_vector.h
+++ b/src/mesa/math/m_vector.h
@@ -31,21 +31,14 @@
#define _M_VECTOR_H_
#include "main/glheader.h"
+#define MATH_ASM_PTR_SIZE sizeof(void *)
+#include "math/m_vector_asm.h"
-
-#define VEC_DIRTY_0 0x1
-#define VEC_DIRTY_1 0x2
-#define VEC_DIRTY_2 0x4
-#define VEC_DIRTY_3 0x8
#define VEC_MALLOC 0x10 /* storage field points to self-allocated mem*/
#define VEC_NOT_WRITEABLE 0x40 /* writable elements to hold clipped data */
#define VEC_BAD_STRIDE 0x100 /* matches tnl's prefered stride */
-#define VEC_SIZE_1 VEC_DIRTY_0
-#define VEC_SIZE_2 (VEC_DIRTY_0|VEC_DIRTY_1)
-#define VEC_SIZE_3 (VEC_DIRTY_0|VEC_DIRTY_1|VEC_DIRTY_2)
-#define VEC_SIZE_4 (VEC_DIRTY_0|VEC_DIRTY_1|VEC_DIRTY_2|VEC_DIRTY_3)
diff --git a/src/mesa/math/m_vector_asm.h b/src/mesa/math/m_vector_asm.h
new file mode 100644
index 00000000000..60cf1ec8fd1
--- /dev/null
+++ b/src/mesa/math/m_vector_asm.h
@@ -0,0 +1,57 @@
+/*
+ * Copyright © 2019 Google LLC
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#ifndef _M_VECTOR_ASM_H_
+#define _M_VECTOR_ASM_H_
+
+/* This file is a set of defines usable by the old FF TNL assembly code for
+ * referencing GLvector4f and GLmatrix structs.
+ */
+
+#define VEC_DIRTY_0 0x1
+#define VEC_DIRTY_1 0x2
+#define VEC_DIRTY_2 0x4
+#define VEC_DIRTY_3 0x8
+
+#define VEC_SIZE_1 VEC_DIRTY_0
+#define VEC_SIZE_2 (VEC_DIRTY_0|VEC_DIRTY_1)
+#define VEC_SIZE_3 (VEC_DIRTY_0|VEC_DIRTY_1|VEC_DIRTY_2)
+#define VEC_SIZE_4 (VEC_DIRTY_0|VEC_DIRTY_1|VEC_DIRTY_2|VEC_DIRTY_3)
+
+/* If you add a new field, please add it to the STATIC_ASSERTs in
+ * _mesa_vector4f_init().
+ */
+#define V4F_DATA 0
+#define V4F_START (V4F_DATA + MATH_ASM_PTR_SIZE)
+#define V4F_COUNT (V4F_START + MATH_ASM_PTR_SIZE)
+#define V4F_STRIDE (V4F_COUNT + 4)
+#define V4F_SIZE (V4F_STRIDE + 4)
+#define V4F_FLAGS (V4F_SIZE + 4)
+
+/* If you add a new field, please add it to the STATIC_ASSERTs in
+ * _math_matrix_set_identity().
+ */
+#define MATRIX_M 0
+#define MATRIX_INV (MATRIX_M + MATH_ASM_PTR_SIZE)
+
+#endif /* _M_VECTOR_ASM_H */
diff --git a/src/mesa/meson.build b/src/mesa/meson.build
index 2d9b673fbe7..baf5c6b11c1 100644
--- a/src/mesa/meson.build
+++ b/src/mesa/meson.build
@@ -605,22 +605,6 @@ files_libmesa_gallium = files(
'state_tracker/st_vdpau.h',
)
-matypes_h = []
-if with_asm_arch == 'x86' or with_asm_arch == 'x86_64'
- gen_matypes = executable(
- 'gen_matypes',
- 'x86/gen_matypes.c',
- c_args : [c_vis_args, c_msvc_compat_args],
- include_directories : inc_common,
- )
- matypes_h = custom_target(
- 'matypes.h',
- output : 'matypes.h',
- command : [gen_matypes],
- capture : true,
- )
-endif
-
inc_libmesa_asm = []
if with_asm_arch == 'x86'
files_libmesa_common += files(
@@ -707,7 +691,6 @@ files_libmesa_common += [
main_dispatch_h,
ir_expression_operation_h,
main_remap_helper_h,
- matypes_h,
sha1_h,
]
diff --git a/src/mesa/x86-64/xform4.S b/src/mesa/x86-64/xform4.S
index b0aca19c8b0..b5d224237cf 100644
--- a/src/mesa/x86-64/xform4.S
+++ b/src/mesa/x86-64/xform4.S
@@ -24,7 +24,8 @@
#ifdef USE_X86_64_ASM
-#include "matypes.h"
+#define MATH_ASM_PTR_SIZE 8
+#include "math/m_vector_asm.h"
.text
diff --git a/src/mesa/x86/3dnow_xform1.S b/src/mesa/x86/3dnow_xform1.S
index 939cd209858..2b157bb0e27 100644
--- a/src/mesa/x86/3dnow_xform1.S
+++ b/src/mesa/x86/3dnow_xform1.S
@@ -25,7 +25,8 @@
#ifdef USE_3DNOW_ASM
#include "assyntax.h"
-#include "matypes.h"
+#define MATH_ASM_PTR_SIZE 4
+#include "math/m_vector_asm.h"
#include "xform_args.h"
SEG_TEXT
diff --git a/src/mesa/x86/3dnow_xform2.S b/src/mesa/x86/3dnow_xform2.S
index 169a47f0866..fd71648e2c0 100644
--- a/src/mesa/x86/3dnow_xform2.S
+++ b/src/mesa/x86/3dnow_xform2.S
@@ -25,7 +25,8 @@
#ifdef USE_3DNOW_ASM
#include "assyntax.h"
-#include "matypes.h"
+#define MATH_ASM_PTR_SIZE 4
+#include "math/m_vector_asm.h"
#include "xform_args.h"
SEG_TEXT
diff --git a/src/mesa/x86/3dnow_xform3.S b/src/mesa/x86/3dnow_xform3.S
index 7b0189c4ffc..db24843463f 100644
--- a/src/mesa/x86/3dnow_xform3.S
+++ b/src/mesa/x86/3dnow_xform3.S
@@ -25,7 +25,8 @@
#ifdef USE_3DNOW_ASM
#include "assyntax.h"
-#include "matypes.h"
+#define MATH_ASM_PTR_SIZE 4
+#include "math/m_vector_asm.h"
#include "xform_args.h"
SEG_TEXT
diff --git a/src/mesa/x86/3dnow_xform4.S b/src/mesa/x86/3dnow_xform4.S
index ee845b34004..161aaa1a9b7 100644
--- a/src/mesa/x86/3dnow_xform4.S
+++ b/src/mesa/x86/3dnow_xform4.S
@@ -25,7 +25,8 @@
#ifdef USE_3DNOW_ASM
#include "assyntax.h"
-#include "matypes.h"
+#define MATH_ASM_PTR_SIZE 4
+#include "math/m_vector_asm.h"
#include "xform_args.h"
SEG_TEXT
diff --git a/src/mesa/x86/common_x86_asm.S b/src/mesa/x86/common_x86_asm.S
index 1887bcaaff4..7b29416c7aa 100644
--- a/src/mesa/x86/common_x86_asm.S
+++ b/src/mesa/x86/common_x86_asm.S
@@ -39,7 +39,6 @@
* in there will break the build on some platforms.
*/
-#include "matypes.h"
#include "assyntax.h"
#include "common_x86_features.h"
diff --git a/src/mesa/x86/gen_matypes.c b/src/mesa/x86/gen_matypes.c
deleted file mode 100644
index 441b5c6938d..00000000000
--- a/src/mesa/x86/gen_matypes.c
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Mesa 3-D graphics library
- *
- * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- * Gareth Hughes
- */
-
-/*
- * This generates an asm version of mtypes.h (called matypes.h), so that
- * Mesa's x86 assembly code can access the internal structures easily.
- * This will be particularly useful when developing new x86 asm code for
- * Mesa, including lighting, clipping, texture image conversion etc.
- */
-
-#include <stdio.h>
-#include <inttypes.h>
-
-#include "main/glheader.h"
-#include "main/mtypes.h"
-#include "tnl/t_context.h"
-
-
-#undef offsetof
-#define offsetof( type, member ) ((size_t) &((type *)0)->member)
-
-
-#define OFFSET_HEADER( x ) \
-do { \
- printf( "\n" ); \
- printf( "\n" ); \
- printf( "/* =====================================================" \
- "========\n" ); \
- printf( " * Offsets for " x "\n" ); \
- printf( " */\n" ); \
- printf( "\n" ); \
-} while (0)
-
-#define DEFINE_HEADER( x ) \
-do { \
- printf( "\n" ); \
- printf( "/*\n" ); \
- printf( " * Flags for " x "\n" ); \
- printf( " */\n" ); \
- printf( "\n" ); \
-} while (0)
-
-#ifdef ASM_OFFSETS
-
-/*
- * Format the asm output in a special way that we can manipulate
- * after the fact and turn into the final header for the target.
- */
-
-#define DEFINE_UL( s, ul ) \
- __asm__ __volatile__ ( "\n->" s " %0" : : "i" (ul) )
-
-#define DEFINE( s, d ) \
- DEFINE_UL( s, d )
-
-#define printf( x ) \
- __asm__ __volatile__ ( "\n->" x )
-
-#else
-
-#define DEFINE_UL( s, ul ) \
- printf( "#define %s\t%lu\n", s, (unsigned long) (ul) );
-
-#define DEFINE( s, d ) \
- printf( "#define %s\t0x%" PRIx64 "\n", s, (uint64_t) d );
-
-#endif
-
-#define OFFSET( s, t, m ) \
- DEFINE_UL( s, offsetof( t, m ) )
-
-#define SIZEOF( s, t ) \
- DEFINE_UL( s, sizeof(t) )
-
-
-
-int main( int argc, char **argv )
-{
- printf( "/*\n" );
- printf( " * This file is automatically generated from the Mesa internal type\n" );
- printf( " * definitions. Do not edit directly.\n" );
- printf( " */\n" );
- printf( "\n" );
- printf( "#ifndef __ASM_TYPES_H__\n" );
- printf( "#define __ASM_TYPES_H__\n" );
- printf( "\n" );
-
- /* GLvector4f offsets:
- */
- OFFSET_HEADER( "GLvector4f" );
-
- OFFSET( "V4F_DATA ", GLvector4f, data );
- OFFSET( "V4F_START ", GLvector4f, start );
- OFFSET( "V4F_COUNT ", GLvector4f, count );
- OFFSET( "V4F_STRIDE ", GLvector4f, stride );
- OFFSET( "V4F_SIZE ", GLvector4f, size );
- OFFSET( "V4F_FLAGS ", GLvector4f, flags );
-
- DEFINE_HEADER( "GLvector4f" );
-
- DEFINE( "VEC_SIZE_1 ", VEC_SIZE_1 );
- DEFINE( "VEC_SIZE_2 ", VEC_SIZE_2 );
- DEFINE( "VEC_SIZE_3 ", VEC_SIZE_3 );
- DEFINE( "VEC_SIZE_4 ", VEC_SIZE_4 );
-
-
- /* GLmatrix offsets:
- */
- OFFSET_HEADER( "GLmatrix" );
-
- OFFSET( "MATRIX_DATA ", GLmatrix, m );
- OFFSET( "MATRIX_INV ", GLmatrix, inv );
- OFFSET( "MATRIX_FLAGS ", GLmatrix, flags );
- OFFSET( "MATRIX_TYPE ", GLmatrix, type );
-
-
- printf( "\n" );
- printf( "\n" );
- printf( "#endif /* __ASM_TYPES_H__ */\n" );
-
- return 0;
-}
diff --git a/src/mesa/x86/mmx_blend.S b/src/mesa/x86/mmx_blend.S
index df736cdaa59..500e54a57f4 100644
--- a/src/mesa/x86/mmx_blend.S
+++ b/src/mesa/x86/mmx_blend.S
@@ -6,7 +6,8 @@
#ifdef USE_MMX_ASM
#include "assyntax.h"
-#include "matypes.h"
+#define MATH_ASM_PTR_SIZE 4
+#include "math/m_vector_asm.h"
/* integer multiplication - alpha plus one
*
diff --git a/src/mesa/x86/sse_normal.S b/src/mesa/x86/sse_normal.S
index 36d69e0b0a1..279f6eafcad 100644
--- a/src/mesa/x86/sse_normal.S
+++ b/src/mesa/x86/sse_normal.S
@@ -32,7 +32,8 @@
#ifdef USE_SSE_ASM
#include "assyntax.h"
-#include "matypes.h"
+#define MATH_ASM_PTR_SIZE 4
+#include "math/m_vector_asm.h"
#include "norm_args.h"
SEG_TEXT
diff --git a/src/mesa/x86/sse_xform1.S b/src/mesa/x86/sse_xform1.S
index 7d84a52bc3c..9473fc1571f 100644
--- a/src/mesa/x86/sse_xform1.S
+++ b/src/mesa/x86/sse_xform1.S
@@ -32,7 +32,8 @@
#ifdef USE_SSE_ASM
#include "assyntax.h"
-#include "matypes.h"
+#define MATH_ASM_PTR_SIZE 4
+#include "math/m_vector_asm.h"
#include "xform_args.h"
SEG_TEXT
diff --git a/src/mesa/x86/sse_xform2.S b/src/mesa/x86/sse_xform2.S
index 70215100d19..f89146b42d5 100644
--- a/src/mesa/x86/sse_xform2.S
+++ b/src/mesa/x86/sse_xform2.S
@@ -32,7 +32,8 @@
#ifdef USE_SSE_ASM
#include "assyntax.h"
-#include "matypes.h"
+#define MATH_ASM_PTR_SIZE 4
+#include "math/m_vector_asm.h"
#include "xform_args.h"
SEG_TEXT
diff --git a/src/mesa/x86/sse_xform3.S b/src/mesa/x86/sse_xform3.S
index aeb43ef7017..93387860389 100644
--- a/src/mesa/x86/sse_xform3.S
+++ b/src/mesa/x86/sse_xform3.S
@@ -32,7 +32,8 @@
#ifdef USE_SSE_ASM
#include "assyntax.h"
-#include "matypes.h"
+#define MATH_ASM_PTR_SIZE 4
+#include "math/m_vector_asm.h"
#include "xform_args.h"
SEG_TEXT
diff --git a/src/mesa/x86/sse_xform4.S b/src/mesa/x86/sse_xform4.S
index 0baa8ef8411..d81e9a5b9a1 100644
--- a/src/mesa/x86/sse_xform4.S
+++ b/src/mesa/x86/sse_xform4.S
@@ -25,7 +25,8 @@
#ifdef USE_SSE_ASM
#include "assyntax.h"
-#include "matypes.h"
+#define MATH_ASM_PTR_SIZE 4
+#include "math/m_vector_asm.h"
#include "xform_args.h"
SEG_TEXT
diff --git a/src/mesa/x86/x86_cliptest.S b/src/mesa/x86/x86_cliptest.S
index 031ec1d88ed..231c029e84f 100644
--- a/src/mesa/x86/x86_cliptest.S
+++ b/src/mesa/x86/x86_cliptest.S
@@ -30,7 +30,8 @@
*/
#include "assyntax.h"
-#include "matypes.h"
+#define MATH_ASM_PTR_SIZE 4
+#include "math/m_vector_asm.h"
#include "clip_args.h"
#define SRC0 REGOFF(0, ESI)
diff --git a/src/mesa/x86/x86_xform2.S b/src/mesa/x86/x86_xform2.S
index a36c3dcdab7..fb1b4bea572 100644
--- a/src/mesa/x86/x86_xform2.S
+++ b/src/mesa/x86/x86_xform2.S
@@ -30,7 +30,8 @@
*/
#include "assyntax.h"
-#include "matypes.h"
+#define MATH_ASM_PTR_SIZE 4
+#include "math/m_vector_asm.h"
#include "xform_args.h"
SEG_TEXT
diff --git a/src/mesa/x86/x86_xform3.S b/src/mesa/x86/x86_xform3.S
index 52783064e40..6d2d5185e4c 100644
--- a/src/mesa/x86/x86_xform3.S
+++ b/src/mesa/x86/x86_xform3.S
@@ -30,7 +30,8 @@
*/
#include "assyntax.h"
-#include "matypes.h"
+#define MATH_ASM_PTR_SIZE 4
+#include "math/m_vector_asm.h"
#include "xform_args.h"
SEG_TEXT
diff --git a/src/mesa/x86/x86_xform4.S b/src/mesa/x86/x86_xform4.S
index e585968ed95..f6db5e3165b 100644
--- a/src/mesa/x86/x86_xform4.S
+++ b/src/mesa/x86/x86_xform4.S
@@ -30,7 +30,8 @@
*/
#include "assyntax.h"
-#include "matypes.h"
+#define MATH_ASM_PTR_SIZE 4
+#include "math/m_vector_asm.h"
#include "xform_args.h"
SEG_TEXT