1/*
2 * Copyright © 2019 Google LLC
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21 * IN THE SOFTWARE.
22 */
23
24#ifndef _M_VECTOR_ASM_H_
25#define _M_VECTOR_ASM_H_
26
27/* This file is a set of defines usable by the old FF TNL assembly code for
28 * referencing GLvector4f and GLmatrix structs.
29 */
30
31#define VEC_DIRTY_0        0x1
32#define VEC_DIRTY_1        0x2
33#define VEC_DIRTY_2        0x4
34#define VEC_DIRTY_3        0x8
35
36#define VEC_SIZE_1   VEC_DIRTY_0
37#define VEC_SIZE_2   (VEC_DIRTY_0|VEC_DIRTY_1)
38#define VEC_SIZE_3   (VEC_DIRTY_0|VEC_DIRTY_1|VEC_DIRTY_2)
39#define VEC_SIZE_4   (VEC_DIRTY_0|VEC_DIRTY_1|VEC_DIRTY_2|VEC_DIRTY_3)
40
41/* If you add a new field, please add it to the STATIC_ASSERTs in
42 * _mesa_vector4f_init().
43 */
44#define V4F_DATA   0
45#define V4F_START  (V4F_DATA + MATH_ASM_PTR_SIZE)
46#define V4F_COUNT  (V4F_START + MATH_ASM_PTR_SIZE)
47#define V4F_STRIDE (V4F_COUNT + 4)
48#define V4F_SIZE   (V4F_STRIDE + 4)
49#define V4F_FLAGS  (V4F_SIZE + 4)
50
51/* If you add a new field, please add it to the STATIC_ASSERTs in
52 * _math_matrix_set_identity().
53 */
54#define MATRIX_M   0
55#define MATRIX_INV (MATRIX_M + 16 * 4)
56
57#endif /* _M_VECTOR_ASM_H */
58