53 static int _icache_line_size;
54 static int _initial_sve_vector_length;
55 static int _max_supported_sve_vector_length;
56 static bool _rop_protection;
57 static uintptr_t _pac_mask;
58 // When _prefer_sve_merging_mode_cpy is true, `cpy (imm, zeroing)` is
59 // implemented as `movi; cpy(imm, merging)`.
60 static constexpr bool _prefer_sve_merging_mode_cpy = true;
61
62 static SpinWait _spin_wait;
63
64 // Read additional info using OS-specific interfaces
65 static void get_os_cpu_info();
66
67 // Sets the SVE length and returns a new actual value or negative on error.
68 // If the len is larger than the system largest supported SVE vector length,
69 // the function sets the largest supported value.
70 static int set_and_get_current_sve_vector_length(int len);
71 static int get_current_sve_vector_length();
72
73 public:
74 // Initialization
75 static void initialize();
76 static void check_virtualizations();
77
78 static void insert_features_names(uint64_t features, stringStream& ss);
79
80 static void print_platform_virtualization_info(outputStream*);
81
82 // Asserts
83 static void assert_is_initialized() {
84 }
85
86 static bool expensive_load(int ld_size, int scale) {
87 if (cpu_family() == CPU_ARM) {
88 // Half-word load with index shift by 1 (aka scale is 2) has
89 // extra cycle latency, e.g. ldrsh w0, [x1,w2,sxtw #1].
90 if (ld_size == 2 && scale == 2) {
91 return true;
92 }
93 }
94 return false;
95 }
96
97 // The CPU implementer codes can be found in
98 // ARM Architecture Reference Manual ARMv8, for ARMv8-A architecture profile
99 // https://developer.arm.com/docs/ddi0487/latest
|
53 static int _icache_line_size;
54 static int _initial_sve_vector_length;
55 static int _max_supported_sve_vector_length;
56 static bool _rop_protection;
57 static uintptr_t _pac_mask;
58 // When _prefer_sve_merging_mode_cpy is true, `cpy (imm, zeroing)` is
59 // implemented as `movi; cpy(imm, merging)`.
60 static constexpr bool _prefer_sve_merging_mode_cpy = true;
61
62 static SpinWait _spin_wait;
63
64 // Read additional info using OS-specific interfaces
65 static void get_os_cpu_info();
66
67 // Sets the SVE length and returns a new actual value or negative on error.
68 // If the len is larger than the system largest supported SVE vector length,
69 // the function sets the largest supported value.
70 static int set_and_get_current_sve_vector_length(int len);
71 static int get_current_sve_vector_length();
72
73 static void insert_features_names(uint64_t features, stringStream& ss);
74
75 public:
76 // Initialization
77 static void initialize();
78 static void check_virtualizations();
79
80 static void print_platform_virtualization_info(outputStream*);
81
82 // Asserts
83 static void assert_is_initialized() {
84 }
85
86 static bool expensive_load(int ld_size, int scale) {
87 if (cpu_family() == CPU_ARM) {
88 // Half-word load with index shift by 1 (aka scale is 2) has
89 // extra cycle latency, e.g. ldrsh w0, [x1,w2,sxtw #1].
90 if (ld_size == 2 && scale == 2) {
91 return true;
92 }
93 }
94 return false;
95 }
96
97 // The CPU implementer codes can be found in
98 // ARM Architecture Reference Manual ARMv8, for ARMv8-A architecture profile
99 // https://developer.arm.com/docs/ddi0487/latest
|