bug-gnubg
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gnubg] gnubg sse problems on non-sse cpu's


From: Jon Kinsey
Subject: Re: [Bug-gnubg] gnubg sse problems on non-sse cpu's
Date: Thu, 06 Apr 2006 10:09:56 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8) Gecko/20051201 Thunderbird/1.5 Mnenhy/0.7.3.0

Christian Anthon wrote:
> Hi all,
> 
> I wrote to the mingw-users list about the sse problem on athlons. It
> seems that basically the sse code has to be entirely separated from the
> rest. Only this way can one compile with -msse on those file that need
> it and not the rest. It seems that -msse tells gcc that it may use sse
> extensions and it does so even in places where it is not explicitely
> told so by the gnubg code.
> 
> In essence gnubg dies with sigill (illegal instruction) on both linux
> and windows, when the cpu doesn't have sse support. The problem is in
> a integer->float typecast. 
> 
> On linux gnubg(without board3d) ran through gdb gives:
> 
> Program received signal SIGILL, Illegal instruction.
> [Switching to Thread -1222429008 (LWP 26181)]
> 0x080e4213 in SetColourX (arColour=0x87652a4, sz=0xbf902cae "#FF3333")
> at renderprefs.c:130
> 130             arColour[ 0 ] = anColour[ 0 ] / 255.0f;
> (gdb) disas
> Dump of assembler code for function SetColourX:
> 0x080e41d0 <SetColourX+0>:      push   %ebp
> 0x080e41d1 <SetColourX+1>:      mov    %esp,%ebp
> 0x080e41d3 <SetColourX+3>:      push   %esi
> 0x080e41d4 <SetColourX+4>:      mov    %eax,%esi
> 0x080e41d6 <SetColourX+6>:      mov    $0x3b,%eax
> 0x080e41db <SetColourX+11>:     push   %ebx
> 0x080e41dc <SetColourX+12>:     sub    $0x30,%esp
> 0x080e41df <SetColourX+15>:     mov    %edx,%ebx
> 0x080e41e1 <SetColourX+17>:     mov    %eax,0x4(%esp)
> 0x080e41e5 <SetColourX+21>:     mov    %edx,(%esp)
> 0x080e41e8 <SetColourX+24>:     call   0x806e714 <address@hidden>
> 0x080e41ed <SetColourX+29>:     test   %eax,%eax
> 0x080e41ef <SetColourX+31>:     je     0x80e41f4 <SetColourX+36>
> 0x080e41f1 <SetColourX+33>:     movb   $0x0,(%eax)
> 0x080e41f4 <SetColourX+36>:     lea    0xffffffe8(%ebp),%edx
> 0x080e41f7 <SetColourX+39>:     mov    %ebx,%eax
> 0x080e41f9 <SetColourX+41>:     call   0x80e4080 <SetColour>
> 0x080e41fe <SetColourX+46>:     test   %eax,%eax
> 0x080e4200 <SetColourX+48>:     mov    $0xffffffff,%edx
> 0x080e4205 <SetColourX+53>:     jne    0x80e424d <SetColourX+125>
> 0x080e4207 <SetColourX+55>:     movzbl 0xffffffe8(%ebp),%eax
> 0x080e420b <SetColourX+59>:     xor    %edx,%edx
> 0x080e420d <SetColourX+61>:     flds   0x823744c
> 0x080e4213 <SetColourX+67>:     cvtsi2ss %eax,%xmm0

Yes, this is a SSE instruction.  Probably easiest to have a SSE and a
non-SSE build for the moment.  (conditionally using SSE has the
disadvantage of these optimisation not being included on SSE machines).

Jon

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]