New issue
Advanced search Search tips

Issue 670242 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug
Build-Toolchain

Blocking:
issue 665083



Sign in to add a comment

Use hardware integer divide instructions on ARM devices if possible

Project Member Reported by hashimoto@chromium.org, Dec 1 2016

Issue description

On ARM v7, integer divide instruction is optional so by default GCC uses software implementation.
At least, RK3288 supports sdiv/udiv instructions so we should use them.
 
cont. from the parent bug: https://bugs.chromium.org/p/chromium/issues/detail?id=665083#c31
> if we wanted to restrict ourselves to cortex-a15, we'd have to add -mcpu to the compiler flags.
I tried adding -mcpu=cortex-a15, but then GCC complained that "switch -mcpu=cortex-a15 conflicts with -march=armv7-a switch".
-march should be armv7ve if -mcpu is cortex-a15, but Chrome's build/config/arm.gni always adds -march=armv7-a.

At the same time, Clang does not recognize armv7ve as a valid value of -march.
So, to stop using __divdi3, we need to:
 1. Make -march configureble in Chrome's GN. https://codereview.chromium.org/2543953002/
 2. In veyron's make.conf, replace -march=armv7-a with -mcpu=cortex-a15 (which both GCC and Clang understand). https://chromium-review.googlesource.com/#/c/415809/
 3. Explicitly set -march=armv7ve in chromeos-chrome's ebuild to prohibit GN from appending -march=armv7-a. https://chromium-review.googlesource.com/#/c/415810/
Project Member

Comment 2 by bugdroid1@chromium.org, Dec 2 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/99cae1ee0ee6c49c0c3d276dbbb8a271d9a03bb4

commit 99cae1ee0ee6c49c0c3d276dbbb8a271d9a03bb4
Author: hashimoto <hashimoto@chromium.org>
Date: Fri Dec 02 06:14:34 2016

gn: Make arm_arch configurable

Chrome OS needs to use values like armv7ve and armv8-a+crc.

BUG=670242

Review-Url: https://codereview.chromium.org/2543953002
Cr-Commit-Position: refs/heads/master@{#435867}

[modify] https://crrev.com/99cae1ee0ee6c49c0c3d276dbbb8a271d9a03bb4/build/config/arm.gni

sounds like a bug that llvm doesn't accept armv7ve that should be fixed
about #3, hashimoto please file a bug with label build-toolchain and we can follow up on that.
Filed  issue 671089  for clang not accepting -march=armv7ve.
Project Member

Comment 6 by bugdroid1@chromium.org, Dec 15 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/33a72aa5341a8bfe4a773ac032b4461f24f2c81f

commit 33a72aa5341a8bfe4a773ac032b4461f24f2c81f
Author: Ryo Hashimoto <hashimoto@chromium.org>
Date: Thu Dec 01 10:25:40 2016

chromeos-chrome: Explicitly set arm_arch

GCC complains when -march set by Chrome's GN contradicts with -mcpu.

BUG=chromium:670242
TEST=build

Change-Id: I7a15a55c5cbe0dc317baff89cf3e95f7f5c144be
Reviewed-on: https://chromium-review.googlesource.com/415810
Commit-Ready: Ryo Hashimoto <hashimoto@chromium.org>
Tested-by: Ryo Hashimoto <hashimoto@chromium.org>
Reviewed-by: Luis Lozano <llozano@chromium.org>

[modify] https://crrev.com/33a72aa5341a8bfe4a773ac032b4461f24f2c81f/chromeos-base/chromeos-chrome/chromeos-chrome-9999.ebuild

Project Member

Comment 7 by bugdroid1@chromium.org, Dec 15 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/board-overlays/+/865f3a7b82e18447aaa15f9ceaf489807d48515a

commit 865f3a7b82e18447aaa15f9ceaf489807d48515a
Author: Ryo Hashimoto <hashimoto@chromium.org>
Date: Thu Dec 01 10:26:56 2016

veyron: Specify -mcpu=cortex-a12 in MARCH_TUNE

GCC complains -mcpu=cortex-a12 conflicts with -march=armv7-a,
while clang rejects -march=armv7ve as an invalid option.
It seems the only way to satisfy both is removing -march,
and specifying -mcpu only.

BUG=chromium:670242
TEST=build
CQ-DEPEND=CL:415810

Change-Id: Ife2f8687942f05e3ceb1099312ed3d13c303b2d1
Reviewed-on: https://chromium-review.googlesource.com/415809
Commit-Ready: Ryo Hashimoto <hashimoto@chromium.org>
Tested-by: Ryo Hashimoto <hashimoto@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/865f3a7b82e18447aaa15f9ceaf489807d48515a/overlay-veyron/make.conf

Components: Tools>ChromeOS-Toolchain

Sign in to add a comment