projects
/
mesa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rtasm: fix void * / func * casting warnings
[mesa.git]
/
src
/
gallium
/
auxiliary
/
rtasm
/
rtasm_x86sse.c
diff --git
a/src/gallium/auxiliary/rtasm/rtasm_x86sse.c
b/src/gallium/auxiliary/rtasm/rtasm_x86sse.c
index 1acf3c373ebee1700b74463c834d1363a2098e3d..9f70b73698aaa2735bf0fda24ae110d4b495605a 100644
(file)
--- a/
src/gallium/auxiliary/rtasm/rtasm_x86sse.c
+++ b/
src/gallium/auxiliary/rtasm/rtasm_x86sse.c
@@
-87,7
+87,7
@@
void x86_print_reg( struct x86_reg reg )
foo++; \
if (*foo) \
foo++; \
foo++; \
if (*foo) \
foo++; \
- debug_printf( "\n%
4x% 15
s ", p->csr - p->store, foo ); \
+ debug_printf( "\n%
4x %14
s ", p->csr - p->store, foo ); \
} while (0)
#define DUMP_I( I ) do { \
} while (0)
#define DUMP_I( I ) do { \
@@
-673,6
+673,13
@@
void x86_and( struct x86_function *p,
emit_op_modrm( p, 0x23, 0x21, dst, src );
}
emit_op_modrm( p, 0x23, 0x21, dst, src );
}
+void x86_div( struct x86_function *p,
+ struct x86_reg src )
+{
+ assert(src.file == file_REG32 && src.mod == mod_REG);
+ emit_op_modrm(p, 0xf7, 0, x86_make_reg(file_REG32, 6), src);
+}
+
/***********************************************************************
/***********************************************************************
@@
-1736,20
+1743,35
@@
void x86_release_func( struct x86_function *p )
}
}
-void (*x86_get_func( struct x86_function *p ))(void)
+static INLINE x86_func
+voidptr_to_x86_func(void *v)
+{
+ union {
+ void *v;
+ x86_func f;
+ } u;
+ assert(sizeof(u.v) == sizeof(u.f));
+ u.v = v;
+ return u.f;
+}
+
+
+x86_func x86_get_func( struct x86_function *p )
{
DUMP_END();
if (DISASSEM && p->store)
debug_printf("disassemble %p %p\n", p->store, p->csr);
if (p->store == p->error_overflow)
{
DUMP_END();
if (DISASSEM && p->store)
debug_printf("disassemble %p %p\n", p->store, p->csr);
if (p->store == p->error_overflow)
- return
(void (*)(void)) NULL
;
+ return
voidptr_to_x86_func(NULL)
;
else
else
- return
(void (*)(void)) p->store
;
+ return
voidptr_to_x86_func(p->store)
;
}
#else
}
#else
+void x86sse_dummy( void );
+
void x86sse_dummy( void )
{
}
void x86sse_dummy( void )
{
}