public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Ramana Radhakrishnan <ramana.gcc@googlemail.com>
To: Phil Blundell <pb@pbcl.net>
Cc: Adhemerval Zanella <adhemerval.zanella@linaro.org>,
	 GNU C Library <libc-alpha@sourceware.org>
Subject: Re: [PATCH 4/4] arm: Enable ARM mode for armv6 strlen
Date: Fri, 13 Apr 2018 12:06:00 -0000	[thread overview]
Message-ID: <CAJA7tRbnGw1YR9R3wzcoepS52005m0dEDzLaY+k2ceUC4kC0PA@mail.gmail.com> (raw)
In-Reply-To: <1523613389.18801.144.camel@pbcl.net>

On Fri, Apr 13, 2018 at 10:56 AM, Phil Blundell <pb@pbcl.net> wrote:
> On Thu, 2018-04-12 at 17:49 -0300, Adhemerval Zanella wrote:
>> Even though it configure the toolchain to not emit thumb, if user
>> tries to optimize for armv7 (by tinkering with CC or CFLAGS) it will
>> still emit thumb instructions because of the optimized assembly
>> implementations.
>> And the expectation imho is to if user explicit builds with -marm
>> the resulting library should not user thumb instructions.
>
> I think the precedent on other architectures is that glibc will use the
> instruction set appropriate to the target triple it was given.  For
> example, if you configure glibc for i686-linux-gnu then it will use
> CMOV instructions, and setting -march=i586 in CFLAGS won't prevent
> this.
>
> I continue to feel that the scenario mentioned in the bug report you
> linked to (configuring for armv7 but disabling Thumb in the kernel) is
> just silly and we should not be indicating to users that this is
> supported.  T32 is an integral part of ARMv7 (indeed, the M profile
> doesn't support A32 at all) and if you take it out then the resulting
> architecture is no longer ARMv7.  It seems undesirable to force all the
> ARMv7-optimised assembly routines to also provide an ARM-only version
> even if the resulting performance is the same or worse than the Thumb
> implementation.  This code is never going to get tested in practice
> (witness the fact that you found it's been broken for several years)
> and it's just a liability.

>
>> In fact, the whole idea of current code is indeed to prevent thumb
>> instructions in such cases
>
> That's true.  It's not entirely clear to me why Roland made that change
>  in the first place but I think it was roughly contemporaneous with the
> NaCl port and I'm sort of guessing it was something to do with that.
> Does anybody else know/remember?

That change coming in with the NaCl port makes sense to me. IIRC NaCl
wanted fixed length encodings, (thus )everything to be in Arm state
only : instructions that were "forbidden" / not allowed as part of the
whole NaCl strategy for providing sand boxes including switching to
Thumb. I also seem to remember that they had stuff that checked
instructions in the binary were in a particular set and anything
outside was not considered to be a safe binary.

Aha - https://developer.chrome.com/native-client/reference/sandbox_internals/arm-32-bit-sandbox#arm-32-bit-sandbox



regards
Ramana


> p.
>

  parent reply	other threads:[~2018-04-13 12:06 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-11 21:16 [PATCH 1/4] arm: Fix armv7 neon memchr on ARM mode Adhemerval Zanella
2018-04-11 21:16 ` [PATCH 3/4] arm: Enable ARM mode for armv6 memchr Adhemerval Zanella
2018-04-11 21:16 ` [PATCH 2/4] arm: Fix armv7 neon strcmp on ARM mode Adhemerval Zanella
2018-04-11 21:16 ` [PATCH 4/4] arm: Enable ARM mode for armv6 strlen Adhemerval Zanella
2018-04-11 22:12   ` Phil Blundell
2018-04-12 12:42     ` Adhemerval Zanella
2018-04-12 15:33       ` Phil Blundell
2018-04-12 16:16         ` Adhemerval Zanella
2018-04-12 19:20           ` Adhemerval Zanella
2018-04-12 19:28             ` Phil Blundell
     [not found]               ` <CAJA7tRahZ7L=zBs2z+zgCR=RTuccipdjBXhprjxybErebUwv1A@mail.gmail.com>
2018-04-12 19:41                 ` Adhemerval Zanella
2018-04-12 20:31                   ` Phil Blundell
2018-04-12 20:49                     ` Adhemerval Zanella
2018-04-13  9:56                       ` Phil Blundell
2018-04-13 11:56                         ` Adhemerval Zanella
2018-04-13 12:06                         ` Ramana Radhakrishnan [this message]
2018-04-13 12:44                           ` Phil Blundell
2018-04-13 14:40                             ` Adhemerval Zanella
2018-04-13 15:07                               ` Phil Blundell
2018-04-13 16:42                                 ` Adhemerval Zanella
2018-04-13 19:09                                   ` Phil Blundell
2018-04-13 20:12                                     ` Adhemerval Zanella
2018-04-16 14:16                                     ` Richard Earnshaw (lists)
2018-04-13 15:10 Wilco Dijkstra
2018-04-13 15:43 ` Wilco Dijkstra
2018-04-13 15:48   ` Florian Weimer

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=CAJA7tRbnGw1YR9R3wzcoepS52005m0dEDzLaY+k2ceUC4kC0PA@mail.gmail.com \
    --to=ramana.gcc@googlemail.com \
    --cc=adhemerval.zanella@linaro.org \
    --cc=libc-alpha@sourceware.org \
    --cc=pb@pbcl.net \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).