Commit graph

10 commits

Author SHA1 Message Date
Alexander Markov b80e682cbf [vm] Introduce --target-unknown-cpu option and use it for app-jit snapshots
App-jit and core-jit snapshots generated on one machine can be copied to
another machine with different CPU family/model, so it is incorrect to
use CPU features of the host machine to generate code for snapshots.

This change adds --target-unknown-cpu option and enables it when
generating app-jit and core-jit snapshots in standalone Dart VM and
gen_snapshot.

Currently, this flag disables SSE4.1, popcnt and ABM on ia32 and x64,
and integer division instruction on ARM. Also, new flag enables
testing of roundsd instruction availability at run time on x64
(similarly to AOT).

TEST=ci
Fixes https://github.com/dart-lang/sdk/issues/47907
Fixes https://github.com/flutter/flutter/issues/94181

Change-Id: Id28448052a21df4bae30b39e62b8532e55d4c901
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/223960
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2021-12-16 21:33:49 +00:00
Alexander Markov 15e5ec1762 [vm] Faster floor/ceil/truncate on JIT/x64
This change enables use of roundsd instruction on x64 if SSE4.1 is
detected (in JIT mode).

Also, XMM register is cleared before roundsd to avoid false dependency
due to partial register access in roundsd.

Microbenchmark results on JIT/x64:
Before: BenchFloor(RunTime): 303.81512987999395 us.
After:  BenchFloor(RunTime): 135.00067499156262 us.

Custom floor implementation in Dart:
BenchFastFloor(RunTime): 147.609889298893 us.

TEST=ci

Issue: https://github.com/dart-lang/sdk/issues/46650
Change-Id: I13502f5d40edf32916edec14cfab027758a22457
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209764
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2021-08-11 16:32:17 +00:00
Aart Bik 0ad30fafc1 [vm/assembler] Added cpufeatures, added LZCNT (IA32/X64)
Rationale:
We are adding library support for bit operations:
  lowZeroBitCount/highZeroBitCount/nonZeroBitCount
The added features will enable very efficient direct
native implementations of these operations in the
DartVM codegen.

https://github.com/dart-lang/sdk/issues/38346

Change-Id: Id734a7590666c6abdc2a683a240094c6bf6cd46a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117768
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2019-09-18 19:47:29 +00:00
Martin Kustermann a64b06ec83 [gardening] Migrate most files to be implicit-bool-conversion free
Issue https://dart-review.googlesource.com/c/sdk/+/115701

Change-Id: Ib579f0bbc8d694aec74afd837217316a10baf910
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115707
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2019-09-05 21:41:42 +00:00
Ben Konyi 07852532e3 [ VM ] Additional cleanup in Dart_Initialize and Dart_Cleanup
Change-Id: I6dc02b3d9de16cc176eb97613bc0c7f0bb9b16eb
Reviewed-on: https://dart-review.googlesource.com/77013
Commit-Queue: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
2018-09-28 23:18:59 +00:00
Zachary Anderson a1bcf051d8 clang-format runtime/vm
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2481873005 .
2016-11-08 13:54:47 -08:00
Zachary Anderson 103881d01c Make header include guards great again
i.e. #ifndef VM_WHATEVER -> #ifndef RUNTIME_VM_WHATEVER

This lets us remove a hack from the PRESUBMIT.py script that existed
for reasons that are no longer valid, and sets us up to add some
presubmit checks for the GN build.

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

Review URL: https://codereview.chromium.org/2450713004 .
2016-10-26 00:26:03 -07: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