| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <stdarg.h> | 5 #include <stdarg.h> |
| 6 #include <stdlib.h> | 6 #include <stdlib.h> |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #if V8_TARGET_ARCH_PPC | 9 #if V8_TARGET_ARCH_PPC |
| 10 | 10 |
| (...skipping 1845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1856 uintptr_t count = 0; | 1856 uintptr_t count = 0; |
| 1857 int n = 0; | 1857 int n = 0; |
| 1858 uintptr_t bit = 0x80000000; | 1858 uintptr_t bit = 0x80000000; |
| 1859 for (; n < 32; n++) { | 1859 for (; n < 32; n++) { |
| 1860 if (bit & rs_val) count++; | 1860 if (bit & rs_val) count++; |
| 1861 bit >>= 1; | 1861 bit >>= 1; |
| 1862 } | 1862 } |
| 1863 set_register(ra, count); | 1863 set_register(ra, count); |
| 1864 break; | 1864 break; |
| 1865 } | 1865 } |
| 1866 #if V8_TARGET_ARCH_PPC64 |
| 1867 case POPCNTD: { |
| 1868 int rs = instr->RSValue(); |
| 1869 int ra = instr->RAValue(); |
| 1870 uintptr_t rs_val = get_register(rs); |
| 1871 uintptr_t count = 0; |
| 1872 int n = 0; |
| 1873 uintptr_t bit = 0x8000000000000000UL; |
| 1874 for (; n < 64; n++) { |
| 1875 if (bit & rs_val) count++; |
| 1876 bit >>= 1; |
| 1877 } |
| 1878 set_register(ra, count); |
| 1879 break; |
| 1880 } |
| 1881 #endif |
| 1866 case SYNC: { | 1882 case SYNC: { |
| 1867 // todo - simulate sync | 1883 // todo - simulate sync |
| 1868 break; | 1884 break; |
| 1869 } | 1885 } |
| 1870 case ICBI: { | 1886 case ICBI: { |
| 1871 // todo - simulate icbi | 1887 // todo - simulate icbi |
| 1872 break; | 1888 break; |
| 1873 } | 1889 } |
| 1874 default: { | 1890 default: { |
| 1875 found = false; | 1891 found = false; |
| (...skipping 2033 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3909 uintptr_t* stack_slot = reinterpret_cast<uintptr_t*>(current_sp); | 3925 uintptr_t* stack_slot = reinterpret_cast<uintptr_t*>(current_sp); |
| 3910 uintptr_t address = *stack_slot; | 3926 uintptr_t address = *stack_slot; |
| 3911 set_register(sp, current_sp + sizeof(uintptr_t)); | 3927 set_register(sp, current_sp + sizeof(uintptr_t)); |
| 3912 return address; | 3928 return address; |
| 3913 } | 3929 } |
| 3914 } // namespace internal | 3930 } // namespace internal |
| 3915 } // namespace v8 | 3931 } // namespace v8 |
| 3916 | 3932 |
| 3917 #endif // USE_SIMULATOR | 3933 #endif // USE_SIMULATOR |
| 3918 #endif // V8_TARGET_ARCH_PPC | 3934 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |