From nobody Fri Jun 10 09:52:31 2022 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 243EC8507C1 for ; Fri, 10 Jun 2022 09:52:32 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LKGTq6V5tz3F59 for ; Fri, 10 Jun 2022 09:52:31 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BEDA716725 for ; Fri, 10 Jun 2022 09:52:31 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 25A9qVLW013750 for ; Fri, 10 Jun 2022 09:52:31 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 25A9qVIn013749 for bugs@FreeBSD.org; Fri, 10 Jun 2022 09:52:31 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 264590] assembler generates wrong opcodes of instructions fdiv fdivp fdivr fdivrp fsub fsubp fsubr fsubrp Date: Fri, 10 Jun 2022 09:52:31 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: gnu X-Bugzilla-Version: 11.4-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: var@schellong.biz X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1654854751; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hsfFTeWO2H3g5GVOy6TuPnPV/tJTAscU8HkGVjuRhwU=; b=KBrn1468ZdpfyAnziyaXcC86NJ9k95yf1o63wP1cEE2IGUbHPtyB6LYwAWTsbVnB+PqmOJ Lmb339HeBekV7H5yb3e38LTlWljjTpp7kGxlcUVMnRlH2t+FOaBdEELGASJpz/Ke9Q88i5 c5jhod9e2sptWooexf2UsjZuLhxUqUwuXhB4e0HCROnY/RwLIW3oLJ1tMkWTDQQsKfJ67P DAhLSSU79QFh71D1zXpZ4BFII7JO0PKj5cCrG+feq2XngZkCtFk3RJeg7KrC0fNuzZaHkg EwmY7rnKqM0wBmG+6a+IL6AJ10v13jf513u0VGrN2iGq9zjlHLWCxX1tX7fAog== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1654854751; a=rsa-sha256; cv=none; b=jlteBozzFpHsTr2M/bfbHWhgiR62gjX59LW5JBVXoGlD0QkJeMMO9RXaHeijTXFHsuTRWR 7OTjhQQe9kXhl6OpsYa3iwEENhR4/w2Hm3GeahP9A9e25zq31wR/gxh+1u/FTf7paCg9Zh 0RkVwUJZlIgnYyXu7szw0stZ7CO2uiSowINxCTa7pKAfw1gvRylkp+UJN4flwUMCTlSCKL 5rdVWcAN58KTxdiOpv+A6zpuHsltWrRy9+iflUmjz8otcCTyOvwBI0GrxaWAhXpgIrSipu 1hSBCtA+jjyICTH9LntskiRGag+OL5DJBeQzzX+PnrCzaErPlHsF01KHtXrsqg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D264590 Bug ID: 264590 Summary: assembler generates wrong opcodes of instructions fdiv fdivp fdivr fdivrp fsub fsubp fsubr fsubrp Product: Base System Version: 11.4-RELEASE Hardware: amd64 OS: Any Status: New Severity: Affects Many People Priority: --- Component: gnu Assignee: bugs@FreeBSD.org Reporter: var@schellong.biz FreeBSD 11.2-RELEASE FreeBSD 11.2-RELEASE #0 r335510: Fri Jun 22 04:32:14 U= TC 2018 root@releng2.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64 Compiler: clang6, gcc9, bcc32x.exe (Embarcadero, Windows) Sample code: -------------------------------------------- static long double sd(void) { long double y; __asm__ ("\n\t" "fldpi \n\t" "fld1 \n\t" "fdivp \n\t" : "=3Dt"(y) : : ); // st(1)=3Dpi, st(0)=3D1 return y; } int main(void) { printf("\t%.18Lg\n", sd()); return 0; } --------------------------------------------=20 Output: 0.318309886183790672 =3D 1/pi But correct is: pi =3D pi/1 Content of file.o: 0b+096 c4 10 5d c3 55 48 89 e5 >> d9 eb, d9 e8, de f1 << 5d c3 . ^^^^^ ^^^^^ ^^^^^=20 Opcodes of 'fldpi', 'fld1' and /division/. There is the wrong opcode 'de f1' for 'fdivrp'! Not 'de f9' for the written 'fdivp'. These wrong translations appear on fdivxx and fsubxx. --=20 You are receiving this mail because: You are the assignee for the bug.=