typedef void (*blend_test_ptr_t)(const void *src, const void *dst, const void *con, void *res);
+/** cast wrapper */
+static blend_test_ptr_t
+voidptr_to_blend_test_ptr_t(void *p)
+{
+ union {
+ void *v;
+ blend_test_ptr_t f;
+ } u;
+ u.v = p;
+ return u.f;
+}
+
+
void
write_tsv_header(FILE *fp)
int64_t cycles[LP_TEST_NUM_SAMPLES];
double cycles_avg = 0.0;
unsigned i, j;
+ void *code;
if(verbose >= 1)
dump_blend_type(stdout, blend, mode, type);
if(verbose >= 2)
LLVMDumpModule(module);
- blend_test_ptr = (blend_test_ptr_t)LLVMGetPointerToGlobal(engine, func);
+ code = LLVMGetPointerToGlobal(engine, func);
+ blend_test_ptr = voidptr_to_blend_test_ptr_t(code);
if(verbose >= 2)
- lp_disassemble(blend_test_ptr);
+ lp_disassemble(code);
success = TRUE;
for(i = 0; i < n && success; ++i) {
typedef void (*conv_test_ptr_t)(const void *src, const void *dst);
+/** cast wrapper */
+static conv_test_ptr_t
+voidptr_to_conv_test_ptr_t(void *p)
+{
+ union {
+ void *v;
+ conv_test_ptr_t f;
+ } u;
+ u.v = p;
+ return u.f;
+}
void
write_tsv_header(FILE *fp)
unsigned num_dsts;
double eps;
unsigned i, j;
+ void *code;
if(verbose >= 1)
dump_conv_types(stdout, src_type, dst_type);
if(verbose >= 2)
LLVMDumpModule(module);
- conv_test_ptr = (conv_test_ptr_t)LLVMGetPointerToGlobal(engine, func);
+ code = LLVMGetPointerToGlobal(engine, func);
+ conv_test_ptr = voidptr_to_conv_test_ptr_t(code);
if(verbose >= 2)
- lp_disassemble(conv_test_ptr);
+ lp_disassemble(code);
success = TRUE;
for(i = 0; i < n && success; ++i) {
(*fetch_ptr_t)(float *, const void *packed,
unsigned i, unsigned j);
+/** cast wrapper to avoid warnings */
+static fetch_ptr_t
+void_to_fetch_ptr_t(void *p)
+{
+ union {
+ void *v;
+ fetch_ptr_t f;
+ } u;
+ u.v = p;
+ return u.f;
+}
+
+
static LLVMValueRef
add_fetch_rgba_test(LLVMModuleRef lp_build_module,
(void)pass;
#endif
- fetch_ptr = (fetch_ptr_t) LLVMGetPointerToGlobal(lp_build_engine, fetch);
+ fetch_ptr = void_to_fetch_ptr_t(LLVMGetPointerToGlobal(lp_build_engine, fetch));
for (i = 0; i < desc->block.height; ++i) {
for (j = 0; j < desc->block.width; ++j) {
struct printf_test_case {
+ int foo;
};
void
typedef void (*test_printf_t)(int i);
+/** cast wrapper */
+static test_printf_t
+voidptr_to_test_printf_t(void *p)
+{
+ union {
+ void *v;
+ test_printf_t f;
+ } u;
+ u.v = p;
+ return u.f;
+}
+
+
static LLVMValueRef
add_printf_test(LLVMModuleRef module)
{
float unpacked[4];
unsigned packed;
boolean success = TRUE;
+ void *code;
module = LLVMModuleCreateWithName("test");
(void)pass;
#endif
- test_printf = (test_printf_t)LLVMGetPointerToGlobal(engine, test);
+ code = LLVMGetPointerToGlobal(engine, test);
+ test_printf = voidptr_to_test_printf_t(code);
memset(unpacked, 0, sizeof unpacked);
packed = 0;