From patchwork Thu Dec 5 15:38:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Edward Nevill X-Patchwork-Id: 22070 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f197.google.com (mail-ob0-f197.google.com [209.85.214.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2F242202E0 for ; Thu, 5 Dec 2013 15:38:55 +0000 (UTC) Received: by mail-ob0-f197.google.com with SMTP id va2sf55792066obc.8 for ; Thu, 05 Dec 2013 07:38:55 -0800 (PST) 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:in-reply-to:references: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=cQmjeZRYsSnRV9FUfzvmUnD2j/faFCe7wLWA24uP1po=; b=d1IX7evXaJzp6LSAFd/y/sIYeq4ak232jE2fLm10KM0LPEz2QlfBNjzlzIQ4v2MiLd 6OjZ2mL0w7FdnwuVHn6g9vxm/sbBoU6nxtPvk8at7j40kLPJaowjJj9gBa/SWPpxJ8Nd 7eS8sdRHdLPdEHJ5MJU2+VIRpsB2f8nFDf3asJbrrL7SAarrB3S8sJHK69DiJgUB5Rz2 6TpAo9nT4siHUNexQpkfmc8bWob7k58DX5yNQSHkrfZ+UadINkSmAYZHrq5FfZGX9M5c 58ZfnUCWUCfgKvOQ1n6unAiU3x54PfmSzfRy8+l37ii9NB71Dek1ESdFiQOy6kOGlnMz nNEg== X-Gm-Message-State: ALoCoQlEfcL6mXjXg70ZtSjBrC7QQ29ReF9elxS6VJ1wuezDWY6MaQ32KlBatP2q0/8M+IJYLGdD X-Received: by 10.182.246.39 with SMTP id xt7mr5134651obc.40.1386257934982; Thu, 05 Dec 2013 07:38:54 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.104.9 with SMTP id ga9ls862765qeb.38.gmail; Thu, 05 Dec 2013 07:38:54 -0800 (PST) X-Received: by 10.52.0.33 with SMTP id 1mr1042702vdb.81.1386257934868; Thu, 05 Dec 2013 07:38:54 -0800 (PST) Received: from mail-ve0-f176.google.com (mail-ve0-f176.google.com [209.85.128.176]) by mx.google.com with ESMTPS id y5si34851695vck.77.2013.12.05.07.38.54 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 05 Dec 2013 07:38:54 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.176 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.176; Received: by mail-ve0-f176.google.com with SMTP id oz11so13717596veb.21 for ; Thu, 05 Dec 2013 07:38:54 -0800 (PST) X-Received: by 10.58.50.35 with SMTP id z3mr1285808ven.61.1386257934394; Thu, 05 Dec 2013 07:38:54 -0800 (PST) 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.174.196 with SMTP id u4csp24548vcz; Thu, 5 Dec 2013 07:38:53 -0800 (PST) X-Received: by 10.14.104.201 with SMTP id i49mr1277480eeg.78.1386257933511; Thu, 05 Dec 2013 07:38:53 -0800 (PST) Received: from mail-ea0-f170.google.com (mail-ea0-f170.google.com [209.85.215.170]) by mx.google.com with ESMTPS id 5si11266424eei.249.2013.12.05.07.38.53 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 05 Dec 2013 07:38:53 -0800 (PST) Received-SPF: neutral (google.com: 209.85.215.170 is neither permitted nor denied by best guess record for domain of edward.nevill@linaro.org) client-ip=209.85.215.170; Received: by mail-ea0-f170.google.com with SMTP id k10so11517032eaj.29 for ; Thu, 05 Dec 2013 07:38:53 -0800 (PST) X-Received: by 10.14.172.130 with SMTP id t2mr13168831eel.68.1386257932981; Thu, 05 Dec 2013 07:38:52 -0800 (PST) Received: from [192.168.1.112] (validation.linaro.org. [88.98.47.97]) by mx.google.com with ESMTPSA id g47sm107431086eeo.19.2013.12.05.07.38.51 for (version=SSLv3 cipher=RC4-SHA bits=128/128); Thu, 05 Dec 2013 07:38:51 -0800 (PST) Message-ID: <1386257930.8800.35.camel@localhost.localdomain> Subject: Re: [aarch64-port-dev ] RFR: Re: Error in server compiler when packing/unpacking data from arrays using shift and mask ops. From: Edward Nevill Reply-To: edward.nevill@linaro.org To: Andrew Haley Cc: Andy Johnson , aarch64-port-dev@openjdk.java.net, patches@linaro.org Date: Thu, 05 Dec 2013 15:38:50 +0000 In-Reply-To: <52A08F61.1050906@redhat.com> References: <1386248464.8800.20.camel@localhost.localdomain> <52A08F61.1050906@redhat.com> 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.176 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: , On Thu, 2013-12-05 at 14:36 +0000, Andrew Haley wrote: > On 12/05/2013 01:01 PM, Edward Nevill wrote: > > On Wed, 2013-12-04 at 16:07 -0500, Andy Johnson wrote: > instruct lshift_ext(iRegLNoSp dst, iRegIorL2I src, immI scale, rFlagsReg cr) %{ > match(Set dst (LShiftL (ConvI2L src) scale)); > > ins_cost(DEFAULT_COST); > format %{ "sbfm $dst, $src, 64-$scale, 31\t" %} > > ins_encode %{ > // __ sbfiz(as_Register($dst$$reg), > // as_Register($src$$reg), > // $scale$$constant & 63, (-$scale$$constant) & 63); > __ sbfm(as_Register($dst$$reg), > as_Register($src$$reg), > (-$scale$$constant) & 63, ((-$scale$$constant) & 63) - 1); > %} > > ins_pipe(pipe_class_default); > %} > > Note that the "sbfiz" and the "sbfm" forms should be identical. Maybe "sbfiz" is > easier to understand. Yes, that is better. I used the same logic as generated by gcc. I have opted for the sbfiz version and have also updated the format. > Reproducer (for C2, use -Xcomp) attached. Andy (J) - Could you take the reproducer generated by Andrew and incorporate it into the JTReg regression suite. Ok, to push? Ed. --- CUT HERE --- # HG changeset patch # User Edward Nevill edward.nevill@linaro.org # Date 1386257271 0 # Thu Dec 05 15:27:51 2013 +0000 # Node ID 35346211c05e1dfa4598a9caf2dfbcdebbf4e8c0 # Parent 141fc5d4229ae66293617edb25050506932471ec Fix lshift_ext in C2 diff -r 141fc5d4229a -r 35346211c05e src/cpu/aarch64/vm/aarch64.ad --- a/src/cpu/aarch64/vm/aarch64.ad Mon Dec 02 17:19:42 2013 +0000 +++ b/src/cpu/aarch64/vm/aarch64.ad Thu Dec 05 15:27:51 2013 +0000 @@ -6927,11 +6927,12 @@ match(Set dst (LShiftL (ConvI2L src) scale)); ins_cost(DEFAULT_COST); - format %{ "sbfm $dst, $src, 64-$scale, 31\t" %} - - ins_encode %{ - __ sbfm(as_Register($dst$$reg), - as_Register($src$$reg), (64u - $scale$$constant) & 63, 31); + format %{ "sbfiz $dst, $src, $scale & 63, -$scale & 63\t" %} + + ins_encode %{ + __ sbfiz(as_Register($dst$$reg), + as_Register($src$$reg), + $scale$$constant & 63, (-$scale$$constant) & 63); %} ins_pipe(pipe_class_default); --- CUT HERE ---