Date: Mon, 18 May 1998 01:40:39 -0500 (CDT) From: Tony Kimball <alk@pobox.com> To: bde@zeta.org.au Cc: current@FreeBSD.ORG, luoqi@watermarkgroup.com Subject: Re: as chokes on cc output Message-ID: <199805180640.BAA11981@pobox.com> References: <199805161532.BAA28755@godzilla.zeta.org.au>
next in thread | previous in thread | raw e-mail | index | archive | help
Quoth Bruce Evans on Sun, 17 May: : >> I'm getting messages like so: : >> /var/tmp/ccro2473.s:26621: Error: operands given don't match any known 386 instruction : >> from asm lines like so: : >> #APP : >> fldln2; fxch; fyl2x : >> #NO_APP : >> in gcc-generated code. I'm clueless w.r.t. intel asm code and binutils. What's : >> the deal? It's a bug, anyhow. : > : >These are i387 instructions. The problem is that gas doesn't know fxch is : >a shorthand for fxch %st(1). Just add the parameter %st(1), like : > __asm__("fldln2; fxch %st(1); fyl2x"); : : I think I understand why gcc is generating this. #APP is generated for : inline asm, and someone who doesn't know gas syntax wrote the asm :-). There are two interesting points to be made here: There is a comment in binutils/include/opcode/ChangeLog: Tue Nov 2 12:41:30 1993 Ken Raeburn (raeburn@rover.cygnus.com) * i386.h: Add "fxch" without operand. and text in i386.h: {"fxch", 0, 0xd9c9, _, NoModrm, { 0, 0, 0} }, /* alias for fxch %st, %st(1) */ so that it seems gas *should* be accepting this syntax, by design. Also, this code does compile correctly at lower optimization levels. Anyhow, inserting the %st(1) operands into the asm code solved the problem at all optimization levels, so that, while it remains a bug, I'm content. Thanks! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199805180640.BAA11981>