From owner-freebsd-current Sun May 17 23:40:19 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id XAA17022 for freebsd-current-outgoing; Sun, 17 May 1998 23:40:19 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from pobox.com ([208.141.230.105]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id XAA17005 for ; Sun, 17 May 1998 23:40:16 -0700 (PDT) (envelope-from alk@pobox.com) Received: (from alk@localhost) by pobox.com (8.8.8/8.7.3) id BAA11981; Mon, 18 May 1998 01:40:39 -0500 (CDT) Date: Mon, 18 May 1998 01:40:39 -0500 (CDT) Message-Id: <199805180640.BAA11981@pobox.com> From: Tony Kimball MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Face: O9M"E%K;(f-Go/XDxL+pCxI5*gr[=FN@Y`cl1.Tn Reply-To: alk@pobox.com To: bde@zeta.org.au Cc: current@FreeBSD.ORG, luoqi@watermarkgroup.com Subject: Re: as chokes on cc output References: <199805161532.BAA28755@godzilla.zeta.org.au> X-Mailer: VM 6.34 under 20.3 "Vatican City" XEmacs Lucid Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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