deps: update v8 to 4.3.61.21
[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         case 0x4c:  // AMT
389         case 0x6e:
390           is_atom_ = true;
391       }
392     }
393   }
394
395 #if V8_HOST_ARCH_IA32
396   // SAHF is always available in compat/legacy mode,
397   has_sahf_ = true;
398 #else
399   // Query extended IDs.
400   __cpuid(cpu_info, 0x80000000);
401   unsigned num_ext_ids = cpu_info[0];
402
403   // Interpret extended CPU feature information.
404   if (num_ext_ids > 0x80000000) {
405     __cpuid(cpu_info, 0x80000001);
406     // SAHF must be probed in long mode.
407     has_sahf_ = (cpu_info[2] & 0x00000001) != 0;
408   }
409 #endif
410
411 #elif V8_HOST_ARCH_ARM
412
413 #if V8_OS_LINUX
414
415   CPUInfo cpu_info;
416
417   // Extract implementor from the "CPU implementer" field.
418   char* implementer = cpu_info.ExtractField("CPU implementer");
419   if (implementer != NULL) {
420     char* end;
421     implementer_ = strtol(implementer, &end, 0);
422     if (end == implementer) {
423       implementer_ = 0;
424     }
425     delete[] implementer;
426   }
427
428   char* variant = cpu_info.ExtractField("CPU variant");
429   if (variant != NULL) {
430     char* end;
431     variant_ = strtol(variant, &end, 0);
432     if (end == variant) {
433       variant_ = -1;
434     }
435     delete[] variant;
436   }
437
438   // Extract part number from the "CPU part" field.
439   char* part = cpu_info.ExtractField("CPU part");
440   if (part != NULL) {
441     char* end;
442     part_ = strtol(part, &end, 0);
443     if (end == part) {
444       part_ = 0;
445     }
446     delete[] part;
447   }
448
449   // Extract architecture from the "CPU Architecture" field.
450   // The list is well-known, unlike the the output of
451   // the 'Processor' field which can vary greatly.
452   // See the definition of the 'proc_arch' array in
453   // $KERNEL/arch/arm/kernel/setup.c and the 'c_show' function in
454   // same file.
455   char* architecture = cpu_info.ExtractField("CPU architecture");
456   if (architecture != NULL) {
457     char* end;
458     architecture_ = strtol(architecture, &end, 10);
459     if (end == architecture) {
460       architecture_ = 0;
461     }
462     delete[] architecture;
463
464     // Unfortunately, it seems that certain ARMv6-based CPUs
465     // report an incorrect architecture number of 7!
466     //
467     // See http://code.google.com/p/android/issues/detail?id=10812
468     //
469     // We try to correct this by looking at the 'elf_platform'
470     // field reported by the 'Processor' field, which is of the
471     // form of "(v7l)" for an ARMv7-based CPU, and "(v6l)" for
472     // an ARMv6-one. For example, the Raspberry Pi is one popular
473     // ARMv6 device that reports architecture 7.
474     if (architecture_ == 7) {
475       char* processor = cpu_info.ExtractField("Processor");
476       if (HasListItem(processor, "(v6l)")) {
477         architecture_ = 6;
478       }
479       delete[] processor;
480     }
481
482     // elf_platform moved to the model name field in Linux v3.8.
483     if (architecture_ == 7) {
484       char* processor = cpu_info.ExtractField("model name");
485       if (HasListItem(processor, "(v6l)")) {
486         architecture_ = 6;
487       }
488       delete[] processor;
489     }
490   }
491
492   // Try to extract the list of CPU features from ELF hwcaps.
493   uint32_t hwcaps = ReadELFHWCaps();
494   if (hwcaps != 0) {
495     has_idiva_ = (hwcaps & HWCAP_IDIVA) != 0;
496     has_neon_ = (hwcaps & HWCAP_NEON) != 0;
497     has_vfp_ = (hwcaps & HWCAP_VFP) != 0;
498     has_vfp3_ = (hwcaps & (HWCAP_VFPv3 | HWCAP_VFPv3D16 | HWCAP_VFPv4)) != 0;
499     has_vfp3_d32_ = (has_vfp3_ && ((hwcaps & HWCAP_VFPv3D16) == 0 ||
500                                    (hwcaps & HWCAP_VFPD32) != 0));
501   } else {
502     // Try to fallback to "Features" CPUInfo field.
503     char* features = cpu_info.ExtractField("Features");
504     has_idiva_ = HasListItem(features, "idiva");
505     has_neon_ = HasListItem(features, "neon");
506     has_thumb2_ = HasListItem(features, "thumb2");
507     has_vfp_ = HasListItem(features, "vfp");
508     if (HasListItem(features, "vfpv3d16")) {
509       has_vfp3_ = true;
510     } else if (HasListItem(features, "vfpv3")) {
511       has_vfp3_ = true;
512       has_vfp3_d32_ = true;
513     }
514     delete[] features;
515   }
516
517   // Some old kernels will report vfp not vfpv3. Here we make an attempt
518   // to detect vfpv3 by checking for vfp *and* neon, since neon is only
519   // available on architectures with vfpv3. Checking neon on its own is
520   // not enough as it is possible to have neon without vfp.
521   if (has_vfp_ && has_neon_) {
522     has_vfp3_ = true;
523   }
524
525   // VFPv3 implies ARMv7, see ARM DDI 0406B, page A1-6.
526   if (architecture_ < 7 && has_vfp3_) {
527     architecture_ = 7;
528   }
529
530   // ARMv7 implies Thumb2.
531   if (architecture_ >= 7) {
532     has_thumb2_ = true;
533   }
534
535   // The earliest architecture with Thumb2 is ARMv6T2.
536   if (has_thumb2_ && architecture_ < 6) {
537     architecture_ = 6;
538   }
539
540   // We don't support any FPUs other than VFP.
541   has_fpu_ = has_vfp_;
542
543 #elif V8_OS_QNX
544
545   uint32_t cpu_flags = SYSPAGE_ENTRY(cpuinfo)->flags;
546   if (cpu_flags & ARM_CPU_FLAG_V7) {
547     architecture_ = 7;
548     has_thumb2_ = true;
549   } else if (cpu_flags & ARM_CPU_FLAG_V6) {
550     architecture_ = 6;
551     // QNX doesn't say if Thumb2 is available.
552     // Assume false for the architectures older than ARMv7.
553   }
554   DCHECK(architecture_ >= 6);
555   has_fpu_ = (cpu_flags & CPU_FLAG_FPU) != 0;
556   has_vfp_ = has_fpu_;
557   if (cpu_flags & ARM_CPU_FLAG_NEON) {
558     has_neon_ = true;
559     has_vfp3_ = has_vfp_;
560 #ifdef ARM_CPU_FLAG_VFP_D32
561     has_vfp3_d32_ = (cpu_flags & ARM_CPU_FLAG_VFP_D32) != 0;
562 #endif
563   }
564   has_idiva_ = (cpu_flags & ARM_CPU_FLAG_IDIV) != 0;
565
566 #endif  // V8_OS_LINUX
567
568 #elif V8_HOST_ARCH_MIPS || V8_HOST_ARCH_MIPS64
569
570   // Simple detection of FPU at runtime for Linux.
571   // It is based on /proc/cpuinfo, which reveals hardware configuration
572   // to user-space applications.  According to MIPS (early 2010), no similar
573   // facility is universally available on the MIPS architectures,
574   // so it's up to individual OSes to provide such.
575   CPUInfo cpu_info;
576   char* cpu_model = cpu_info.ExtractField("cpu model");
577   has_fpu_ = HasListItem(cpu_model, "FPU");
578   delete[] cpu_model;
579 #ifdef V8_HOST_ARCH_MIPS
580   is_fp64_mode_ = __detect_fp64_mode();
581   architecture_ = __detect_mips_arch_revision();
582 #endif
583
584 #elif V8_HOST_ARCH_ARM64
585
586   CPUInfo cpu_info;
587
588   // Extract implementor from the "CPU implementer" field.
589   char* implementer = cpu_info.ExtractField("CPU implementer");
590   if (implementer != NULL) {
591     char* end;
592     implementer_ = strtol(implementer, &end, 0);
593     if (end == implementer) {
594       implementer_ = 0;
595     }
596     delete[] implementer;
597   }
598
599   char* variant = cpu_info.ExtractField("CPU variant");
600   if (variant != NULL) {
601     char* end;
602     variant_ = strtol(variant, &end, 0);
603     if (end == variant) {
604       variant_ = -1;
605     }
606     delete[] variant;
607   }
608
609   // Extract part number from the "CPU part" field.
610   char* part = cpu_info.ExtractField("CPU part");
611   if (part != NULL) {
612     char* end;
613     part_ = strtol(part, &end, 0);
614     if (end == part) {
615       part_ = 0;
616     }
617     delete[] part;
618   }
619
620 #elif V8_HOST_ARCH_PPC
621
622 #ifndef USE_SIMULATOR
623 #if V8_OS_LINUX
624   // Read processor info from /proc/self/auxv.
625   char* auxv_cpu_type = NULL;
626   FILE* fp = fopen("/proc/self/auxv", "r");
627   if (fp != NULL) {
628 #if V8_TARGET_ARCH_PPC64
629     Elf64_auxv_t entry;
630 #else
631     Elf32_auxv_t entry;
632 #endif
633     for (;;) {
634       size_t n = fread(&entry, sizeof(entry), 1, fp);
635       if (n == 0 || entry.a_type == AT_NULL) {
636         break;
637       }
638       if (entry.a_type == AT_PLATFORM) {
639         auxv_cpu_type = reinterpret_cast<char*>(entry.a_un.a_val);
640         break;
641       }
642     }
643     fclose(fp);
644   }
645
646   part_ = -1;
647   if (auxv_cpu_type) {
648     if (strcmp(auxv_cpu_type, "power8") == 0) {
649       part_ = PPC_POWER8;
650     } else if (strcmp(auxv_cpu_type, "power7") == 0) {
651       part_ = PPC_POWER7;
652     } else if (strcmp(auxv_cpu_type, "power6") == 0) {
653       part_ = PPC_POWER6;
654     } else if (strcmp(auxv_cpu_type, "power5") == 0) {
655       part_ = PPC_POWER5;
656     } else if (strcmp(auxv_cpu_type, "ppc970") == 0) {
657       part_ = PPC_G5;
658     } else if (strcmp(auxv_cpu_type, "ppc7450") == 0) {
659       part_ = PPC_G4;
660     } else if (strcmp(auxv_cpu_type, "pa6t") == 0) {
661       part_ = PPC_PA6T;
662     }
663   }
664
665 #elif V8_OS_AIX
666   switch (_system_configuration.implementation) {
667     case POWER_8:
668       part_ = PPC_POWER8;
669       break;
670     case POWER_7:
671       part_ = PPC_POWER7;
672       break;
673     case POWER_6:
674       part_ = PPC_POWER6;
675       break;
676     case POWER_5:
677       part_ = PPC_POWER5;
678       break;
679   }
680 #endif  // V8_OS_AIX
681 #endif  // !USE_SIMULATOR
682 #endif  // V8_HOST_ARCH_PPC
683 }
684
685 } }  // namespace v8::base