From patchwork Wed Mar 19 16:23:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Edward Nevill X-Patchwork-Id: 26593 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f199.google.com (mail-ob0-f199.google.com [209.85.214.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 49586203C3 for ; Wed, 19 Mar 2014 16:23:21 +0000 (UTC) Received: by mail-ob0-f199.google.com with SMTP id wo20sf32784217obc.10 for ; Wed, 19 Mar 2014 09:23:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:message-id:subject:from:reply-to:to :cc:date:organization:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe:content-type :content-transfer-encoding; bh=hox0JSpwY0D492I2V3DE6NUtt0TiAd7ZTXhQeeEZK6g=; b=BTPOs6Pgc7qQ9/JlChpBAtrEGnYF174xTSlGigKRSorvtSEfmGEqQBiWHJHRD3EwSP KI/kFldXRNGlBv+8bxB/bMrvLHzFEEbJ+vzbe8DhiRKDTRq01sserzkdrvRIPSAzNpgN Y+MLtAOUWFFSGE8fmwCG0uBXislWHs6Nn+DNII39TNKpPScXRE/2CYtg2mv0GrIVl62m 2AtltY/QhV21JIyoqJKQhJi54uAi7P9sA9ohbtk6lbStuVv2NIJdTXHOmYG9eLEzcDBU Oo/GH9Qc1+rzSiS0yM32xJ+jwEAUQPxgPTTAQefd2tH+on+ddC5A9EpPCU68m3E4v4dV beNA== X-Gm-Message-State: ALoCoQljqIypEMqy1q3syaH2YIRcnoMMzJX07ETGFWspiZtbJTRAc/lFImDDfBwcyLo2MzPGOG4S X-Received: by 10.182.29.196 with SMTP id m4mr1299458obh.26.1395246200854; Wed, 19 Mar 2014 09:23:20 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.101.12 with SMTP id t12ls2616617qge.1.gmail; Wed, 19 Mar 2014 09:23:20 -0700 (PDT) X-Received: by 10.52.139.237 with SMTP id rb13mr1660117vdb.33.1395246200728; Wed, 19 Mar 2014 09:23:20 -0700 (PDT) Received: from mail-ve0-f177.google.com (mail-ve0-f177.google.com [209.85.128.177]) by mx.google.com with ESMTPS id rx10si6079963vdc.6.2014.03.19.09.23.20 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Mar 2014 09:23:20 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.177 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.177; Received: by mail-ve0-f177.google.com with SMTP id sa20so8936014veb.8 for ; Wed, 19 Mar 2014 09:23:20 -0700 (PDT) X-Received: by 10.220.104.210 with SMTP id q18mr21553075vco.9.1395246200655; Wed, 19 Mar 2014 09:23:20 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.78.9 with SMTP id i9csp314315vck; Wed, 19 Mar 2014 09:23:20 -0700 (PDT) X-Received: by 10.194.174.135 with SMTP id bs7mr1074971wjc.94.1395246199856; Wed, 19 Mar 2014 09:23:19 -0700 (PDT) Received: from mail-we0-f171.google.com (mail-we0-f171.google.com [74.125.82.171]) by mx.google.com with ESMTPS id lr5si15175478wjb.138.2014.03.19.09.23.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Mar 2014 09:23:19 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.171 is neither permitted nor denied by best guess record for domain of edward.nevill@linaro.org) client-ip=74.125.82.171; Received: by mail-we0-f171.google.com with SMTP id t61so7126286wes.2 for ; Wed, 19 Mar 2014 09:23:19 -0700 (PDT) X-Received: by 10.180.79.73 with SMTP id h9mr20170163wix.3.1395246199277; Wed, 19 Mar 2014 09:23:19 -0700 (PDT) Received: from [10.0.7.5] ([88.98.47.97]) by mx.google.com with ESMTPSA id ci4sm57156106wjc.21.2014.03.19.09.23.18 for (version=SSLv3 cipher=RC4-SHA bits=128/128); Wed, 19 Mar 2014 09:23:18 -0700 (PDT) Message-ID: <1395246197.28929.38.camel@localhost.localdomain> Subject: RFR: Remove mistaken shift in form_address From: Edward Nevill Reply-To: edward.nevill@linaro.org To: "aarch64-port-dev@openjdk.java.net" Cc: patches@linaro.org Date: Wed, 19 Mar 2014 16:23:17 +0000 Organization: Linaro X-Mailer: Evolution 3.8.5 (3.8.5-2.fc19) Mime-Version: 1.0 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: edward.nevill@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.177 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Hi, I came across this while looking at the implicit exception offsets. I believe the shift removed by the patch below is mistaken. 'byte_offset' is already the offset in bytes so shifting it by scale of the data being loaded is wrong. Regards, Ed. Here is some context Address MacroAssembler::form_address(Register Rd, Register base, long byte_offset, int shift) { if (Address::offset_ok_for_immed(byte_offset, shift)) // It fits; no need for any heroics return Address(base, byte_offset); // Don't do anything clever with negative or misaligned offsets unsigned mask = (1 << shift) - 1; if (byte_offset < 0 || byte_offset & mask) { mov(Rd, byte_offset); <<<<< Here it doesn't apply the shift add(Rd, base, Rd); return Address(Rd); } // See if we can do this with two 12-bit offsets { unsigned long word_offset = byte_offset >> shift; <<<< and here it assumes it needs to shift right unsigned long masked_offset = word_offset & 0xfff000; if (Address::offset_ok_for_immed(word_offset - masked_offset) && Assembler::operand_valid_for_add_sub_immediate(masked_offset << shift)) { add(Rd, base, masked_offset << shift); word_offset -= masked_offset; return Address(Rd, word_offset << shift); } } // Do it the hard way mov(Rd, byte_offset << shift); <<<<<< but here it shift the byte offset left???? add(Rd, base, Rd); return Address(Rd); } --- CUT HERE --- exporting patch: # HG changeset patch # User Edward Nevill edward.nevill@linaro.org # Date 1395245750 0 # Wed Mar 19 16:15:50 2014 +0000 # Node ID 9393c177ac9b9407f1f4e58bd662b719b40ded54 # Parent b56e2e46bfe1de5761fbdaf4fd9b021320ab3a18 Remove mistaken shift in form_address diff -r b56e2e46bfe1 -r 9393c177ac9b src/cpu/aarch64/vm/macroAssembler_aarch64.cpp --- a/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp Wed Mar 19 10:39:35 2014 +0000 +++ b/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp Wed Mar 19 16:15:50 2014 +0000 @@ -1399,7 +1399,7 @@ } // Do it the hard way - mov(Rd, byte_offset << shift); + mov(Rd, byte_offset); add(Rd, base, Rd); return Address(Rd); } --- CUT HERE ---