From 8162d317d2f6f2dcc31f31c0c2d663c33dfee053 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Wed, 13 Feb 2008 12:35:16 +0000 Subject: x86: emit absolute calls, as reallocating exec mem breaks relative ones --- src/mesa/x86/rtasm/x86sse.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/mesa/x86/rtasm/x86sse.c') diff --git a/src/mesa/x86/rtasm/x86sse.c b/src/mesa/x86/rtasm/x86sse.c index 385fb84c01f..e944d00f9e8 100644 --- a/src/mesa/x86/rtasm/x86sse.c +++ b/src/mesa/x86/rtasm/x86sse.c @@ -278,11 +278,24 @@ void x86_jmp( struct x86_function *p, unsigned char *label) emit_1i(p, label - x86_get_label(p) - 4); } +#if 0 +/* This doesn't work once we start reallocating & copying the + * generated code on buffer fills, because the call is relative to the + * current pc. + */ void x86_call( struct x86_function *p, void (*label)()) { emit_1ub(p, 0xe8); emit_1i(p, cptr(label) - x86_get_label(p) - 4); } +#else +void x86_call( struct x86_function *p, struct x86_reg reg) +{ + emit_1ub(p, 0xff); + emit_modrm(p, reg, reg); +} +#endif + /* michal: * Temporary. As I need immediate operands, and dont want to mess with the codegen, -- cgit v1.2.3