From 1db5bc1ed7f992d7c2686f5359e53301eba2b2ca Mon Sep 17 00:00:00 2001 From: notaz Date: Fri, 12 Aug 2011 01:17:36 +0300 Subject: gpu_unai: fix inline asm statements newer gcc reorders them and was allocating registers wrong due to incomplete constraints. Not that this code is any better than what gcc generates anyway, but whatever. --- plugins/gpu_unai/gpu_inner_light.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'plugins/gpu_unai/gpu_inner_light.h') diff --git a/plugins/gpu_unai/gpu_inner_light.h b/plugins/gpu_unai/gpu_inner_light.h index b9e48bc..d291418 100644 --- a/plugins/gpu_unai/gpu_inner_light.h +++ b/plugins/gpu_unai/gpu_inner_light.h @@ -27,11 +27,13 @@ #define gpuLightingRGB(uSrc,lCol) \ { \ u32 cb,cg; \ - asm ("and %[cb], %[lCol], #0x7C00/32 " : [cb] "=r" (cb) : [lCol] "r" (lCol) ); \ - asm ("and %[cg], %[lCol], #0x03E0*2048 " : [cg] "=r" (cg) : [lCol] "r" (lCol) ); \ - asm ("mov %[res], %[lCol], lsr #27 " : [res] "=r" (uSrc) : [lCol] "r" (lCol) ); \ - asm ("orr %[res], %[res], %[cb], lsl #5 " : [res] "=r" (uSrc) : "0" (uSrc), [cb] "r" (cb) ); \ - asm ("orr %[res], %[res], %[cg], lsr #11 " : [res] "=r" (uSrc) : "0" (uSrc), [cg] "r" (cg) ); \ + asm ("and %[cb], %[lCol], #0x7C00/32 \n" \ + "and %[cg], %[lCol], #0x03E0*2048 \n" \ + "mov %[res], %[lCol], lsr #27\n" \ + "orr %[res], %[res], %[cb], lsl #5 \n" \ + "orr %[res], %[res], %[cg], lsr #11\n" \ + : [res] "=&r" (uSrc), [cb] "=&r" (cb), [cg] "=&r" (cg) \ + : [lCol] "r" (lCol)); \ } #else #define gpuLightingRGB(uSrc,lCol) uSrc=((lCol<<5)&0x7C00) | ((lCol>>11)&0x3E0) | (lCol>>27) -- cgit v1.2.3