Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(694)

Unified Diff: runtime/vm/assembler_arm_test.cc

Issue 120723003: Refactors CPU feature detection. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: runtime/vm/assembler_arm_test.cc
===================================================================
--- runtime/vm/assembler_arm_test.cc (revision 32467)
+++ runtime/vm/assembler_arm_test.cc (working copy)
@@ -6,6 +6,7 @@
#if defined(TARGET_ARCH_ARM)
#include "vm/assembler.h"
+#include "vm/cpu.h"
#include "vm/os.h"
#include "vm/unit_test.h"
#include "vm/virtual_memory.h"
@@ -1457,7 +1458,7 @@
ASSEMBLER_TEST_GENERATE(Udiv, assembler) {
- if (CPUFeatures::integer_division_supported()) {
+ if (TargetCPUFeatures::integer_division_supported()) {
__ mov(R0, ShifterOperand(27));
__ mov(R1, ShifterOperand(9));
__ udiv(R2, R0, R1);
@@ -1477,7 +1478,7 @@
ASSEMBLER_TEST_GENERATE(Sdiv, assembler) {
- if (CPUFeatures::integer_division_supported()) {
+ if (TargetCPUFeatures::integer_division_supported()) {
__ mov(R0, ShifterOperand(27));
__ LoadImmediate(R1, -9);
__ sdiv(R2, R0, R1);
@@ -1497,7 +1498,7 @@
ASSEMBLER_TEST_GENERATE(Udiv_zero, assembler) {
- if (CPUFeatures::integer_division_supported()) {
+ if (TargetCPUFeatures::integer_division_supported()) {
__ mov(R0, ShifterOperand(27));
__ mov(R1, ShifterOperand(0));
__ udiv(R2, R0, R1);
@@ -1517,7 +1518,7 @@
ASSEMBLER_TEST_GENERATE(Sdiv_zero, assembler) {
- if (CPUFeatures::integer_division_supported()) {
+ if (TargetCPUFeatures::integer_division_supported()) {
__ mov(R0, ShifterOperand(27));
__ mov(R1, ShifterOperand(0));
__ udiv(R2, R0, R1);
@@ -1537,7 +1538,7 @@
ASSEMBLER_TEST_GENERATE(Udiv_corner, assembler) {
- if (CPUFeatures::integer_division_supported()) {
+ if (TargetCPUFeatures::integer_division_supported()) {
__ LoadImmediate(R0, 0x80000000);
__ LoadImmediate(R1, 0xffffffff);
__ udiv(R2, R0, R1);
@@ -1557,7 +1558,7 @@
ASSEMBLER_TEST_GENERATE(Sdiv_corner, assembler) {
- if (CPUFeatures::integer_division_supported()) {
+ if (TargetCPUFeatures::integer_division_supported()) {
__ LoadImmediate(R0, 0x80000000);
__ LoadImmediate(R1, 0xffffffff);
__ sdiv(R2, R0, R1);
@@ -1579,12 +1580,12 @@
ASSEMBLER_TEST_GENERATE(IntDiv_supported, assembler) {
#if defined(USING_SIMULATOR)
- bool orig = CPUFeatures::integer_division_supported();
- CPUFeatures::set_integer_division_supported(true);
+ bool orig = TargetCPUFeatures::integer_division_supported();
+ HostCPUFeatures::set_integer_division_supported(true);
__ mov(R0, ShifterOperand(27));
__ mov(R1, ShifterOperand(9));
__ IntegerDivide(R0, R0, R1, D0, D1);
- CPUFeatures::set_integer_division_supported(orig);
+ HostCPUFeatures::set_integer_division_supported(orig);
__ bx(LR);
#else
__ mov(R0, ShifterOperand(27));
@@ -1604,12 +1605,12 @@
ASSEMBLER_TEST_GENERATE(IntDiv_unsupported, assembler) {
#if defined(USING_SIMULATOR)
- bool orig = CPUFeatures::integer_division_supported();
- CPUFeatures::set_integer_division_supported(false);
+ bool orig = TargetCPUFeatures::integer_division_supported();
+ HostCPUFeatures::set_integer_division_supported(false);
__ mov(R0, ShifterOperand(27));
__ mov(R1, ShifterOperand(9));
__ IntegerDivide(R0, R0, R1, D0, D1);
- CPUFeatures::set_integer_division_supported(orig);
+ HostCPUFeatures::set_integer_division_supported(orig);
__ bx(LR);
#else
__ mov(R0, ShifterOperand(27));
@@ -1644,7 +1645,7 @@
ASSEMBLER_TEST_GENERATE(Vaddqi8, assembler) {
- if (CPUFeatures::neon_supported()) {
+ if (TargetCPUFeatures::neon_supported()) {
__ mov(R0, ShifterOperand(1));
__ vmovsr(S0, R0);
__ mov(R0, ShifterOperand(2));
@@ -1688,7 +1689,7 @@
ASSEMBLER_TEST_GENERATE(Vaddqi16, assembler) {
- if (CPUFeatures::neon_supported()) {
+ if (TargetCPUFeatures::neon_supported()) {
__ mov(R0, ShifterOperand(1));
__ vmovsr(S0, R0);
__ mov(R0, ShifterOperand(2));
@@ -1732,7 +1733,7 @@
ASSEMBLER_TEST_GENERATE(Vaddqi32, assembler) {
- if (CPUFeatures::neon_supported()) {
+ if (TargetCPUFeatures::neon_supported()) {
__ mov(R0, ShifterOperand(1));
__ vmovsr(S0, R0);
__ mov(R0, ShifterOperand(2));
@@ -1776,7 +1777,7 @@
ASSEMBLER_TEST_GENERATE(Vaddqi64, assembler) {
- if (CPUFeatures::neon_supported()) {
+ if (TargetCPUFeatures::neon_supported()) {
__ mov(R0, ShifterOperand(1));
__ vmovsr(S0, R0);
__ mov(R0, ShifterOperand(2));
@@ -1808,7 +1809,7 @@
ASSEMBLER_TEST_GENERATE(Vsubqi8, assembler) {
- if (CPUFeatures::neon_supported()) {
+ if (TargetCPUFeatures::neon_supported()) {
__ mov(R0, ShifterOperand(1));
__ vmovsr(S0, R0);
__ mov(R0, ShifterOperand(2));
@@ -1852,7 +1853,7 @@
ASSEMBLER_TEST_GENERATE(Vsubqi16, assembler) {
- if (CPUFeatures::neon_supported()) {
+ if (TargetCPUFeatures::neon_supported()) {
__ mov(R0, ShifterOperand(1));
__ vmovsr(S0, R0);
__ mov(R0, ShifterOperand(2));
@@ -1896,7 +1897,7 @@
ASSEMBLER_TEST_GENERATE(Vsubqi32, assembler) {
- if (CPUFeatures::neon_supported()) {
+ if (TargetCPUFeatures::neon_supported()) {
__ mov(R0, ShifterOperand(1));
__ vmovsr(S0, R0);
__ mov(R0, ShifterOperand(2));
@@ -1940,7 +1941,7 @@
ASSEMBLER_TEST_GENERATE(Vsubqi64, assembler) {
- if (CPUFeatures::neon_supported()) {
+ if (TargetCPUFeatures::neon_supported()) {
__ mov(R0, ShifterOperand(1));
__ vmovsr(S0, R0);
__ mov(R0, ShifterOperand(2));
@@ -1972,7 +1973,7 @@
ASSEMBLER_TEST_GENERATE(Vmulqi8, assembler) {
- if (CPUFeatures::neon_supported()) {
+ if (TargetCPUFeatures::neon_supported()) {
__ mov(R0, ShifterOperand(1));
__ vmovsr(S0, R0);
__ mov(R0, ShifterOperand(2));
@@ -2016,7 +2017,7 @@
ASSEMBLER_TEST_GENERATE(Vmulqi16, assembler) {
- if (CPUFeatures::neon_supported()) {
+ if (TargetCPUFeatures::neon_supported()) {
__ mov(R0, ShifterOperand(1));
__ vmovsr(S0, R0);
__ mov(R0, ShifterOperand(2));
@@ -2060,7 +2061,7 @@
ASSEMBLER_TEST_GENERATE(Vmulqi32, assembler) {
- if (CPUFeatures::neon_supported()) {
+ if (TargetCPUFeatures::neon_supported()) {
__ mov(R0, ShifterOperand(1));
__ vmovsr(S0, R0);
__ mov(R0, ShifterOperand(2));
@@ -2104,7 +2105,7 @@
ASSEMBLER_TEST_GENERATE(Vaddqs, assembler) {
- if (CPUFeatures::neon_supported()) {
+ if (TargetCPUFeatures::neon_supported()) {
__ LoadSImmediate(S0, 1.0);
__ LoadSImmediate(S1, 2.0);
__ LoadSImmediate(S2, 3.0);
@@ -2139,7 +2140,7 @@
ASSEMBLER_TEST_GENERATE(Vsubqs, assembler) {
- if (CPUFeatures::neon_supported()) {
+ if (TargetCPUFeatures::neon_supported()) {
__ LoadSImmediate(S0, 1.0);
__ LoadSImmediate(S1, 2.0);
__ LoadSImmediate(S2, 3.0);
@@ -2174,7 +2175,7 @@
ASSEMBLER_TEST_GENERATE(Vmulqs, assembler) {
- if (CPUFeatures::neon_supported()) {
+ if (TargetCPUFeatures::neon_supported()) {
__ LoadSImmediate(S0, 1.0);
__ LoadSImmediate(S1, 2.0);
__ LoadSImmediate(S2, 3.0);
@@ -2209,7 +2210,7 @@
ASSEMBLER_TEST_GENERATE(VtblX, assembler) {
- if (CPUFeatures::neon_supported()) {
+ if (TargetCPUFeatures::neon_supported()) {
// Index.
__ LoadImmediate(R0, 0x03020100);
__ vmovsr(S0, R0);
@@ -2252,7 +2253,7 @@
ASSEMBLER_TEST_GENERATE(VtblY, assembler) {
- if (CPUFeatures::neon_supported()) {
+ if (TargetCPUFeatures::neon_supported()) {
// Index.
__ LoadImmediate(R0, 0x07060504);
__ vmovsr(S0, R0);
@@ -2295,7 +2296,7 @@
ASSEMBLER_TEST_GENERATE(VtblZ, assembler) {
- if (CPUFeatures::neon_supported()) {
+ if (TargetCPUFeatures::neon_supported()) {
// Index.
__ LoadImmediate(R0, 0x0b0a0908);
__ vmovsr(S0, R0);
@@ -2338,7 +2339,7 @@
ASSEMBLER_TEST_GENERATE(VtblW, assembler) {
- if (CPUFeatures::neon_supported()) {
+ if (TargetCPUFeatures::neon_supported()) {
// Index.
__ LoadImmediate(R0, 0x0f0e0d0c);
__ vmovsr(S0, R0);
@@ -2381,7 +2382,7 @@
ASSEMBLER_TEST_GENERATE(Veorq, assembler) {
- if (CPUFeatures::neon_supported()) {
+ if (TargetCPUFeatures::neon_supported()) {
// Q0
__ LoadImmediate(R0, 0xaaaaaaab);
__ vmovsr(S0, R0);
@@ -2423,7 +2424,7 @@
ASSEMBLER_TEST_GENERATE(Vornq, assembler) {
- if (CPUFeatures::neon_supported()) {
+ if (TargetCPUFeatures::neon_supported()) {
// Q0
__ LoadImmediate(R0, 0xfffffff0);
__ vmovsr(S0, R0);
@@ -2465,7 +2466,7 @@
ASSEMBLER_TEST_GENERATE(Vorrq, assembler) {
- if (CPUFeatures::neon_supported()) {
+ if (TargetCPUFeatures::neon_supported()) {
// Q0
__ LoadImmediate(R0, 0xaaaaaaaa);
__ vmovsr(S0, R0);
@@ -2507,7 +2508,7 @@
ASSEMBLER_TEST_GENERATE(Vandq, assembler) {
- if (CPUFeatures::neon_supported()) {
+ if (TargetCPUFeatures::neon_supported()) {
// Q0
__ LoadImmediate(R0, 0xaaaaaaab);
__ vmovsr(S0, R0);
@@ -2549,7 +2550,7 @@
ASSEMBLER_TEST_GENERATE(Vmovq, assembler) {
- if (CPUFeatures::neon_supported()) {
+ if (TargetCPUFeatures::neon_supported()) {
// Q0
__ LoadSImmediate(S0, 1.0);
__ vmovs(S1, S0);
@@ -2587,7 +2588,7 @@
ASSEMBLER_TEST_GENERATE(Vdupb, assembler) {
- if (CPUFeatures::neon_supported()) {
+ if (TargetCPUFeatures::neon_supported()) {
__ LoadImmediate(R0, 0x00000000);
__ LoadImmediate(R1, 0x00ff0000);
__ vmovsr(S4, R0);
@@ -2620,7 +2621,7 @@
ASSEMBLER_TEST_GENERATE(Vduph, assembler) {
- if (CPUFeatures::neon_supported()) {
+ if (TargetCPUFeatures::neon_supported()) {
__ LoadImmediate(R0, 0xffff0000);
__ LoadImmediate(R1, 0x00000000);
__ vmovsr(S4, R0);
@@ -2653,7 +2654,7 @@
ASSEMBLER_TEST_GENERATE(Vdupw, assembler) {
- if (CPUFeatures::neon_supported()) {
+ if (TargetCPUFeatures::neon_supported()) {
__ LoadImmediate(R0, 0x00000000);
__ LoadImmediate(R1, 0xffffffff);
__ vmovsr(S4, R0);
@@ -2686,7 +2687,7 @@
ASSEMBLER_TEST_GENERATE(Vzipqw, assembler) {
- if (CPUFeatures::neon_supported()) {
+ if (TargetCPUFeatures::neon_supported()) {
__ LoadSImmediate(S0, 0.0);
__ LoadSImmediate(S1, 1.0);
__ LoadSImmediate(S2, 2.0);
@@ -2720,7 +2721,7 @@
ASSEMBLER_TEST_GENERATE(Vceqqi32, assembler) {
- if (CPUFeatures::neon_supported()) {
+ if (TargetCPUFeatures::neon_supported()) {
__ mov(R0, ShifterOperand(1));
__ vmovsr(S0, R0);
__ mov(R0, ShifterOperand(2));
@@ -2764,7 +2765,7 @@
ASSEMBLER_TEST_GENERATE(Vceqqs, assembler) {
- if (CPUFeatures::neon_supported()) {
+ if (TargetCPUFeatures::neon_supported()) {
__ LoadSImmediate(S0, 1.0);
__ LoadSImmediate(S1, 2.0);
__ LoadSImmediate(S2, 3.0);
@@ -2800,7 +2801,7 @@
ASSEMBLER_TEST_GENERATE(Vcgeqi32, assembler) {
- if (CPUFeatures::neon_supported()) {
+ if (TargetCPUFeatures::neon_supported()) {
__ mov(R0, ShifterOperand(1));
__ vmovsr(S0, R0);
__ mov(R0, ShifterOperand(2));
@@ -2844,7 +2845,7 @@
ASSEMBLER_TEST_GENERATE(Vcugeqi32, assembler) {
- if (CPUFeatures::neon_supported()) {
+ if (TargetCPUFeatures::neon_supported()) {
__ mov(R0, ShifterOperand(1));
__ vmovsr(S0, R0);
__ mov(R0, ShifterOperand(2));
@@ -2888,7 +2889,7 @@
ASSEMBLER_TEST_GENERATE(Vcgeqs, assembler) {
- if (CPUFeatures::neon_supported()) {
+ if (TargetCPUFeatures::neon_supported()) {
__ LoadSImmediate(S0, 1.0);
__ LoadSImmediate(S1, 2.0);
__ LoadSImmediate(S2, 3.0);
@@ -2924,7 +2925,7 @@
ASSEMBLER_TEST_GENERATE(Vcgtqi32, assembler) {
- if (CPUFeatures::neon_supported()) {
+ if (TargetCPUFeatures::neon_supported()) {
__ mov(R0, ShifterOperand(1));
__ vmovsr(S0, R0);
__ mov(R0, ShifterOperand(2));
@@ -2968,7 +2969,7 @@
ASSEMBLER_TEST_GENERATE(Vcugtqi32, assembler) {
- if (CPUFeatures::neon_supported()) {
+ if (TargetCPUFeatures::neon_supported()) {
__ mov(R0, ShifterOperand(1));
__ vmovsr(S0, R0);
__ mov(R0, ShifterOperand(2));
@@ -3012,7 +3013,7 @@
ASSEMBLER_TEST_GENERATE(Vcgtqs, assembler) {
- if (CPUFeatures::neon_supported()) {
+ if (TargetCPUFeatures::neon_supported()) {
__ LoadSImmediate(S0, 1.0);
__ LoadSImmediate(S1, 2.0);
__ LoadSImmediate(S2, 3.0);
@@ -3048,7 +3049,7 @@
ASSEMBLER_TEST_GENERATE(Vminqs, assembler) {
- if (CPUFeatures::neon_supported()) {
+ if (TargetCPUFeatures::neon_supported()) {
__ LoadSImmediate(S0, 1.0);
__ LoadSImmediate(S1, 2.0);
__ LoadSImmediate(S2, 3.0);
@@ -3083,7 +3084,7 @@
ASSEMBLER_TEST_GENERATE(Vmaxqs, assembler) {
- if (CPUFeatures::neon_supported()) {
+ if (TargetCPUFeatures::neon_supported()) {
__ LoadSImmediate(S0, 1.0);
__ LoadSImmediate(S1, 2.0);
__ LoadSImmediate(S2, 3.0);
@@ -3153,7 +3154,7 @@
ASSEMBLER_TEST_GENERATE(Vrecpeqs, assembler) {
- if (CPUFeatures::neon_supported()) {
+ if (TargetCPUFeatures::neon_supported()) {
__ LoadSImmediate(S4, 147.0);
__ vmovs(S5, S4);
__ vmovs(S6, S4);
@@ -3178,7 +3179,7 @@
ASSEMBLER_TEST_GENERATE(Vrecpsqs, assembler) {
- if (CPUFeatures::neon_supported()) {
+ if (TargetCPUFeatures::neon_supported()) {
__ LoadSImmediate(S4, 5.0);
__ LoadSImmediate(S5, 2.0);
__ LoadSImmediate(S6, 3.0);
@@ -3208,7 +3209,7 @@
ASSEMBLER_TEST_GENERATE(Reciprocal, assembler) {
- if (CPUFeatures::neon_supported()) {
+ if (TargetCPUFeatures::neon_supported()) {
__ LoadSImmediate(S4, 147000.0);
__ vmovs(S5, S4);
__ vmovs(S6, S4);
@@ -3290,7 +3291,7 @@
ASSEMBLER_TEST_GENERATE(Vrsqrteqs, assembler) {
- if (CPUFeatures::neon_supported()) {
+ if (TargetCPUFeatures::neon_supported()) {
__ LoadSImmediate(S4, 147.0);
__ vmovs(S5, S4);
__ vmovs(S6, S4);
@@ -3315,7 +3316,7 @@
ASSEMBLER_TEST_GENERATE(Vrsqrtsqs, assembler) {
- if (CPUFeatures::neon_supported()) {
+ if (TargetCPUFeatures::neon_supported()) {
__ LoadSImmediate(S4, 5.0);
__ LoadSImmediate(S5, 2.0);
__ LoadSImmediate(S6, 3.0);
@@ -3345,7 +3346,7 @@
ASSEMBLER_TEST_GENERATE(ReciprocalSqrt, assembler) {
- if (CPUFeatures::neon_supported()) {
+ if (TargetCPUFeatures::neon_supported()) {
__ LoadSImmediate(S4, 147000.0);
__ vmovs(S5, S4);
__ vmovs(S6, S4);
@@ -3380,7 +3381,7 @@
ASSEMBLER_TEST_GENERATE(SIMDSqrt, assembler) {
- if (CPUFeatures::neon_supported()) {
+ if (TargetCPUFeatures::neon_supported()) {
__ LoadSImmediate(S4, 147000.0);
__ vmovs(S5, S4);
__ vmovs(S6, S4);
@@ -3425,7 +3426,7 @@
ASSEMBLER_TEST_GENERATE(SIMDSqrt2, assembler) {
- if (CPUFeatures::neon_supported()) {
+ if (TargetCPUFeatures::neon_supported()) {
__ LoadSImmediate(S4, 1.0);
__ LoadSImmediate(S5, 4.0);
__ LoadSImmediate(S6, 9.0);
@@ -3474,7 +3475,7 @@
ASSEMBLER_TEST_GENERATE(SIMDDiv, assembler) {
- if (CPUFeatures::neon_supported()) {
+ if (TargetCPUFeatures::neon_supported()) {
__ LoadSImmediate(S4, 1.0);
__ LoadSImmediate(S5, 4.0);
__ LoadSImmediate(S6, 9.0);
@@ -3515,7 +3516,7 @@
ASSEMBLER_TEST_GENERATE(Vabsqs, assembler) {
- if (CPUFeatures::neon_supported()) {
+ if (TargetCPUFeatures::neon_supported()) {
__ LoadSImmediate(S4, 1.0);
__ LoadSImmediate(S5, -1.0);
__ LoadSImmediate(S6, 1.0);
@@ -3544,7 +3545,7 @@
ASSEMBLER_TEST_GENERATE(Vnegqs, assembler) {
- if (CPUFeatures::neon_supported()) {
+ if (TargetCPUFeatures::neon_supported()) {
__ LoadSImmediate(S4, 1.0);
__ LoadSImmediate(S5, -2.0);
__ LoadSImmediate(S6, 1.0);

Powered by Google App Engine
This is Rietveld 408576698