#ifndef COMMON_H
#define COMMON_H
-typedef signed char s8;
-typedef unsigned char u8;
-typedef signed short s16;
-typedef unsigned short u16;
-typedef signed int s32;
-typedef unsigned int u32;
-typedef signed long long int s64;
-typedef unsigned long long int u64;
-
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
-#include "vector_ops.h"
+#include "vector_types.h"
#include "psx_gpu.h"
#define unlikely(x) __builtin_expect((x), 0)
#include <string.h>
#include "common.h"
+#ifndef NEON_BUILD
+#include "vector_ops.h"
+#endif
u32 span_pixels = 0;
u32 span_pixel_blocks = 0;
}
-void compute_all_gradients(psx_gpu_struct *psx_gpu, vertex_struct *a,
- vertex_struct *b, vertex_struct *c);
-
#ifndef NEON_BUILD
#define setup_gradient_calculation_input(set, vertex) \
#ifndef PSX_GPU_H
#define PSX_GPU_H
+#include "vector_types.h"
+
typedef enum
{
PRIMITIVE_TYPE_TRIANGLE = 0,
s16 x;
s16 y;
+
+ u32 padding;
} vertex_struct;
void render_block_fill(psx_gpu_struct *psx_gpu, u32 color, u32 x, u32 y,
void triangle_benchmark(psx_gpu_struct *psx_gpu);
+void compute_all_gradients(psx_gpu_struct * __restrict__ psx_gpu,
+ const vertex_struct * __restrict__ a, const vertex_struct * __restrict__ b,
+ const vertex_struct * __restrict__ c);
+
#endif
#ifndef VECTOR_OPS
#define VECTOR_OPS
-#define build_vector_type_pair(sign, size, count, count_x2) \
-typedef struct \
-{ \
- sign##size e[count]; \
-} vec_##count##x##size##sign; \
- \
-typedef struct \
-{ \
- union \
- { \
- sign##size e[count_x2]; \
- struct \
- { \
- vec_##count##x##size##sign low; \
- vec_##count##x##size##sign high; \
- }; \
- }; \
-} vec_##count_x2##x##size##sign \
-
-#define build_vector_types(sign) \
- build_vector_type_pair(sign, 8, 8, 16); \
- build_vector_type_pair(sign, 16, 4, 8); \
- build_vector_type_pair(sign, 32, 2, 4); \
- build_vector_type_pair(sign, 64, 1, 2) \
-
-build_vector_types(u);
-build_vector_types(s);
+#include "vector_types.h"
#define foreach_element(iterations, operation) \
--- /dev/null
+/*
+ * Copyright (C) 2011 Gilead Kutnick "Exophase" <exophase@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ */
+
+#ifndef VECTOR_TYPES
+#define VECTOR_TYPES
+
+#include <stdint.h>
+
+typedef int8_t s8;
+typedef uint8_t u8;
+typedef int16_t s16;
+typedef uint16_t u16;
+typedef int32_t s32;
+typedef uint32_t u32;
+typedef int64_t s64;
+typedef uint64_t u64;
+
+#define build_vector_type_pair(sign, size, count, count_x2) \
+typedef struct \
+{ \
+ sign##size e[count]; \
+} vec_##count##x##size##sign; \
+ \
+typedef struct \
+{ \
+ union \
+ { \
+ sign##size e[count_x2]; \
+ struct \
+ { \
+ vec_##count##x##size##sign low; \
+ vec_##count##x##size##sign high; \
+ }; \
+ }; \
+} vec_##count_x2##x##size##sign \
+
+#define build_vector_types(sign) \
+ build_vector_type_pair(sign, 8, 8, 16); \
+ build_vector_type_pair(sign, 16, 4, 8); \
+ build_vector_type_pair(sign, 32, 2, 4); \
+ build_vector_type_pair(sign, 64, 1, 2) \
+
+build_vector_types(u);
+build_vector_types(s);
+
+#endif // VECTOR_TYPES