From 67ffb853f05eb24222970261018f6ed0982e6be4 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 20 Jun 2019 10:35:32 -0700 Subject: [PATCH] sparc: Reuse m_vector_asm.h. Reviewed-by: Matt Turner Reviewed-by: Eric Engestrom --- src/mesa/sparc/norm.S | 12 ++++++------ src/mesa/sparc/sparc_clip.S | 16 ++++------------ src/mesa/sparc/sparc_matrix.h | 20 ++++---------------- 3 files changed, 14 insertions(+), 34 deletions(-) diff --git a/src/mesa/sparc/norm.S b/src/mesa/sparc/norm.S index 117d36fa223..f0b1fdeeba6 100644 --- a/src/mesa/sparc/norm.S +++ b/src/mesa/sparc/norm.S @@ -29,7 +29,7 @@ _mesa_sparc_transform_normalize_normals: ld [%sp + STACK_VAR_OFF+0x4], %f15 ! f15 = scale add %sp, 16, %sp - LDPTR [%o0 + MAT_INV], %o0 ! o0 = mat->inv + LDPTR [%o0 + MATRIX_INV], %o0 ! o0 = mat->inv LDPTR [%o2 + V4F_START], %o5 ! o5 = 'from' in->start ld [%o2 + V4F_COUNT], %g1 ! g1 = in->count ld [%o2 + V4F_STRIDE], %g2 ! g2 = in->stride @@ -168,7 +168,7 @@ _mesa_sparc_transform_normalize_normals_no_rot: ld [%sp + STACK_VAR_OFF+0x4], %f15 ! f15 = scale add %sp, 16, %sp - LDPTR [%o0 + MAT_INV], %o0 ! o0 = mat->inv + LDPTR [%o0 + MATRIX_INV], %o0 ! o0 = mat->inv LDPTR [%o2 + V4F_START], %o5 ! o5 = 'from' in->start ld [%o2 + V4F_COUNT], %g1 ! g1 = in->count ld [%o2 + V4F_STRIDE], %g2 ! g2 = in->stride @@ -273,7 +273,7 @@ _mesa_sparc_transform_rescale_normals_no_rot: ld [%sp + STACK_VAR_OFF+0x0], %f15 ! f15 = scale add %sp, 16, %sp - LDPTR [%o0 + MAT_INV], %o0 ! o0 = mat->inv + LDPTR [%o0 + MATRIX_INV], %o0 ! o0 = mat->inv LDPTR [%o2 + V4F_START], %o5 ! o5 = 'from' in->start ld [%o2 + V4F_COUNT], %g1 ! g1 = in->count ld [%o2 + V4F_STRIDE], %g2 ! g2 = in->stride @@ -324,7 +324,7 @@ _mesa_sparc_transform_rescale_normals: ld [%sp + STACK_VAR_OFF+0x0], %f15 ! f15 = scale add %sp, 16, %sp - LDPTR [%o0 + MAT_INV], %o0 ! o0 = mat->inv + LDPTR [%o0 + MATRIX_INV], %o0 ! o0 = mat->inv LDPTR [%o2 + V4F_START], %o5 ! o5 = 'from' in->start ld [%o2 + V4F_COUNT], %g1 ! g1 = in->count ld [%o2 + V4F_STRIDE], %g2 ! g2 = in->stride @@ -384,7 +384,7 @@ _mesa_sparc_transform_rescale_normals: .globl _mesa_sparc_transform_normals_no_rot _mesa_sparc_transform_normals_no_rot: /* o0=mat o1=scale o2=in o3=lengths o4=dest */ - LDPTR [%o0 + MAT_INV], %o0 ! o0 = mat->inv + LDPTR [%o0 + MATRIX_INV], %o0 ! o0 = mat->inv LDPTR [%o2 + V4F_START], %o5 ! o5 = 'from' in->start ld [%o2 + V4F_COUNT], %g1 ! g1 = in->count ld [%o2 + V4F_STRIDE], %g2 ! g2 = in->stride @@ -426,7 +426,7 @@ _mesa_sparc_transform_normals_no_rot: .globl _mesa_sparc_transform_normals _mesa_sparc_transform_normals: /* o0=mat o1=scale o2=in o3=lengths o4=dest */ - LDPTR [%o0 + MAT_INV], %o0 ! o0 = mat->inv + LDPTR [%o0 + MATRIX_INV], %o0 ! o0 = mat->inv LDPTR [%o2 + V4F_START], %o5 ! o5 = 'from' in->start ld [%o2 + V4F_COUNT], %g1 ! g1 = in->count ld [%o2 + V4F_STRIDE], %g2 ! g2 = in->stride diff --git a/src/mesa/sparc/sparc_clip.S b/src/mesa/sparc/sparc_clip.S index dc239171ff9..11aa8324ec2 100644 --- a/src/mesa/sparc/sparc_clip.S +++ b/src/mesa/sparc/sparc_clip.S @@ -4,20 +4,12 @@ #if __arch64__ #define LDPTR ldx -#define V4F_DATA 0x00 -#define V4F_START 0x08 -#define V4F_COUNT 0x10 -#define V4F_STRIDE 0x14 -#define V4F_SIZE 0x18 -#define V4F_FLAGS 0x1c +#define MATH_ASM_PTR_SIZE 8 +#include "math/m_vector_asm.h" #else #define LDPTR ld -#define V4F_DATA 0x00 -#define V4F_START 0x04 -#define V4F_COUNT 0x08 -#define V4F_STRIDE 0x0c -#define V4F_SIZE 0x10 -#define V4F_FLAGS 0x14 +#define MATH_ASM_PTR_SIZE 4 +#include "math/m_vector_asm.h" #endif #define VEC_SIZE_1 1 diff --git a/src/mesa/sparc/sparc_matrix.h b/src/mesa/sparc/sparc_matrix.h index 6ef0acde69e..d478b76802f 100644 --- a/src/mesa/sparc/sparc_matrix.h +++ b/src/mesa/sparc/sparc_matrix.h @@ -7,24 +7,12 @@ #ifdef __arch64__ #define LDPTR ldx -#define MAT_M 0x00 -#define MAT_INV 0x08 -#define V4F_DATA 0x00 -#define V4F_START 0x08 -#define V4F_COUNT 0x10 -#define V4F_STRIDE 0x14 -#define V4F_SIZE 0x18 -#define V4F_FLAGS 0x1c +#define MATH_ASM_PTR_SIZE 8 +#include "math/m_vector_asm.h" #else #define LDPTR ld -#define MAT_M 0x00 -#define MAT_INV 0x04 -#define V4F_DATA 0x00 -#define V4F_START 0x04 -#define V4F_COUNT 0x08 -#define V4F_STRIDE 0x0c -#define V4F_SIZE 0x10 -#define V4F_FLAGS 0x14 +#define MATH_ASM_PTR_SIZE 4 +#include "math/m_vector_asm.h" #endif #define VEC_SIZE_1 1 -- 2.30.2