Commit Graph

61 Commits

Author SHA1 Message Date
Ryan Macnak dd7250323d Re-assign registers on ARM so PP and CODE_REG are below R7 (FP on iOS).
Also update descriptions of register availability in instrinsics.

1) Mechanical replacement in *arm.* files except the simulator and constants_arm.h (with sed).

R5 -> R9
R6 -> R8
R8 -> R10
R9 -> R5
R10 -> R6

2) Change register aliases.

CTX = R10 -> CTX = R6
PP = R9 -> PP = R5
ICREG = R5 -> ICREG = R9
CODE_REG = R10 -> CODE_REG = R6
THR = R8 -> THR = R10

3) Fixup users of ldrd/strd to have valid register pairs.

bigint_lsh
bigint_absadd
bigint_abssub
bigint_sqradd
TYPED_ARRAY_ALLOCATION
InlineArrayAllocation
AllocateArrayStub
AllocateContextStub

4) Fix PushList in MegamorphicMissStub to keep runtime call arguments in the right order.

BUG=http://dartbug.com/24683
R=fschneider@google.com

Review URL: https://codereview.chromium.org/1419223003 .
2015-10-26 11:05:32 -07:00
Ryan Macnak 1a34875064 Make arm assembler explicitly take both registers for load/store-pair.
R=zra@google.com

Review URL: https://codereview.chromium.org/1407393006 .
2015-10-23 10:16:32 -07:00
Florian Schneider 28c5ba6bdc VM: Simplify assembler test by removing unused parameter.
No need to pass a Context into assembler tests.

BUG=
R=srdjan@google.com

Review URL: https://codereview.chromium.org//1272223002 .
2015-08-06 10:24:14 +02:00
Daniel Andersson fd890f4097 Cache current thread in a reserved register and use it in LoadIsolate
Add THR register that caches the current thread in generated code.
Shuffle some registers around as needed to free one up.

Note: Assembler::LoadIsolate now always loads the *current* isolate whenever the code is executed, rather than the isolate in which the code was compiled (no existing code was affected by this slight change in semantics).

Rewrite some ia32 stubs to use one less register, and for some ia32 bigint intrinsics, explicitly save THR (like CTX in the past, see r44699).

Next steps:
- pass current thread rather than isolate in NativeArguments
- ditto for exception handler jump
- migrate fields vm_tag, top_exit_frame_info, etc. to thread

R=srdjan@google.com

Review URL: https://codereview.chromium.org//1156593002
2015-05-26 13:46:12 -07:00
zra@google.com 86bfd7cb30 Adds a simarmv5te build and test target.
Also:
- Removes command line flags to choose simulated arm version.
  I think we should use build targets instead, like in this change,
  to make building and testing more obvious.
- Skips pkg tests on all simulators.

R=regis@google.com, ricow@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45181 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-15 20:44:43 +00:00
zra@google.com 9eaea2e779 Fixes ARM instruction version checking.
Emulates umaal on ARMv5TE.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44940 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-07 17:36:46 +00:00
zra@google.com b253b7c2ba A few fixes for ARMv5TE.
This CL:
- Adds SupportsHardwareDivision() to FlowGraphCompiler.
  In FlowGraphOptimizer, if SupportsHardwareDivision()
  is false, Smi and Mint division operations are not
  inlined.
- Reduces the supported addressing modes for ldrd, strd.
  For ARMv6 and up, the address only needs to be 4-byte
  aligned, for ARMv5TE and below the address must be
  8-byte aligned. So, on ARMv5TE, we can split these
  each into two instructions, which is easier to do if
  the addressing modes are restricted to base + offset,
  which is all we were using anyway.
- Uses the smull instruction on ARMv5TE and ARMv6. I don't
  remember why it was disabled, and the docs say
  it is supported. Verified working on ARMv5TE hardware.
- Fixes a bug in OSR frame entry caused by the
  difference between the PC read offset in store vs.
  other instructions.
- Fixes assembler tests that have a float return for
  targets without vfp.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44788 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-30 20:46:52 +00:00
fschneider@google.com df94b27666 VM: Align implementations of assembler constant pools.
Add Support for adding patchable/non-patchable entries on ARM/MIPS like
already done for x64/ARM64.

R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43589 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-09 11:47:36 +00:00
vegorov@google.com aa48bd4759 Range feedback for arithmetic operations.
In addition to tracking input and output ranges in the IC-stubs with a Smi fastpath (SmiAdd and SmiSub, currently) this CL also introduces two IC stubs that have no fast-path by still track ranges and update the range feedback.

We are able to distinguish between the following ranges (encoding of the lattice is shown in the parens):

- u-smi  (0000)
- smi    (0001)
- uint31 (0010)
- int32  (0011)
- uint32 (0100)
- int64  (1xxx) and (x1x1)

BUG=
R=fschneider@google.com, srdjan@google.com, zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42370 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-15 18:48:15 +00:00
regis@google.com fa35913e91 Fix expected value in arm assembler test.
Review URL: https://codereview.chromium.org//639973002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40994 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-08 17:47:55 +00:00
regis@google.com 632edf5d55 Implement bigint mulAdd and sqrAdd intrinsics on ARM.
Add support for umaal instruction on ARM (assembler, disassembler, simulator).
Add assembler test for umaal instruction on ARM.

R=johnmccutchan@google.com, zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40993 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-08 16:59:59 +00:00
regis@google.com b7120c779c Fix carry out calculation in ARM simulator.
Add a regression test.
Simplify overflow calculation in ARM simulator.

R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40918 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-06 07:12:15 +00:00
zra@google.com 240afa6afa Expands the use of Immediate and Operand wrappers.
Since Register is an enum type, it is automatically
coerced to integer types when passed as a parameter to
functions expecting an integer argument. This change
expands the use of Immediate and Operand wrappers
for Assembler instructions and macros to avoid this
automatic coercion.

I've also added dummy constructors to Address and
FieldAddress classes to address the same problem,
but in a way that does not increase verbosity,
since Address and FieldAddress are much more
prevalent in the code.

A cleaner solution would involve making Register
no longer coercable to integer types, but this
would likely require many changes to the Assemblers.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40905 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-03 19:46:24 +00:00
jgruber@google.com 7d012105b5 Mark typedefs as unused to fix build failure
BUG=
R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40869 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-02 09:31:13 +00:00
zra@google.com dba0530c27 Adds back arm ldrex strex.
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40865 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-02 02:41:08 +00:00
iposva@google.com cc13627fc8 - Remove Isolate::CurrentAddress().
- Remove use of INFINITY and -INFINITY.

R=rmacnak@google.com, srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40700 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-25 23:39:30 +00:00
zra@google.com c6f380ed3d Avoids vmovsr on ARM.
R=johnmccutchan@google.com, regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40696 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-25 22:09:26 +00:00
rmacnak@google.com d72161731e Satisfy new -Wunused-local-typedefs in gcc 4.8 in the simulators.
R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37823 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-30 17:02:58 +00:00
regis@google.com 8ece446e5a Rename ShifterOperand to Operand on ARM.
R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36719 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-27 23:18:17 +00:00
johnmccutchan@google.com 8f4cbeaefa Use GPRs for mints.
Changes:

* Register allocator now allocates GPRs for kUnboxedMint.
* Register allocator supports for SameAsFirstInput for register pairs.
* Register allocator properly handles register pairs in environment uses and materialization uses.
* BoxInteger updated on IA32/ARM.
* UnboxInteger updated on IA32/ARM.
* BinaryMintOp updated on IA32/ARM.
* ShiftMintOp updated on IA32/ARM.
* UnaryMintOp updated on IA32/ARM.
* RelationalOp updated on IA32/ARM.
* EqualityCompare updated on IA32/ARM.
* LoadIndexed and StoreIndexed updated on IA32/ARM.
* New Deopt instructions added.
* Update live_registers when an instruction has a fixed register input and a call on the slow path.
* Improve printing of register pairs in flow graph.
* Do not assume live registers in slow paths contain tagged values.
* LiveRange pairs for kUnboxedMint definitions marked as kUntagged representation (reduces stack usage).
* Live register spilling on ARM uses same register order as stack map encoding.
* Spill slots containing tagged and untagged are segregated.
* Print stack maps when printing live ranges with safe points.
* Print allocated spill slot when printing live ranges.

Status:

* IA32 completed. All tests are passing.
* ARM completed. All tests passing.

R=fschneider@google.com, srdjan@google.com, zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36468 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-22 06:30:51 +00:00
zra@google.com b39bcf7bf6 Allows unboxed doubles to be disabled.
This helps to support ARMv5TE. Also adds asserts to
ensure that neon and vfp instructions are not generated
when those features are disabled on ARM.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36262 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-16 17:17:52 +00:00
zra@google.com 23e2b61eb8 For ARMv6, works around missing instructions.
mls, mla, umull, smull, etc. are not implemented on
all ARMv6's. This change works around them. For
mls and mla, we just use two instructions. smull
was used to check for overflow in mul, so we have
to do that manually. For umlal in the Random
intrinsic, we just fall through for now, though in
principal it wouldn't be hard to emulate.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35550 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-29 22:31:27 +00:00
zra@google.com 1c03aa73a8 Adds more arithmetic ops to arm64.
R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35024 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-14 17:03:04 +00:00
zra@google.com c323e2ac13 Implements unboxed Mints on ARM.
R=johnmccutchan@google.com, regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34256 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-21 16:26:21 +00:00
zra@google.com 7c91e88e6e Adds support for ARMv6.
When we detect ARMv6, instead of using movw and
movt, this change loads each individual byte.
Although this is not the best way to achieve this,
a modification to store large constants in the
object pool would be more invasive. Further,
this change will be easier to back-out once
ARMv6 is obsolete.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33442 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-07 19:17:36 +00:00
zra@google.com fd366da1cf Updates refactoring of CPU feature detection
with fix that uses cpuid for Intel/Linux.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32980 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-24 19:28:30 +00:00
zra@google.com 3693beeb6b Reverts refactoring of CPU feature detection for
assertion failure in Dartium.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32560 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-11 16:05:43 +00:00
zra@google.com 6f2096face Refactors some CPU feature detection into new class CpuInfo, and uses new information in VM service.
This change rewrites the code from the ARM assembler for parsing /proc/cpuinfo on Linux and Android, and collects it into a CpuInfo class that can be used for other architectures as well. This code is in cpuinfo_*.cc. /proc/cpuinfo equivalents are used for Mac and Windows. CpuInfo is used by the VM service to report on the hardware dart is running on. In the future CpuInfo can also be used here to provide more information.

R=iposva@google.com, johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32468 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-08 22:27:27 +00:00
srdjan@google.com e8bd77a6f4 Use 'fabs' instead of 'abs' where appropriate.
R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31436 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-02 23:55:37 +00:00
zra@google.com 3fd0e585d3 Fixes bug in far branches on MIPS.
Also increases test coverage of far branches on
ARM and MIPS.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31024 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-10 16:43:06 +00:00
zra@google.com a783459837 Preserves callee-saved FPU registers on ARM
Preserves callee-saved FPU registers on ARM when
going from C++ to Dart code. Adds assertions to
the simulator to make sure this is being done
correctly.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27072 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-03 18:23:43 +00:00
zra@google.com 8f3e8783f8 Implements the two argument shuffle SIMD instruction for ARM.
R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25638 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-30 20:49:22 +00:00
zra@google.com af23dfc5b2 Increases the number of ARM floating-point registers.
This is to be consistent with VFPv3_D32. Later, we'll detect
VFPv3_D16 at runtime.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25352 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-23 18:25:44 +00:00
zra@google.com dd9adc1a86 Adds more SIMD instructions for ARM.
Adds the vnegqs, vabsqs, and vandq instructions.

Also reverts the increase in the number of floating point registers since it is causing crashes on hardware.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25320 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-22 23:26:12 +00:00
zra@google.com 4b97f8c18c Adds reciprocal squre root SIMD instructions for ARM.
R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25291 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-22 18:19:44 +00:00
zra@google.com a15bac1044 Adds ARM SIMD instructions.
vminqs, maxqs, vrecpeqs (Reciprocal estimate), vrecpsqs (Reciprocal Newton-Raphson step).

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25245 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-19 21:32:03 +00:00
zra@google.com 18f6092d52 Implements ARM SIMD comparison instructions.
R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25189 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-18 22:56:45 +00:00
zra@google.com d886c10f6e Enables a SIMD test for ARM.
Required adding the veorq, vmovq, and vdup instructions.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25165 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-18 18:40:27 +00:00
zra@google.com 4731ad6b71 Adds the vtbl ARM SIMD instruction.
It is needed for the Float32x4ShuffleInstr of the intermediate language.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25073 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-16 21:18:26 +00:00
zra@google.com 3cebda38e6 Merges ARM load/store type enums into one enum.
R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25064 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-16 18:32:40 +00:00
zra@google.com 344b295eee Implements ARM SIMD multiplication and subtraction instructions.
R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25052 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-16 16:13:56 +00:00
zra@google.com f219f81b14 Begins implementation of ARM neon instructions.
Just adds the vadd instruction, but also changes the
arm assembler to expose the Q registers rather than the
D registers. Q0 = D1:D0 = S3:S2:S1:S0. This is similar
to how ia32 and x64 use only the xmm registers for
floating point.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24982 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-12 23:22:50 +00:00
zra@google.com 98fee55e2c Fixes ARM assembler test for hardware.
R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24639 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-01 18:37:10 +00:00
zra@google.com f86d2ec1b4 Adds support for integer division for ARM chips without the sdiv instruction.
R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24635 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-01 17:44:09 +00:00
zra@google.com 8edda78ccc Enables more tests for SIMMIPS.
. Fixes register allocation bugs
. Implements float <-> double conversion in assembler and simulator.
. Fixes floating point argument passing for simarm and simmips,
  and floating point return for simarm, and adjusts tests to match.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24365 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-24 20:16:16 +00:00
zra@google.com 7718086a5f Fixes small ARM bugs, and updates status files.
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23718 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-06 21:52:26 +00:00
regis@google.com 77417c2f49 Implement a few more features on ARM.
The vm tests byte_array_test and byte_array_optimized_test still fail due to
an inlining bug on ARM.

R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23370 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-29 23:12:20 +00:00
zra@google.com e5229295a0 Removes ARM mrc instruction.
It is a privileged instruction and was only being used in tests
running on the simulator.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23367 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-29 21:31:27 +00:00
zra@google.com 26fa41d1b1 Implements intrinsics for ARM.
R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23311 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-28 22:55:51 +00:00
zra@google.com fabc87d633 Fixes for integer division on ARM hardware so that assembler tests pass.
Now, all VM tests that pass on SIMARM, pass on ARM.

Also, more assertions in the ARM disassembler and simulator to
make sure that condition codes aren't used with bkpt.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22471 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-07 18:21:18 +00:00