Commit ec612537 authored by baptiste.afsa's avatar baptiste.afsa Committed by Commit bot

Enable ARMv8 32-bit build.

R=danno@chromium.org

Review URL: https://codereview.chromium.org/1427003006

Cr-Commit-Position: refs/heads/master@{#31690}
parent 961fef2d
......@@ -52,6 +52,14 @@ namespace internal {
// snapshot.
static unsigned CpuFeaturesImpliedByCompiler() {
unsigned answer = 0;
#ifdef CAN_USE_ARMV8_INSTRUCTIONS
if (FLAG_enable_armv8) {
answer |= 1u << ARMv8;
// ARMv8 always features VFP and NEON.
answer |= 1u << ARMv7 | 1u << VFP3 | 1u << NEON | 1u << VFP32DREGS;
answer |= 1u << SUDIV | 1u << MLS;
}
#endif // CAN_USE_ARMV8_INSTRUCTIONS
#ifdef CAN_USE_ARMV7_INSTRUCTIONS
if (FLAG_enable_armv7) answer |= 1u << ARMv7;
#endif // CAN_USE_ARMV7_INSTRUCTIONS
......@@ -81,6 +89,13 @@ void CpuFeatures::ProbeImpl(bool cross_compile) {
#ifndef __arm__
// For the simulator build, use whatever the flags specify.
if (FLAG_enable_armv8) {
supported_ |= 1u << ARMv8;
// ARMv8 always features VFP and NEON.
supported_ |= 1u << ARMv7 | 1u << VFP3 | 1u << NEON | 1u << VFP32DREGS;
supported_ |= 1u << SUDIV | 1u << MLS;
if (FLAG_enable_movw_movt) supported_ |= 1u << MOVW_MOVT_IMMEDIATE_LOADS;
}
if (FLAG_enable_armv7) {
supported_ |= 1u << ARMv7;
if (FLAG_enable_vfp3) supported_ |= 1u << VFP3;
......@@ -154,7 +169,9 @@ void CpuFeatures::PrintTarget() {
arm_no_probe = " noprobe";
#endif
#if defined CAN_USE_ARMV7_INSTRUCTIONS
#if defined CAN_USE_ARMV8_INSTRUCTIONS
arm_arch = "arm v8";
#elif defined CAN_USE_ARMV7_INSTRUCTIONS
arm_arch = "arm v7";
#else
arm_arch = "arm v6";
......@@ -192,13 +209,15 @@ void CpuFeatures::PrintTarget() {
void CpuFeatures::PrintFeatures() {
printf(
"ARMv7=%d VFP3=%d VFP32DREGS=%d NEON=%d SUDIV=%d UNALIGNED_ACCESSES=%d "
"MOVW_MOVT_IMMEDIATE_LOADS=%d COHERENT_CACHE=%d",
"ARMv8=%d ARMv7=%d VFP3=%d VFP32DREGS=%d NEON=%d SUDIV=%d MLS=%d"
"UNALIGNED_ACCESSES=%d MOVW_MOVT_IMMEDIATE_LOADS=%d COHERENT_CACHE=%d",
CpuFeatures::IsSupported(ARMv8),
CpuFeatures::IsSupported(ARMv7),
CpuFeatures::IsSupported(VFP3),
CpuFeatures::IsSupported(VFP32DREGS),
CpuFeatures::IsSupported(NEON),
CpuFeatures::IsSupported(SUDIV),
CpuFeatures::IsSupported(MLS),
CpuFeatures::IsSupported(UNALIGNED_ACCESSES),
CpuFeatures::IsSupported(MOVW_MOVT_IMMEDIATE_LOADS),
CpuFeatures::IsSupported(COHERENT_CACHE));
......
......@@ -68,6 +68,10 @@
# endif
#endif
#if defined(__ARM_ARCH_8A__)
# define CAN_USE_ARMV8_INSTRUCTIONS 1
#endif
// Target architecture detection. This may be set externally. If not, detect
// in the same way as the host architecture, that is, target the native
......
......@@ -519,6 +519,12 @@ DEFINE_BOOL(force_long_branches, false,
"force all emitted branches to be in long mode (MIPS/PPC only)")
DEFINE_STRING(mcpu, "auto", "enable optimization for specific cpu")
DEFINE_IMPLICATION(enable_armv8, enable_vfp3)
DEFINE_IMPLICATION(enable_armv8, enable_neon)
DEFINE_IMPLICATION(enable_armv8, enable_32dregs)
DEFINE_IMPLICATION(enable_armv8, enable_sudiv)
DEFINE_IMPLICATION(enable_armv8, enable_mls)
// bootstrapper.cc
DEFINE_STRING(expose_natives_as, NULL, "expose natives in global object")
DEFINE_STRING(expose_debug_as, NULL, "expose debug in global object")
......
......@@ -1975,8 +1975,16 @@ TEST(ARMv8_vrintX) {
CHECK_VRINT(inf, inf, inf, inf, inf, inf)
CHECK_VRINT(-inf, -inf, -inf, -inf, -inf, -inf)
CHECK_VRINT(-0.0, -0.0, -0.0, -0.0, -0.0, -0.0)
// Check NaN propagation.
double nan = std::numeric_limits<double>::quiet_NaN();
CHECK_VRINT(nan, nan, nan, nan, nan, nan)
t.input = nan;
dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0);
CHECK_EQ(bit_cast<int64_t>(nan), bit_cast<int64_t>(t.ar));
CHECK_EQ(bit_cast<int64_t>(nan), bit_cast<int64_t>(t.nr));
CHECK_EQ(bit_cast<int64_t>(nan), bit_cast<int64_t>(t.mr));
CHECK_EQ(bit_cast<int64_t>(nan), bit_cast<int64_t>(t.pr));
CHECK_EQ(bit_cast<int64_t>(nan), bit_cast<int64_t>(t.zr));
#undef CHECK_VRINT
}
......
......@@ -26,6 +26,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Flags: --allow-natives-syntax --nouse-inlining --noenable-sudiv
// Flags: --noenable-armv8
// Use this function as reference. Make sure it is not inlined.
function div(a, b) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment