Flutter Engine
The Flutter Engine
constants_riscv.cc
Go to the documentation of this file.
1// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
2// for details. All rights reserved. Use of this source code is governed by a
3// BSD-style license that can be found in the LICENSE file.
4
5#include "platform/globals.h" // NOLINT
6
7#if defined(TARGET_ARCH_RISCV32) || defined(TARGET_ARCH_RISCV64)
8
9#include "vm/constants.h" // NOLINT
10
11namespace dart {
12
13#if !defined(FFI_UNIT_TESTS)
14DEFINE_FLAG(bool,
15 use_compressed_instructions,
16 true,
17 "Use instructions from the C extension");
18#endif
19
20const char* const cpu_reg_names[kNumberOfCpuRegisters] = {
21 "zero", "ra", "sp", "gp", "tp", "t0", "t1", "t2", "fp", "thr", "a0",
22 "a1", "a2", "tmp", "tmp2", "pp", "a6", "a7", "s2", "s3", "s4", "s5",
23 "s6", "s7", "s8", "s9", "null", "wbs", "t3", "t4", "t5", "t6",
24};
25
26const char* const cpu_reg_abi_names[kNumberOfCpuRegisters] = {
27 "zero", "ra", "sp", "gp", "tp", "t0", "t1", "t2", "s0", "s1", "a0",
28 "a1", "a2", "a3", "a4", "a5", "a6", "a7", "s2", "s3", "s4", "s5",
29 "s6", "s7", "s8", "s9", "s10", "s11", "t3", "t4", "t5", "t6",
30};
31
32const char* const fpu_reg_names[kNumberOfFpuRegisters] = {
33 "ft0", "ft1", "ft2", "ft3", "ft4", "ft5", "ft6", "ft7",
34 "fs0", "fs1", "fa0", "fa1", "fa2", "fa3", "fa4", "fa5",
35 "fa6", "fa7", "fs2", "fs3", "fs4", "fs5", "fs6", "fs7",
36 "fs8", "fs9", "fs10", "fs11", "ft8", "ft9", "ft10", "ft11",
37};
38
40 // A3/A4/A5 are assigned to TMP/TMP2/PP. This assignment is important for
41 // reducing code size. To minimize distruption to the rest of the compiler,
42 // we tell the register allocator and marshaller use T3/T4/T5 for FFI calls,
43 // so they can make use of general moves that assume the availability of
44 // TMP/TMP2/PP, and only move them to A3/A4/A5 at the last momement in
45 // FfiCallInstr and CCallInstr (and NativeEntryInstr in the opposite
46 // direction).
47 A0, A1, A2, T3, T4, T5, A6, A7,
48};
49
51 FA0, FA1, FA2, FA3, FA4, FA5, FA6, FA7,
52};
53
54} // namespace dart
55
56#endif // defined(TARGET_ARCH_RISCV32) || defined(TARGET_ARCH_RISCV64)
static const FpuRegister FpuArgumentRegisters[]
static const Register ArgumentRegisters[]
Definition: dart_vm.cc:33
const char *const fpu_reg_names[kNumberOfFpuRegisters]
@ kNumberOfCpuRegisters
Definition: constants_arm.h:98
const int kNumberOfFpuRegisters
DEFINE_FLAG(bool, print_cluster_information, false, "Print information about clusters written to snapshot")
const char *const cpu_reg_names[kNumberOfCpuRegisters]
QRegister FpuRegister
const char *const cpu_reg_abi_names[kNumberOfCpuRegisters]