From patchwork Tue Apr 9 21:39:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stafford Horne X-Patchwork-Id: 32235 Received: (qmail 42004 invoked by alias); 9 Apr 2019 21:40:04 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 41889 invoked by uid 89); 9 Apr 2019 21:40:03 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-23.6 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=xin, H*r:sk:mail-pg, HX-Spam-Relays-External:sk:mail-pg, HX-HELO:sk:mail-pg X-HELO: mail-pg1-f171.google.com Received: from mail-pg1-f171.google.com (HELO mail-pg1-f171.google.com) (209.85.215.171) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 09 Apr 2019 21:40:01 +0000 Received: by mail-pg1-f171.google.com with SMTP id j26so163050pgl.5; Tue, 09 Apr 2019 14:40:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bQa52dEk5M9yp2q+QMm9+upEczVVd1Hv77sfY3nA9Ik=; b=GvhbievIcc2SkeS6tJ+Y+oz0vXWfPlewQCXqCccEwEuLJgWNwzMMfHOOYR46A48xY+ SVVeHnDBFeYYlIwpgbviRHxd5J/r8Gl95ek9Xy5sKN5x20FwwoG44nmVNfRYPM2IZJCm scUyuhmb0OPoyFe9Df2c4wJ/jUoCs0PXfcMNaK8DmOVX4t9gAYC1/FAlbwTw/ryVQNLx zs0bWIIMwfgrF3KZ/7ZVgXdWuW1PEAFGm2mRMgYV/pM488gnXj89aYl4CpBByKJLnxxL pgMftJp7GPhBVLYa5HbyyUj93wGoQX4fUQpuI2RkDbzzGQu2oiurqYbh/IZCIepGX5yC skYA== Return-Path: Received: from localhost (g191.61-115-60.ppp.wakwak.ne.jp. [61.115.60.191]) by smtp.gmail.com with ESMTPSA id c22sm35216206pfn.136.2019.04.09.14.39.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 09 Apr 2019 14:39:59 -0700 (PDT) From: Stafford Horne To: GDB patches , GNU Binutils Cc: Andrey Bacherov , Openrisc , Stafford Horne Subject: [PATCH v2 6/6] sim/common: Fix issue with wrong byte order on BE targets Date: Wed, 10 Apr 2019 06:39:25 +0900 Message-Id: <20190409213925.32699-7-shorne@gmail.com> In-Reply-To: <20190409213925.32699-1-shorne@gmail.com> References: <20190409213925.32699-1-shorne@gmail.com> MIME-Version: 1.0 X-IsSubscribed: yes Currently only the OpenRISC sim uses this JOINSIDF() function to compose a double float from 2 registers. The old code doesn't seem to work as the work order gets swapped when running on a x86_64 host. This change fixes that, but I am not sure if its the best thing to do. On mips they do similar reg pair floating point operations composing doubles from 2 32-bit registers in sim/mips/cp1.c value_fpr(). sim/common/ChangeLog: * cgen-ops.h (JOINSIDF): Fix big endian check. --- sim/common/cgen-ops.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/sim/common/cgen-ops.h b/sim/common/cgen-ops.h index 841552066f..d718394723 100644 --- a/sim/common/cgen-ops.h +++ b/sim/common/cgen-ops.h @@ -431,12 +431,8 @@ JOINSIDI (SI x0, SI x1) SEMOPS_INLINE DF JOINSIDF (SI x0, SI x1) { - union { SI in[2]; DF out; } x; - if (CURRENT_TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) - x.in[0] = x0, x.in[1] = x1; - else - x.in[1] = x0, x.in[0] = x1; - return x.out; + /* Making doubles is the same as making long longs. */ + return MAKEDI (x0, x1); } SEMOPS_INLINE XF