Message-ID: <387E54D8.FB9F92EA@lycosmail.com> Date: Thu, 13 Jan 2000 17:42:32 -0500 From: Adam Schrotenboer X-Mailer: Mozilla 4.7 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: pgcc AT delorie DOT com Subject: Re: pgcc on AMD K6 References: <14455 DOT 31978 DOT 6456 DOT 97304 AT monty DOT pp DOT sci DOT fi> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: pgcc AT delorie DOT com Check the Makefile, if there are any refs to -mpentiumpro, (which I did see, though I think that's supposed to only enable the scheduling for Pentium Pro), -march=pentiumpro or -march=i686, change them to -march=k6. Also, don't use i686 ASM, which may also contain Pentium Pro specific opcodes. K6 doesn't support cmove, but AMD Athlon does (I just checked mine, and WCPUID says it does) Michael Widenius wrote: > Hi! > > I tried to run a file compiled with the following options on my AMD > K6-3 400 Mhz Linux RedHat 6.1 machine: > > ((/my/monty/master/mysql-3.23.8-alpha/mysys)) /usr/local/pgcc/bin/gcc -v > Reading specs from /usr/local/pgcc/lib/gcc-lib/i686-pc-linux-gnu/pgcc-2.95.2/specs > gcc version pgcc-2.95.2 19991024 (release) > > ((/my/monty/master/mysql-3.23.8-alpha/mysys)) /usr/local/pgcc/bin/gcc -I./../include -I../include -I.. -DDBUG_OFF -O6 -mpentiumpro -fomit-frame-pointer -S mf_dirname.c > > ------- > #include "mysys_priv.h" > #include > > uint dirname_part(my_string to, const char *name) > { > uint length; > DBUG_ENTER("dirname_part"); > DBUG_PRINT("enter",("'%s'",name)); > > length=dirname_length(name); > (void) strmake(to,(char*) name,min(length,FN_REFLEN-2)); > convert_dirname(to); /* Convert chars */ > DBUG_RETURN(length); > } /* dirname */ > ------------- > > This produced the following output: > > dirname_part: > subl $16,%esp > pushl %edi > pushl %esi > pushl %ebx > movl 32(%esp),%edi > movl 36(%esp),%esi > pushl %eax > pushl %eax > pushl $58 > pushl %esi > call strrchr > movl %eax,%edx > leal -1(%esi),%eax > testl %edx,%edx > cmove %eax,%edx # <- This doesn't work > addl $16,%esp > movl %edx,%ecx > leal 1(%ecx),%edx > > .... > > My K6-III computer crashes with an illegal instruction at the cmove > instruction, while my Pentium II computer (running Suse 6.2) works perfectly. > > I also noticed that I can't start pgcc on the K6-III computer; It > also dies with an 'illegal instruction'. > > Is the cmove instruction not supported by AMD K6 and in this case why > is pgcc generating it when one only uses the safe -mcpu instead of the > -march=cpu option? > > Previous versions of pgcc have worked ok on the K6 machine, so > something has changed recently. > > Regards, > Monty > Moderator of MySQL > > PS: By the way, I am very impressed with the code pgcc generates for a > lot of functions involving longlong:s on Intel; It's a LOT better > Codefusion, gcc 2.95.2 or the Fujitsu C++ compiler! Good work!