< prev index next >

src/cpu/aarch64/vm/vm_version_aarch64.cpp

Print this page




 120 
 121 void VM_Version::get_processor_features() {
 122   _supports_cx8 = true;
 123   _supports_atomic_getset4 = true;
 124   _supports_atomic_getadd4 = true;
 125   _supports_atomic_getset8 = true;
 126   _supports_atomic_getadd8 = true;
 127 
 128   getPsrInfo_stub(&_psr_info);
 129 
 130   int dcache_line = VM_Version::dcache_line_size();
 131 
 132   if (FLAG_IS_DEFAULT(AllocatePrefetchDistance))
 133     FLAG_SET_DEFAULT(AllocatePrefetchDistance, 3*dcache_line);
 134   if (FLAG_IS_DEFAULT(AllocatePrefetchStepSize))
 135     FLAG_SET_DEFAULT(AllocatePrefetchStepSize, dcache_line);
 136   if (FLAG_IS_DEFAULT(PrefetchScanIntervalInBytes))
 137     FLAG_SET_DEFAULT(PrefetchScanIntervalInBytes, 3*dcache_line);
 138   if (FLAG_IS_DEFAULT(PrefetchCopyIntervalInBytes))
 139     FLAG_SET_DEFAULT(PrefetchCopyIntervalInBytes, 3*dcache_line);


 140 
 141   if (PrefetchCopyIntervalInBytes != -1 &&
 142        ((PrefetchCopyIntervalInBytes & 7) || (PrefetchCopyIntervalInBytes >= 32768))) {
 143     warning("PrefetchCopyIntervalInBytes must be -1, or a multiple of 8 and < 32768");
 144     PrefetchCopyIntervalInBytes &= ~7;
 145     if (PrefetchCopyIntervalInBytes >= 32768)
 146       PrefetchCopyIntervalInBytes = 32760;






 147   }
 148 
 149   unsigned long auxv = getauxval(AT_HWCAP);
 150 
 151   char buf[512];
 152 
 153   _features = auxv;
 154 
 155   int cpu_lines = 0;
 156   if (FILE *f = fopen("/proc/cpuinfo", "r")) {
 157     char buf[128], *p;
 158     while (fgets(buf, sizeof (buf), f) != NULL) {
 159       if (p = strchr(buf, ':')) {
 160         long v = strtol(p+1, NULL, 0);
 161         if (strncmp(buf, "CPU implementer", sizeof "CPU implementer" - 1) == 0) {
 162           _cpu = v;
 163           cpu_lines++;
 164         } else if (strncmp(buf, "CPU variant", sizeof "CPU variant" - 1) == 0) {
 165           _variant = v;
 166         } else if (strncmp(buf, "CPU part", sizeof "CPU part" - 1) == 0) {




 120 
 121 void VM_Version::get_processor_features() {
 122   _supports_cx8 = true;
 123   _supports_atomic_getset4 = true;
 124   _supports_atomic_getadd4 = true;
 125   _supports_atomic_getset8 = true;
 126   _supports_atomic_getadd8 = true;
 127 
 128   getPsrInfo_stub(&_psr_info);
 129 
 130   int dcache_line = VM_Version::dcache_line_size();
 131 
 132   if (FLAG_IS_DEFAULT(AllocatePrefetchDistance))
 133     FLAG_SET_DEFAULT(AllocatePrefetchDistance, 3*dcache_line);
 134   if (FLAG_IS_DEFAULT(AllocatePrefetchStepSize))
 135     FLAG_SET_DEFAULT(AllocatePrefetchStepSize, dcache_line);
 136   if (FLAG_IS_DEFAULT(PrefetchScanIntervalInBytes))
 137     FLAG_SET_DEFAULT(PrefetchScanIntervalInBytes, 3*dcache_line);
 138   if (FLAG_IS_DEFAULT(PrefetchCopyIntervalInBytes))
 139     FLAG_SET_DEFAULT(PrefetchCopyIntervalInBytes, 3*dcache_line);
 140   if (FLAG_IS_DEFAULT(SoftwarePrefetchHintDistance))
 141     FLAG_SET_DEFAULT(SoftwarePrefetchHintDistance, 3*dcache_line);
 142   
 143   if (PrefetchCopyIntervalInBytes != -1 &&
 144        ((PrefetchCopyIntervalInBytes & 7) || (PrefetchCopyIntervalInBytes >= 32768))) {
 145     warning("PrefetchCopyIntervalInBytes must be -1, or a multiple of 8 and < 32768");
 146     PrefetchCopyIntervalInBytes &= ~7;
 147     if (PrefetchCopyIntervalInBytes >= 32768)
 148       PrefetchCopyIntervalInBytes = 32760;
 149   }
 150 
 151   if (SoftwarePrefetchHintDistance != -1 &&
 152        (SoftwarePrefetchHintDistance & 7)) {
 153     warning("SoftwarePrefetchHintDistance must be -1, or a multiple of 8");
 154     SoftwarePrefetchHintDistance &= ~7;
 155   }
 156 
 157   unsigned long auxv = getauxval(AT_HWCAP);
 158 
 159   char buf[512];
 160 
 161   _features = auxv;
 162 
 163   int cpu_lines = 0;
 164   if (FILE *f = fopen("/proc/cpuinfo", "r")) {
 165     char buf[128], *p;
 166     while (fgets(buf, sizeof (buf), f) != NULL) {
 167       if (p = strchr(buf, ':')) {
 168         long v = strtol(p+1, NULL, 0);
 169         if (strncmp(buf, "CPU implementer", sizeof "CPU implementer" - 1) == 0) {
 170           _cpu = v;
 171           cpu_lines++;
 172         } else if (strncmp(buf, "CPU variant", sizeof "CPU variant" - 1) == 0) {
 173           _variant = v;
 174         } else if (strncmp(buf, "CPU part", sizeof "CPU part" - 1) == 0) {


< prev index next >