84cd231f611f206f17d5fed7fddda7942b83e20a
[platform/upstream/nodejs.git] / deps / v8 / src / base / cpu.cc
1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "src/base/cpu.h"
6
7 #if V8_LIBC_MSVCRT
8 #include <intrin.h>  // __cpuid()
9 #endif
10 #if V8_OS_LINUX
11 #include <linux/auxvec.h>  // AT_HWCAP
12 #endif
13 #if V8_GLIBC_PREREQ(2, 16)
14 #include <sys/auxv.h>  // getauxval()
15 #endif
16 #if V8_OS_QNX
17 #include <sys/syspage.h>  // cpuinfo
18 #endif
19 #if V8_OS_LINUX && V8_HOST_ARCH_PPC
20 #include <elf.h>
21 #endif
22 #if V8_OS_AIX
23 #include <sys/systemcfg.h>  // _system_configuration
24 #ifndef POWER_8
25 #define POWER_8 0x10000
26 #endif
27 #endif
28 #if V8_OS_POSIX
29 #include <unistd.h>  // sysconf()
30 #endif
31
32 #include <ctype.h>
33 #include <limits.h>
34 #include <stdio.h>
35 #include <stdlib.h>
36 #include <string.h>
37 #include <algorithm>
38
39 #include "src/base/logging.h"
40 #if V8_OS_WIN
41 #include "src/base/win32-headers.h"  // NOLINT
42 #endif
43
44 namespace v8 {
45 namespace base {
46
47 #if defined(__pnacl__)
48 // Portable host shouldn't do feature detection.
49 #elif V8_HOST_ARCH_IA32 || V8_HOST_ARCH_X64
50
51 // Define __cpuid() for non-MSVC libraries.
52 #if !V8_LIBC_MSVCRT
53
54 static V8_INLINE void __cpuid(int cpu_info[4], int info_type) {
55 #if defined(__i386__) && defined(__pic__)
56   // Make sure to preserve ebx, which contains the pointer
57   // to the GOT in case we're generating PIC.
58   __asm__ volatile (
59     "mov %%ebx, %%edi\n\t"
60     "cpuid\n\t"
61     "xchg %%edi, %%ebx\n\t"
62     : "=a"(cpu_info[0]), "=D"(cpu_info[1]), "=c"(cpu_info[2]), "=d"(cpu_info[3])
63     : "a"(info_type)
64   );
65 #else
66   __asm__ volatile (
67     "cpuid \n\t"
68     : "=a"(cpu_info[0]), "=b"(cpu_info[1]), "=c"(cpu_info[2]), "=d"(cpu_info[3])
69     : "a"(info_type)
70   );
71 #endif  // defined(__i386__) && defined(__pic__)
72 }
73
74 #endif  // !V8_LIBC_MSVCRT
75
76 #elif V8_HOST_ARCH_ARM || V8_HOST_ARCH_ARM64 \
77     || V8_HOST_ARCH_MIPS || V8_HOST_ARCH_MIPS64
78
79 #if V8_OS_LINUX
80
81 #if V8_HOST_ARCH_ARM
82
83 // See <uapi/asm/hwcap.h> kernel header.
84 /*
85  * HWCAP flags - for elf_hwcap (in kernel) and AT_HWCAP
86  */
87 #define HWCAP_SWP (1 << 0)
88 #define HWCAP_HALF  (1 << 1)
89 #define HWCAP_THUMB (1 << 2)
90 #define HWCAP_26BIT (1 << 3)  /* Play it safe */
91 #define HWCAP_FAST_MULT (1 << 4)
92 #define HWCAP_FPA (1 << 5)
93 #define HWCAP_VFP (1 << 6)
94 #define HWCAP_EDSP  (1 << 7)
95 #define HWCAP_JAVA  (1 << 8)
96 #define HWCAP_IWMMXT  (1 << 9)
97 #define HWCAP_CRUNCH  (1 << 10)
98 #define HWCAP_THUMBEE (1 << 11)
99 #define HWCAP_NEON  (1 << 12)
100 #define HWCAP_VFPv3 (1 << 13)
101 #define HWCAP_VFPv3D16  (1 << 14) /* also set for VFPv4-D16 */
102 #define HWCAP_TLS (1 << 15)
103 #define HWCAP_VFPv4 (1 << 16)
104 #define HWCAP_IDIVA (1 << 17)
105 #define HWCAP_IDIVT (1 << 18)
106 #define HWCAP_VFPD32  (1 << 19) /* set if VFP has 32 regs (not 16) */
107 #define HWCAP_IDIV  (HWCAP_IDIVA | HWCAP_IDIVT)
108 #define HWCAP_LPAE  (1 << 20)
109
110 static uint32_t ReadELFHWCaps() {
111   uint32_t result = 0;
112 #if V8_GLIBC_PREREQ(2, 16)
113   result = static_cast<uint32_t>(getauxval(AT_HWCAP));
114 #else
115   // Read the ELF HWCAP flags by parsing /proc/self/auxv.
116   FILE* fp = fopen("/proc/self/auxv", "r");
117   if (fp != NULL) {
118     struct { uint32_t tag; uint32_t value; } entry;
119     for (;;) {
120       size_t n = fread(&entry, sizeof(entry), 1, fp);
121       if (n == 0 || (entry.tag == 0 && entry.value == 0)) {
122         break;
123       }
124       if (entry.tag == AT_HWCAP) {
125         result = entry.value;
126         break;
127       }
128     }
129     fclose(fp);
130   }
131 #endif
132   return result;
133 }
134
135 #endif  // V8_HOST_ARCH_ARM
136
137 #if V8_HOST_ARCH_MIPS
138 int __detect_fp64_mode(void) {
139   double result = 0;
140   // Bit representation of (double)1 is 0x3FF0000000000000.
141   __asm__ volatile(
142       ".set push\n\t"
143       ".set noreorder\n\t"
144       ".set oddspreg\n\t"
145       "lui $t0, 0x3FF0\n\t"
146       "ldc1 $f0, %0\n\t"
147       "mtc1 $t0, $f1\n\t"
148       "sdc1 $f0, %0\n\t"
149       ".set pop\n\t"
150       : "+m"(result)
151       :
152       : "t0", "$f0", "$f1", "memory");
153
154   return !(result == 1);
155 }
156
157
158 int __detect_mips_arch_revision(void) {
159   // TODO(dusmil): Do the specific syscall as soon as it is implemented in mips
160   // kernel.
161   uint32_t result = 0;
162   __asm__ volatile(
163       "move $v0, $zero\n\t"
164       // Encoding for "addi $v0, $v0, 1" on non-r6,
165       // which is encoding for "bovc $v0, %v0, 1" on r6.
166       // Use machine code directly to avoid compilation errors with different
167       // toolchains and maintain compatibility.
168       ".word 0x20420001\n\t"
169       "sw $v0, %0\n\t"
170       : "=m"(result)
171       :
172       : "v0", "memory");
173   // Result is 0 on r6 architectures, 1 on other architecture revisions.
174   // Fall-back to the least common denominator which is mips32 revision 1.
175   return result ? 1 : 6;
176 }
177 #endif
178
179 // Extract the information exposed by the kernel via /proc/cpuinfo.
180 class CPUInfo FINAL {
181  public:
182   CPUInfo() : datalen_(0) {
183     // Get the size of the cpuinfo file by reading it until the end. This is
184     // required because files under /proc do not always return a valid size
185     // when using fseek(0, SEEK_END) + ftell(). Nor can the be mmap()-ed.
186     static const char PATHNAME[] = "/proc/cpuinfo";
187     FILE* fp = fopen(PATHNAME, "r");
188     if (fp != NULL) {
189       for (;;) {
190         char buffer[256];
191         size_t n = fread(buffer, 1, sizeof(buffer), fp);
192         if (n == 0) {
193           break;
194         }
195         datalen_ += n;
196       }
197       fclose(fp);
198     }
199
200     // Read the contents of the cpuinfo file.
201     data_ = new char[datalen_ + 1];
202     fp = fopen(PATHNAME, "r");
203     if (fp != NULL) {
204       for (size_t offset = 0; offset < datalen_; ) {
205         size_t n = fread(data_ + offset, 1, datalen_ - offset, fp);
206         if (n == 0) {
207           break;
208         }
209         offset += n;
210       }
211       fclose(fp);
212     }
213
214     // Zero-terminate the data.
215     data_[datalen_] = '\0';
216   }
217
218   ~CPUInfo() {
219     delete[] data_;
220   }
221
222   // Extract the content of a the first occurence of a given field in
223   // the content of the cpuinfo file and return it as a heap-allocated
224   // string that must be freed by the caller using delete[].
225   // Return NULL if not found.
226   char* ExtractField(const char* field) const {
227     DCHECK(field != NULL);
228
229     // Look for first field occurence, and ensure it starts the line.
230     size_t fieldlen = strlen(field);
231     char* p = data_;
232     for (;;) {
233       p = strstr(p, field);
234       if (p == NULL) {
235         return NULL;
236       }
237       if (p == data_ || p[-1] == '\n') {
238         break;
239       }
240       p += fieldlen;
241     }
242
243     // Skip to the first colon followed by a space.
244     p = strchr(p + fieldlen, ':');
245     if (p == NULL || !isspace(p[1])) {
246       return NULL;
247     }
248     p += 2;
249
250     // Find the end of the line.
251     char* q = strchr(p, '\n');
252     if (q == NULL) {
253       q = data_ + datalen_;
254     }
255
256     // Copy the line into a heap-allocated buffer.
257     size_t len = q - p;
258     char* result = new char[len + 1];
259     if (result != NULL) {
260       memcpy(result, p, len);
261       result[len] = '\0';
262     }
263     return result;
264   }
265
266  private:
267   char* data_;
268   size_t datalen_;
269 };
270
271 #if V8_HOST_ARCH_ARM || V8_HOST_ARCH_MIPS || V8_HOST_ARCH_MIPS64
272
273 // Checks that a space-separated list of items contains one given 'item'.
274 static bool HasListItem(const char* list, const char* item) {
275   ssize_t item_len = strlen(item);
276   const char* p = list;
277   if (p != NULL) {
278     while (*p != '\0') {
279       // Skip whitespace.
280       while (isspace(*p)) ++p;
281
282       // Find end of current list item.
283       const char* q = p;
284       while (*q != '\0' && !isspace(*q)) ++q;
285
286       if (item_len == q - p && memcmp(p, item, item_len) == 0) {
287         return true;
288       }
289
290       // Skip to next item.
291       p = q;
292     }
293   }
294   return false;
295 }
296
297 #endif  // V8_HOST_ARCH_ARM || V8_HOST_ARCH_MIPS || V8_HOST_ARCH_MIPS64
298
299 #endif  // V8_OS_LINUX
300
301 #endif  // V8_HOST_ARCH_IA32 || V8_HOST_ARCH_X64
302
303 CPU::CPU()
304     : stepping_(0),
305       model_(0),
306       ext_model_(0),
307       family_(0),
308       ext_family_(0),
309       type_(0),
310       implementer_(0),
311       architecture_(0),
312       variant_(-1),
313       part_(0),
314       has_fpu_(false),
315       has_cmov_(false),
316       has_sahf_(false),
317       has_mmx_(false),
318       has_sse_(false),
319       has_sse2_(false),
320       has_sse3_(false),
321       has_ssse3_(false),
322       has_sse41_(false),
323       has_sse42_(false),
324       is_atom_(false),
325       has_osxsave_(false),
326       has_avx_(false),
327       has_fma3_(false),
328       has_idiva_(false),
329       has_neon_(false),
330       has_thumb2_(false),
331       has_vfp_(false),
332       has_vfp3_(false),
333       has_vfp3_d32_(false),
334       is_fp64_mode_(false) {
335   memcpy(vendor_, "Unknown", 8);
336 #if V8_OS_NACL
337 // Portable host shouldn't do feature detection.
338 // TODO(jfb): Remove the hardcoded ARM simulator flags in the build, and
339 // hardcode them here instead.
340 #elif V8_HOST_ARCH_IA32 || V8_HOST_ARCH_X64
341   int cpu_info[4];
342
343   // __cpuid with an InfoType argument of 0 returns the number of
344   // valid Ids in CPUInfo[0] and the CPU identification string in
345   // the other three array elements. The CPU identification string is
346   // not in linear order. The code below arranges the information
347   // in a human readable form. The human readable order is CPUInfo[1] |
348   // CPUInfo[3] | CPUInfo[2]. CPUInfo[2] and CPUInfo[3] are swapped
349   // before using memcpy to copy these three array elements to cpu_string.
350   __cpuid(cpu_info, 0);
351   unsigned num_ids = cpu_info[0];
352   std::swap(cpu_info[2], cpu_info[3]);
353   memcpy(vendor_, cpu_info + 1, 12);
354   vendor_[12] = '\0';
355
356   // Interpret CPU feature information.
357   if (num_ids > 0) {
358     __cpuid(cpu_info, 1);
359     stepping_ = cpu_info[0] & 0xf;
360     model_ = ((cpu_info[0] >> 4) & 0xf) + ((cpu_info[0] >> 12) & 0xf0);
361     family_ = (cpu_info[0] >> 8) & 0xf;
362     type_ = (cpu_info[0] >> 12) & 0x3;
363     ext_model_ = (cpu_info[0] >> 16) & 0xf;
364     ext_family_ = (cpu_info[0] >> 20) & 0xff;
365     has_fpu_ = (cpu_info[3] & 0x00000001) != 0;
366     has_cmov_ = (cpu_info[3] & 0x00008000) != 0;
367     has_mmx_ = (cpu_info[3] & 0x00800000) != 0;
368     has_sse_ = (cpu_info[3] & 0x02000000) != 0;
369     has_sse2_ = (cpu_info[3] & 0x04000000) != 0;
370     has_sse3_ = (cpu_info[2] & 0x00000001) != 0;
371     has_ssse3_ = (cpu_info[2] & 0x00000200) != 0;
372     has_sse41_ = (cpu_info[2] & 0x00080000) != 0;
373     has_sse42_ = (cpu_info[2] & 0x00100000) != 0;
374     has_osxsave_ = (cpu_info[2] & 0x08000000) != 0;
375     has_avx_ = (cpu_info[2] & 0x10000000) != 0;
376     has_fma3_ = (cpu_info[2] & 0x00001000) != 0;
377
378     if (family_ == 0x6) {
379       switch (model_) {
380         case 0x1c:  // SLT
381         case 0x26:
382         case 0x36:
383         case 0x27:
384         case 0x35:
385         case 0x37:  // SLM
386         case 0x4a:
387         case 0x4d:
388           is_atom_ = true;
389       }
390     }
391   }
392
393 #if V8_HOST_ARCH_IA32
394   // SAHF is always available in compat/legacy mode,
395   has_sahf_ = true;
396 #else
397   // Query extended IDs.
398   __cpuid(cpu_info, 0x80000000);
399   unsigned num_ext_ids = cpu_info[0];
400
401   // Interpret extended CPU feature information.
402   if (num_ext_ids > 0x80000000) {
403     __cpuid(cpu_info, 0x80000001);
404     // SAHF must be probed in long mode.
405     has_sahf_ = (cpu_info[2] & 0x00000001) != 0;
406   }
407 #endif
408
409 #elif V8_HOST_ARCH_ARM
410
411 #if V8_OS_LINUX
412
413   CPUInfo cpu_info;
414
415   // Extract implementor from the "CPU implementer" field.
416   char* implementer = cpu_info.ExtractField("CPU implementer");
417   if (implementer != NULL) {
418     char* end;
419     implementer_ = strtol(implementer, &end, 0);
420     if (end == implementer) {
421       implementer_ = 0;
422     }
423     delete[] implementer;
424   }
425
426   char* variant = cpu_info.ExtractField("CPU variant");
427   if (variant != NULL) {
428     char* end;
429     variant_ = strtol(variant, &end, 0);
430     if (end == variant) {
431       variant_ = -1;
432     }
433     delete[] variant;
434   }
435
436   // Extract part number from the "CPU part" field.
437   char* part = cpu_info.ExtractField("CPU part");
438   if (part != NULL) {
439     char* end;
440     part_ = strtol(part, &end, 0);
441     if (end == part) {
442       part_ = 0;
443     }
444     delete[] part;
445   }
446
447   // Extract architecture from the "CPU Architecture" field.
448   // The list is well-known, unlike the the output of
449   // the 'Processor' field which can vary greatly.
450   // See the definition of the 'proc_arch' array in
451   // $KERNEL/arch/arm/kernel/setup.c and the 'c_show' function in
452   // same file.
453   char* architecture = cpu_info.ExtractField("CPU architecture");
454   if (architecture != NULL) {
455     char* end;
456     architecture_ = strtol(architecture, &end, 10);
457     if (end == architecture) {
458       architecture_ = 0;
459     }
460     delete[] architecture;
461
462     // Unfortunately, it seems that certain ARMv6-based CPUs
463     // report an incorrect architecture number of 7!
464     //
465     // See http://code.google.com/p/android/issues/detail?id=10812
466     //
467     // We try to correct this by looking at the 'elf_platform'
468     // field reported by the 'Processor' field, which is of the
469     // form of "(v7l)" for an ARMv7-based CPU, and "(v6l)" for
470     // an ARMv6-one. For example, the Raspberry Pi is one popular
471     // ARMv6 device that reports architecture 7.
472     if (architecture_ == 7) {
473       char* processor = cpu_info.ExtractField("Processor");
474       if (HasListItem(processor, "(v6l)")) {
475         architecture_ = 6;
476       }
477       delete[] processor;
478     }
479
480     // elf_platform moved to the model name field in Linux v3.8.
481     if (architecture_ == 7) {
482       char* processor = cpu_info.ExtractField("model name");
483       if (HasListItem(processor, "(v6l)")) {
484         architecture_ = 6;
485       }
486       delete[] processor;
487     }
488   }
489
490   // Try to extract the list of CPU features from ELF hwcaps.
491   uint32_t hwcaps = ReadELFHWCaps();
492   if (hwcaps != 0) {
493     has_idiva_ = (hwcaps & HWCAP_IDIVA) != 0;
494     has_neon_ = (hwcaps & HWCAP_NEON) != 0;
495     has_vfp_ = (hwcaps & HWCAP_VFP) != 0;
496     has_vfp3_ = (hwcaps & (HWCAP_VFPv3 | HWCAP_VFPv3D16 | HWCAP_VFPv4)) != 0;
497     has_vfp3_d32_ = (has_vfp3_ && ((hwcaps & HWCAP_VFPv3D16) == 0 ||
498                                    (hwcaps & HWCAP_VFPD32) != 0));
499   } else {
500     // Try to fallback to "Features" CPUInfo field.
501     char* features = cpu_info.ExtractField("Features");
502     has_idiva_ = HasListItem(features, "idiva");
503     has_neon_ = HasListItem(features, "neon");
504     has_thumb2_ = HasListItem(features, "thumb2");
505     has_vfp_ = HasListItem(features, "vfp");
506     if (HasListItem(features, "vfpv3d16")) {
507       has_vfp3_ = true;
508     } else if (HasListItem(features, "vfpv3")) {
509       has_vfp3_ = true;
510       has_vfp3_d32_ = true;
511     }
512     delete[] features;
513   }
514
515   // Some old kernels will report vfp not vfpv3. Here we make an attempt
516   // to detect vfpv3 by checking for vfp *and* neon, since neon is only
517   // available on architectures with vfpv3. Checking neon on its own is
518   // not enough as it is possible to have neon without vfp.
519   if (has_vfp_ && has_neon_) {
520     has_vfp3_ = true;
521   }
522
523   // VFPv3 implies ARMv7, see ARM DDI 0406B, page A1-6.
524   if (architecture_ < 7 && has_vfp3_) {
525     architecture_ = 7;
526   }
527
528   // ARMv7 implies Thumb2.
529   if (architecture_ >= 7) {
530     has_thumb2_ = true;
531   }
532
533   // The earliest architecture with Thumb2 is ARMv6T2.
534   if (has_thumb2_ && architecture_ < 6) {
535     architecture_ = 6;
536   }
537
538   // We don't support any FPUs other than VFP.
539   has_fpu_ = has_vfp_;
540
541 #elif V8_OS_QNX
542
543   uint32_t cpu_flags = SYSPAGE_ENTRY(cpuinfo)->flags;
544   if (cpu_flags & ARM_CPU_FLAG_V7) {
545     architecture_ = 7;
546     has_thumb2_ = true;
547   } else if (cpu_flags & ARM_CPU_FLAG_V6) {
548     architecture_ = 6;
549     // QNX doesn't say if Thumb2 is available.
550     // Assume false for the architectures older than ARMv7.
551   }
552   DCHECK(architecture_ >= 6);
553   has_fpu_ = (cpu_flags & CPU_FLAG_FPU) != 0;
554   has_vfp_ = has_fpu_;
555   if (cpu_flags & ARM_CPU_FLAG_NEON) {
556     has_neon_ = true;
557     has_vfp3_ = has_vfp_;
558 #ifdef ARM_CPU_FLAG_VFP_D32
559     has_vfp3_d32_ = (cpu_flags & ARM_CPU_FLAG_VFP_D32) != 0;
560 #endif
561   }
562   has_idiva_ = (cpu_flags & ARM_CPU_FLAG_IDIV) != 0;
563
564 #endif  // V8_OS_LINUX
565
566 #elif V8_HOST_ARCH_MIPS || V8_HOST_ARCH_MIPS64
567
568   // Simple detection of FPU at runtime for Linux.
569   // It is based on /proc/cpuinfo, which reveals hardware configuration
570   // to user-space applications.  According to MIPS (early 2010), no similar
571   // facility is universally available on the MIPS architectures,
572   // so it's up to individual OSes to provide such.
573   CPUInfo cpu_info;
574   char* cpu_model = cpu_info.ExtractField("cpu model");
575   has_fpu_ = HasListItem(cpu_model, "FPU");
576   delete[] cpu_model;
577 #ifdef V8_HOST_ARCH_MIPS
578   is_fp64_mode_ = __detect_fp64_mode();
579   architecture_ = __detect_mips_arch_revision();
580 #endif
581
582 #elif V8_HOST_ARCH_ARM64
583
584   CPUInfo cpu_info;
585
586   // Extract implementor from the "CPU implementer" field.
587   char* implementer = cpu_info.ExtractField("CPU implementer");
588   if (implementer != NULL) {
589     char* end;
590     implementer_ = strtol(implementer, &end, 0);
591     if (end == implementer) {
592       implementer_ = 0;
593     }
594     delete[] implementer;
595   }
596
597   char* variant = cpu_info.ExtractField("CPU variant");
598   if (variant != NULL) {
599     char* end;
600     variant_ = strtol(variant, &end, 0);
601     if (end == variant) {
602       variant_ = -1;
603     }
604     delete[] variant;
605   }
606
607   // Extract part number from the "CPU part" field.
608   char* part = cpu_info.ExtractField("CPU part");
609   if (part != NULL) {
610     char* end;
611     part_ = strtol(part, &end, 0);
612     if (end == part) {
613       part_ = 0;
614     }
615     delete[] part;
616   }
617
618 #elif V8_HOST_ARCH_PPC
619
620 #ifndef USE_SIMULATOR
621 #if V8_OS_LINUX
622   // Read processor info from /proc/self/auxv.
623   char* auxv_cpu_type = NULL;
624   FILE* fp = fopen("/proc/self/auxv", "r");
625   if (fp != NULL) {
626 #if V8_TARGET_ARCH_PPC64
627     Elf64_auxv_t entry;
628 #else
629     Elf32_auxv_t entry;
630 #endif
631     for (;;) {
632       size_t n = fread(&entry, sizeof(entry), 1, fp);
633       if (n == 0 || entry.a_type == AT_NULL) {
634         break;
635       }
636       if (entry.a_type == AT_PLATFORM) {
637         auxv_cpu_type = reinterpret_cast<char*>(entry.a_un.a_val);
638         break;
639       }
640     }
641     fclose(fp);
642   }
643
644   part_ = -1;
645   if (auxv_cpu_type) {
646     if (strcmp(auxv_cpu_type, "power8") == 0) {
647       part_ = PPC_POWER8;
648     } else if (strcmp(auxv_cpu_type, "power7") == 0) {
649       part_ = PPC_POWER7;
650     } else if (strcmp(auxv_cpu_type, "power6") == 0) {
651       part_ = PPC_POWER6;
652     } else if (strcmp(auxv_cpu_type, "power5") == 0) {
653       part_ = PPC_POWER5;
654     } else if (strcmp(auxv_cpu_type, "ppc970") == 0) {
655       part_ = PPC_G5;
656     } else if (strcmp(auxv_cpu_type, "ppc7450") == 0) {
657       part_ = PPC_G4;
658     } else if (strcmp(auxv_cpu_type, "pa6t") == 0) {
659       part_ = PPC_PA6T;
660     }
661   }
662
663 #elif V8_OS_AIX
664   switch (_system_configuration.implementation) {
665     case POWER_8:
666       part_ = PPC_POWER8;
667       break;
668     case POWER_7:
669       part_ = PPC_POWER7;
670       break;
671     case POWER_6:
672       part_ = PPC_POWER6;
673       break;
674     case POWER_5:
675       part_ = PPC_POWER5;
676       break;
677   }
678 #endif  // V8_OS_AIX
679 #endif  // !USE_SIMULATOR
680 #endif  // V8_HOST_ARCH_PPC
681 }
682
683 } }  // namespace v8::base