OLD | NEW |
1 // Copyright (c) 1994-2006 Sun Microsystems Inc. | 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. |
2 // All Rights Reserved. | 2 // All Rights Reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions | 5 // modification, are permitted provided that the following conditions |
6 // are met: | 6 // are met: |
7 // | 7 // |
8 // - Redistributions of source code must retain the above copyright notice, | 8 // - Redistributions of source code must retain the above copyright notice, |
9 // this list of conditions and the following disclaimer. | 9 // this list of conditions and the following disclaimer. |
10 // | 10 // |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 | 59 |
60 // Only use statically determined features for cross compile (snapshot). | 60 // Only use statically determined features for cross compile (snapshot). |
61 if (cross_compile) return; | 61 if (cross_compile) return; |
62 | 62 |
63 // Detect whether frim instruction is supported (POWER5+) | 63 // Detect whether frim instruction is supported (POWER5+) |
64 // For now we will just check for processors we know do not | 64 // For now we will just check for processors we know do not |
65 // support it | 65 // support it |
66 #ifndef USE_SIMULATOR | 66 #ifndef USE_SIMULATOR |
67 // Probe for additional features at runtime. | 67 // Probe for additional features at runtime. |
68 base::CPU cpu; | 68 base::CPU cpu; |
| 69 if (cpu.part() == base::CPU::PPC_POWER9) { |
| 70 supported_ |= (1u << MODULO); |
| 71 } |
69 #if V8_TARGET_ARCH_PPC64 | 72 #if V8_TARGET_ARCH_PPC64 |
70 if (cpu.part() == base::CPU::PPC_POWER8) { | 73 if (cpu.part() == base::CPU::PPC_POWER8) { |
71 supported_ |= (1u << FPR_GPR_MOV); | 74 supported_ |= (1u << FPR_GPR_MOV); |
72 } | 75 } |
73 #endif | 76 #endif |
74 if (cpu.part() == base::CPU::PPC_POWER6 || | 77 if (cpu.part() == base::CPU::PPC_POWER6 || |
75 cpu.part() == base::CPU::PPC_POWER7 || | 78 cpu.part() == base::CPU::PPC_POWER7 || |
76 cpu.part() == base::CPU::PPC_POWER8) { | 79 cpu.part() == base::CPU::PPC_POWER8) { |
77 supported_ |= (1u << LWSYNC); | 80 supported_ |= (1u << LWSYNC); |
78 } | 81 } |
(...skipping 12 matching lines...) Expand all Loading... |
91 } | 94 } |
92 #elif V8_OS_AIX | 95 #elif V8_OS_AIX |
93 // Assume support FP support and default cache line size | 96 // Assume support FP support and default cache line size |
94 supported_ |= (1u << FPU); | 97 supported_ |= (1u << FPU); |
95 #endif | 98 #endif |
96 #else // Simulator | 99 #else // Simulator |
97 supported_ |= (1u << FPU); | 100 supported_ |= (1u << FPU); |
98 supported_ |= (1u << LWSYNC); | 101 supported_ |= (1u << LWSYNC); |
99 supported_ |= (1u << ISELECT); | 102 supported_ |= (1u << ISELECT); |
100 supported_ |= (1u << VSX); | 103 supported_ |= (1u << VSX); |
| 104 supported_ |= (1u << MODULO); |
101 #if V8_TARGET_ARCH_PPC64 | 105 #if V8_TARGET_ARCH_PPC64 |
102 supported_ |= (1u << FPR_GPR_MOV); | 106 supported_ |= (1u << FPR_GPR_MOV); |
103 #endif | 107 #endif |
104 #endif | 108 #endif |
105 } | 109 } |
106 | 110 |
107 | 111 |
108 void CpuFeatures::PrintTarget() { | 112 void CpuFeatures::PrintTarget() { |
109 const char* ppc_arch = NULL; | 113 const char* ppc_arch = NULL; |
110 | 114 |
(...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
944 xo_form(EXT2 | DIVW, dst, src1, src2, o, r); | 948 xo_form(EXT2 | DIVW, dst, src1, src2, o, r); |
945 } | 949 } |
946 | 950 |
947 | 951 |
948 // Divide word unsigned | 952 // Divide word unsigned |
949 void Assembler::divwu(Register dst, Register src1, Register src2, OEBit o, | 953 void Assembler::divwu(Register dst, Register src1, Register src2, OEBit o, |
950 RCBit r) { | 954 RCBit r) { |
951 xo_form(EXT2 | DIVWU, dst, src1, src2, o, r); | 955 xo_form(EXT2 | DIVWU, dst, src1, src2, o, r); |
952 } | 956 } |
953 | 957 |
| 958 void Assembler::modsw(Register rt, Register ra, Register rb) { |
| 959 x_form(EXT2 | MODSW, ra, rt, rb, LeaveRC); |
| 960 } |
| 961 |
| 962 void Assembler::moduw(Register rt, Register ra, Register rb) { |
| 963 x_form(EXT2 | MODUW, ra, rt, rb, LeaveRC); |
| 964 } |
954 | 965 |
955 void Assembler::addi(Register dst, Register src, const Operand& imm) { | 966 void Assembler::addi(Register dst, Register src, const Operand& imm) { |
956 DCHECK(!src.is(r0)); // use li instead to show intent | 967 DCHECK(!src.is(r0)); // use li instead to show intent |
957 d_form(ADDI, dst, src, imm.imm_, true); | 968 d_form(ADDI, dst, src, imm.imm_, true); |
958 } | 969 } |
959 | 970 |
960 | 971 |
961 void Assembler::addis(Register dst, Register src, const Operand& imm) { | 972 void Assembler::addis(Register dst, Register src, const Operand& imm) { |
962 DCHECK(!src.is(r0)); // use lis instead to show intent | 973 DCHECK(!src.is(r0)); // use lis instead to show intent |
963 d_form(ADDIS, dst, src, imm.imm_, true); | 974 d_form(ADDIS, dst, src, imm.imm_, true); |
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1548 void Assembler::divd(Register dst, Register src1, Register src2, OEBit o, | 1559 void Assembler::divd(Register dst, Register src1, Register src2, OEBit o, |
1549 RCBit r) { | 1560 RCBit r) { |
1550 xo_form(EXT2 | DIVD, dst, src1, src2, o, r); | 1561 xo_form(EXT2 | DIVD, dst, src1, src2, o, r); |
1551 } | 1562 } |
1552 | 1563 |
1553 | 1564 |
1554 void Assembler::divdu(Register dst, Register src1, Register src2, OEBit o, | 1565 void Assembler::divdu(Register dst, Register src1, Register src2, OEBit o, |
1555 RCBit r) { | 1566 RCBit r) { |
1556 xo_form(EXT2 | DIVDU, dst, src1, src2, o, r); | 1567 xo_form(EXT2 | DIVDU, dst, src1, src2, o, r); |
1557 } | 1568 } |
| 1569 |
| 1570 void Assembler::modsd(Register rt, Register ra, Register rb) { |
| 1571 x_form(EXT2 | MODSD, ra, rt, rb, LeaveRC); |
| 1572 } |
| 1573 |
| 1574 void Assembler::modud(Register rt, Register ra, Register rb) { |
| 1575 x_form(EXT2 | MODUD, ra, rt, rb, LeaveRC); |
| 1576 } |
1558 #endif | 1577 #endif |
1559 | 1578 |
1560 | 1579 |
1561 // Function descriptor for AIX. | 1580 // Function descriptor for AIX. |
1562 // Code address skips the function descriptor "header". | 1581 // Code address skips the function descriptor "header". |
1563 // TOC and static chain are ignored and set to 0. | 1582 // TOC and static chain are ignored and set to 0. |
1564 void Assembler::function_descriptor() { | 1583 void Assembler::function_descriptor() { |
1565 if (ABI_USES_FUNCTION_DESCRIPTORS) { | 1584 if (ABI_USES_FUNCTION_DESCRIPTORS) { |
1566 Label instructions; | 1585 Label instructions; |
1567 DCHECK(pc_offset() == 0); | 1586 DCHECK(pc_offset() == 0); |
(...skipping 980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2548 | 2567 |
2549 trampoline_ = Trampoline(pc_offset() - size, tracked_branch_count_); | 2568 trampoline_ = Trampoline(pc_offset() - size, tracked_branch_count_); |
2550 } | 2569 } |
2551 } | 2570 } |
2552 | 2571 |
2553 | 2572 |
2554 } // namespace internal | 2573 } // namespace internal |
2555 } // namespace v8 | 2574 } // namespace v8 |
2556 | 2575 |
2557 #endif // V8_TARGET_ARCH_PPC | 2576 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |