[aarch64-port-dev ] RFR: Re: Error in server compiler when packing/unpacking data from arrays using shift and mask ops.
Edward Nevill
edward.nevill at linaro.org
Thu Dec 5 07:38:50 PST 2013
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 at 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 ---
More information about the aarch64-port-dev
mailing list