From: mark.rutland@arm.com (Mark Rutland)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] arm64: add macro to handle large immediates
Date: Wed, 6 Jan 2016 12:37:41 +0000 [thread overview]
Message-ID: <20160106123740.GH563@leverpostej> (raw)
In-Reply-To: <CAKv+Gu95+F2HhoirhyfoKSs7oUY_5qBdDGcKfXmZi2sS8mERNg@mail.gmail.com>
> >> Ack for the general idea, but for correctness, you should pair the
> >> movk instructions with the _nc relocations (i.e., keep movz first, but
> >> invert the order of the relocs)
> >
> > Ah, I hadn't spotted the restriction. I'll change that to:
> >
> > movz \dst, :abs_g3:\val
> > movk \dst, :abs_g2:\val
> > movk \dst, :abs_g1:\val
> > movk \dst, :abs_g0:\val
> >
>
> Yes, but with the _nc suffix on the latter three.
Yup.
> > That raises a related question. Is it the linker's responsibility to
> > fill in the shift encoding in the hw field as part of the g{3,2,1}
> > relocs?
> >
>
> This
>
> movz x0, :abs_g3:val
> movk x0, :abs_g2_nc:val
> movk x0, :abs_g1_nc:val
> movk x0, :abs_g0_nc:val
>
> assembles to
>
> 0000000000000000 <.text>:
> 0: d2e00000 movz x0, #0x0, lsl #48
> 4: f2c00000 movk x0, #0x0, lsl #32
> 8: f2a00000 movk x0, #0x0, lsl #16
> c: f2800000 movk x0, #0x0
>
> so it is in fact the assembler that sets the hw field.
Interesting!
As I mentioned in another reply, for the moment I'm going to drop mov_l
unless we have another need for it.
Thanks,
Mark.
prev parent reply other threads:[~2016-01-06 12:37 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-06 11:05 [PATCH 1/2] arm64: add macro to handle large immediates Mark Rutland
2016-01-06 11:05 ` [PATCH 2/2] arm64: use memset to clear BSS Mark Rutland
2016-01-06 11:12 ` Ard Biesheuvel
2016-01-06 11:40 ` Mark Rutland
2016-01-06 12:34 ` Mark Rutland
2016-01-06 11:15 ` [PATCH 1/2] arm64: add macro to handle large immediates Ard Biesheuvel
2016-01-06 12:21 ` Mark Rutland
2016-01-06 12:26 ` Ard Biesheuvel
2016-01-06 12:37 ` Mark Rutland [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160106123740.GH563@leverpostej \
--to=mark.rutland@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).