summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
59d15d2)
otherwise something overflows somewhere and causes num_block overflow.
Also added debug code to cache that issue early.
-CFLAGS += -ggdb -Wall -O2
+CFLAGS += -ggdb -Wall -O2 -DNDEBUG
printf("mismatch on %s %s: %x vs %x\n", #_a, #_b, _a, _b) \
printf("mismatch on %s %s: %x vs %x\n", #_a, #_b, _a, _b) \
+#ifndef NDEBUG
+#define setup_spans_debug_check(span_edge_data_element) \
+ if (&span_edge_data_element - psx_gpu->span_edge_data < psx_gpu->num_spans) \
+ { \
+ if(span_edge_data_element.num_blocks > MAX_BLOCKS_PER_ROW) \
+ *(int *)0 = 1; \
+ if(span_edge_data_element.y > 2048) \
+ *(int *)0 = 1; \
+ } \
+
+#else
+#define setup_spans_debug_check(span_edge_data_element) \
+
+#endif
+
#define setup_spans_prologue_alternate_yes() \
vec_2x64s alternate_x; \
vec_2x64s alternate_dx_dy; \
#define setup_spans_prologue_alternate_yes() \
vec_2x64s alternate_x; \
vec_2x64s alternate_dx_dy; \
span_edge_data[i].num_blocks = left_right_x_16.high.e[i]; \
span_edge_data[i].right_mask = span_shift.e[i]; \
span_edge_data[i].y = y_x4.e[i]; \
span_edge_data[i].num_blocks = left_right_x_16.high.e[i]; \
span_edge_data[i].right_mask = span_shift.e[i]; \
span_edge_data[i].y = y_x4.e[i]; \
+ setup_spans_debug_check(span_edge_data[i]); \
} \
\
span_edge_data += 4; \
} \
\
span_edge_data += 4; \
{
shift = __builtin_clz(height);
height_normalized = height << shift;
{
shift = __builtin_clz(height);
height_normalized = height << shift;
- height_reciprocal = ((1ULL << 52) + (height_normalized - 1)) /
+ height_reciprocal = ((1ULL << 51) + (height_normalized - 1)) /
- shift = 32 - (52 - shift);
+ shift = 32 - (51 - shift);
reciprocal_table[height] = (height_reciprocal << 10) | shift;
}
reciprocal_table[height] = (height_reciprocal << 10) | shift;
}
OBJ += psx_gpu_arm_neon.o
endif
ifndef DEBUG
OBJ += psx_gpu_arm_neon.o
endif
ifndef DEBUG
-CFLAGS += -O2 -fno-strict-aliasing
+CFLAGS += -O2 -DNDEBUG -fno-strict-aliasing
endif
OBJ += psx_gpu.o psx_gpu_parse.o psx_gpu_main.o
endif
OBJ += psx_gpu.o psx_gpu_parse.o psx_gpu_main.o