| 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 2109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2120 *vm = reg_code & 0x0F; | 2120 *vm = reg_code & 0x0F; |
| 2121 } | 2121 } |
| 2122 } | 2122 } |
| 2123 | 2123 |
| 2124 | 2124 |
| 2125 // Encode vcvt.src_type.dst_type instruction. | 2125 // Encode vcvt.src_type.dst_type instruction. |
| 2126 static Instr EncodeVCVT(const VFPType dst_type, | 2126 static Instr EncodeVCVT(const VFPType dst_type, |
| 2127 const int dst_code, | 2127 const int dst_code, |
| 2128 const VFPType src_type, | 2128 const VFPType src_type, |
| 2129 const int src_code, | 2129 const int src_code, |
| 2130 Assembler::ConversionMode mode, | 2130 VFPConversionMode mode, |
| 2131 const Condition cond) { | 2131 const Condition cond) { |
| 2132 ASSERT(src_type != dst_type); | 2132 ASSERT(src_type != dst_type); |
| 2133 int D, Vd, M, Vm; | 2133 int D, Vd, M, Vm; |
| 2134 SplitRegCode(src_type, src_code, &Vm, &M); | 2134 SplitRegCode(src_type, src_code, &Vm, &M); |
| 2135 SplitRegCode(dst_type, dst_code, &Vd, &D); | 2135 SplitRegCode(dst_type, dst_code, &Vd, &D); |
| 2136 | 2136 |
| 2137 if (IsIntegerVFPType(dst_type) || IsIntegerVFPType(src_type)) { | 2137 if (IsIntegerVFPType(dst_type) || IsIntegerVFPType(src_type)) { |
| 2138 // Conversion between IEEE floating point and 32-bit integer. | 2138 // Conversion between IEEE floating point and 32-bit integer. |
| 2139 // Instruction details available in ARM DDI 0406B, A8.6.295. | 2139 // Instruction details available in ARM DDI 0406B, A8.6.295. |
| 2140 // cond(31-28) | 11101(27-23)| D(22) | 11(21-20) | 1(19) | opc2(18-16) | | 2140 // cond(31-28) | 11101(27-23)| D(22) | 11(21-20) | 1(19) | opc2(18-16) | |
| (...skipping 22 matching lines...) Expand all Loading... |
| 2163 // Vd(15-12) | 101(11-9) | sz(8) | 1(7) | 1(6) | M(5) | 0(4) | Vm(3-0) | 2163 // Vd(15-12) | 101(11-9) | sz(8) | 1(7) | 1(6) | M(5) | 0(4) | Vm(3-0) |
| 2164 int sz = IsDoubleVFPType(src_type) ? 0x1 : 0x0; | 2164 int sz = IsDoubleVFPType(src_type) ? 0x1 : 0x0; |
| 2165 return (cond | 0xE*B24 | B23 | D*B22 | 0x3*B20 | 0x7*B16 | | 2165 return (cond | 0xE*B24 | B23 | D*B22 | 0x3*B20 | 0x7*B16 | |
| 2166 Vd*B12 | 0x5*B9 | sz*B8 | B7 | B6 | M*B5 | Vm); | 2166 Vd*B12 | 0x5*B9 | sz*B8 | B7 | B6 | M*B5 | Vm); |
| 2167 } | 2167 } |
| 2168 } | 2168 } |
| 2169 | 2169 |
| 2170 | 2170 |
| 2171 void Assembler::vcvt_f64_s32(const DwVfpRegister dst, | 2171 void Assembler::vcvt_f64_s32(const DwVfpRegister dst, |
| 2172 const SwVfpRegister src, | 2172 const SwVfpRegister src, |
| 2173 ConversionMode mode, | 2173 VFPConversionMode mode, |
| 2174 const Condition cond) { | 2174 const Condition cond) { |
| 2175 ASSERT(Isolate::Current()->cpu_features()->IsEnabled(VFP3)); | 2175 ASSERT(Isolate::Current()->cpu_features()->IsEnabled(VFP3)); |
| 2176 emit(EncodeVCVT(F64, dst.code(), S32, src.code(), mode, cond)); | 2176 emit(EncodeVCVT(F64, dst.code(), S32, src.code(), mode, cond)); |
| 2177 } | 2177 } |
| 2178 | 2178 |
| 2179 | 2179 |
| 2180 void Assembler::vcvt_f32_s32(const SwVfpRegister dst, | 2180 void Assembler::vcvt_f32_s32(const SwVfpRegister dst, |
| 2181 const SwVfpRegister src, | 2181 const SwVfpRegister src, |
| 2182 ConversionMode mode, | 2182 VFPConversionMode mode, |
| 2183 const Condition cond) { | 2183 const Condition cond) { |
| 2184 ASSERT(Isolate::Current()->cpu_features()->IsEnabled(VFP3)); | 2184 ASSERT(Isolate::Current()->cpu_features()->IsEnabled(VFP3)); |
| 2185 emit(EncodeVCVT(F32, dst.code(), S32, src.code(), mode, cond)); | 2185 emit(EncodeVCVT(F32, dst.code(), S32, src.code(), mode, cond)); |
| 2186 } | 2186 } |
| 2187 | 2187 |
| 2188 | 2188 |
| 2189 void Assembler::vcvt_f64_u32(const DwVfpRegister dst, | 2189 void Assembler::vcvt_f64_u32(const DwVfpRegister dst, |
| 2190 const SwVfpRegister src, | 2190 const SwVfpRegister src, |
| 2191 ConversionMode mode, | 2191 VFPConversionMode mode, |
| 2192 const Condition cond) { | 2192 const Condition cond) { |
| 2193 ASSERT(Isolate::Current()->cpu_features()->IsEnabled(VFP3)); | 2193 ASSERT(Isolate::Current()->cpu_features()->IsEnabled(VFP3)); |
| 2194 emit(EncodeVCVT(F64, dst.code(), U32, src.code(), mode, cond)); | 2194 emit(EncodeVCVT(F64, dst.code(), U32, src.code(), mode, cond)); |
| 2195 } | 2195 } |
| 2196 | 2196 |
| 2197 | 2197 |
| 2198 void Assembler::vcvt_s32_f64(const SwVfpRegister dst, | 2198 void Assembler::vcvt_s32_f64(const SwVfpRegister dst, |
| 2199 const DwVfpRegister src, | 2199 const DwVfpRegister src, |
| 2200 ConversionMode mode, | 2200 VFPConversionMode mode, |
| 2201 const Condition cond) { | 2201 const Condition cond) { |
| 2202 ASSERT(Isolate::Current()->cpu_features()->IsEnabled(VFP3)); | 2202 ASSERT(Isolate::Current()->cpu_features()->IsEnabled(VFP3)); |
| 2203 emit(EncodeVCVT(S32, dst.code(), F64, src.code(), mode, cond)); | 2203 emit(EncodeVCVT(S32, dst.code(), F64, src.code(), mode, cond)); |
| 2204 } | 2204 } |
| 2205 | 2205 |
| 2206 | 2206 |
| 2207 void Assembler::vcvt_u32_f64(const SwVfpRegister dst, | 2207 void Assembler::vcvt_u32_f64(const SwVfpRegister dst, |
| 2208 const DwVfpRegister src, | 2208 const DwVfpRegister src, |
| 2209 ConversionMode mode, | 2209 VFPConversionMode mode, |
| 2210 const Condition cond) { | 2210 const Condition cond) { |
| 2211 ASSERT(Isolate::Current()->cpu_features()->IsEnabled(VFP3)); | 2211 ASSERT(Isolate::Current()->cpu_features()->IsEnabled(VFP3)); |
| 2212 emit(EncodeVCVT(U32, dst.code(), F64, src.code(), mode, cond)); | 2212 emit(EncodeVCVT(U32, dst.code(), F64, src.code(), mode, cond)); |
| 2213 } | 2213 } |
| 2214 | 2214 |
| 2215 | 2215 |
| 2216 void Assembler::vcvt_f64_f32(const DwVfpRegister dst, | 2216 void Assembler::vcvt_f64_f32(const DwVfpRegister dst, |
| 2217 const SwVfpRegister src, | 2217 const SwVfpRegister src, |
| 2218 ConversionMode mode, | 2218 VFPConversionMode mode, |
| 2219 const Condition cond) { | 2219 const Condition cond) { |
| 2220 ASSERT(Isolate::Current()->cpu_features()->IsEnabled(VFP3)); | 2220 ASSERT(Isolate::Current()->cpu_features()->IsEnabled(VFP3)); |
| 2221 emit(EncodeVCVT(F64, dst.code(), F32, src.code(), mode, cond)); | 2221 emit(EncodeVCVT(F64, dst.code(), F32, src.code(), mode, cond)); |
| 2222 } | 2222 } |
| 2223 | 2223 |
| 2224 | 2224 |
| 2225 void Assembler::vcvt_f32_f64(const SwVfpRegister dst, | 2225 void Assembler::vcvt_f32_f64(const SwVfpRegister dst, |
| 2226 const DwVfpRegister src, | 2226 const DwVfpRegister src, |
| 2227 ConversionMode mode, | 2227 VFPConversionMode mode, |
| 2228 const Condition cond) { | 2228 const Condition cond) { |
| 2229 ASSERT(Isolate::Current()->cpu_features()->IsEnabled(VFP3)); | 2229 ASSERT(Isolate::Current()->cpu_features()->IsEnabled(VFP3)); |
| 2230 emit(EncodeVCVT(F32, dst.code(), F64, src.code(), mode, cond)); | 2230 emit(EncodeVCVT(F32, dst.code(), F64, src.code(), mode, cond)); |
| 2231 } | 2231 } |
| 2232 | 2232 |
| 2233 | 2233 |
| 2234 void Assembler::vabs(const DwVfpRegister dst, |
| 2235 const DwVfpRegister src, |
| 2236 const Condition cond) { |
| 2237 emit(cond | 0xE*B24 | 0xB*B20 | dst.code()*B12 | |
| 2238 0x5*B9 | B8 | 0x3*B6 | src.code()); |
| 2239 } |
| 2240 |
| 2241 |
| 2234 void Assembler::vadd(const DwVfpRegister dst, | 2242 void Assembler::vadd(const DwVfpRegister dst, |
| 2235 const DwVfpRegister src1, | 2243 const DwVfpRegister src1, |
| 2236 const DwVfpRegister src2, | 2244 const DwVfpRegister src2, |
| 2237 const Condition cond) { | 2245 const Condition cond) { |
| 2238 // Dd = vadd(Dn, Dm) double precision floating point addition. | 2246 // Dd = vadd(Dn, Dm) double precision floating point addition. |
| 2239 // Dd = D:Vd; Dm=M:Vm; Dn=N:Vm. | 2247 // Dd = D:Vd; Dm=M:Vm; Dn=N:Vm. |
| 2240 // Instruction details available in ARM DDI 0406A, A8-536. | 2248 // Instruction details available in ARM DDI 0406A, A8-536. |
| 2241 // cond(31-28) | 11100(27-23)| D=?(22) | 11(21-20) | Vn(19-16) | | 2249 // cond(31-28) | 11100(27-23)| D=?(22) | 11(21-20) | Vn(19-16) | |
| 2242 // Vd(15-12) | 101(11-9) | sz(8)=1 | N(7)=0 | 0(6) | M=?(5) | 0(4) | Vm(3-0) | 2250 // Vd(15-12) | 101(11-9) | sz(8)=1 | N(7)=0 | 0(6) | M=?(5) | 0(4) | Vm(3-0) |
| 2243 ASSERT(Isolate::Current()->cpu_features()->IsEnabled(VFP3)); | 2251 ASSERT(Isolate::Current()->cpu_features()->IsEnabled(VFP3)); |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2610 | 2618 |
| 2611 // Since a constant pool was just emitted, move the check offset forward by | 2619 // Since a constant pool was just emitted, move the check offset forward by |
| 2612 // the standard interval. | 2620 // the standard interval. |
| 2613 next_buffer_check_ = pc_offset() + kCheckConstInterval; | 2621 next_buffer_check_ = pc_offset() + kCheckConstInterval; |
| 2614 } | 2622 } |
| 2615 | 2623 |
| 2616 | 2624 |
| 2617 } } // namespace v8::internal | 2625 } } // namespace v8::internal |
| 2618 | 2626 |
| 2619 #endif // V8_TARGET_ARCH_ARM | 2627 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |