Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(638)

Side by Side Diff: src/arm/assembler-arm.cc

Issue 6368053: Implements DoubleToI on ARM. Refactor some VFP code at the same time and... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/arm/assembler-arm.h ('k') | src/arm/constants-arm.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2106 matching lines...) Expand 10 before | Expand all | Expand 10 after
2117 *vm = reg_code & 0x0F; 2117 *vm = reg_code & 0x0F;
2118 } 2118 }
2119 } 2119 }
2120 2120
2121 2121
2122 // Encode vcvt.src_type.dst_type instruction. 2122 // Encode vcvt.src_type.dst_type instruction.
2123 static Instr EncodeVCVT(const VFPType dst_type, 2123 static Instr EncodeVCVT(const VFPType dst_type,
2124 const int dst_code, 2124 const int dst_code,
2125 const VFPType src_type, 2125 const VFPType src_type,
2126 const int src_code, 2126 const int src_code,
2127 Assembler::ConversionMode mode, 2127 VFPConversionMode mode,
2128 const Condition cond) { 2128 const Condition cond) {
2129 ASSERT(src_type != dst_type); 2129 ASSERT(src_type != dst_type);
2130 int D, Vd, M, Vm; 2130 int D, Vd, M, Vm;
2131 SplitRegCode(src_type, src_code, &Vm, &M); 2131 SplitRegCode(src_type, src_code, &Vm, &M);
2132 SplitRegCode(dst_type, dst_code, &Vd, &D); 2132 SplitRegCode(dst_type, dst_code, &Vd, &D);
2133 2133
2134 if (IsIntegerVFPType(dst_type) || IsIntegerVFPType(src_type)) { 2134 if (IsIntegerVFPType(dst_type) || IsIntegerVFPType(src_type)) {
2135 // Conversion between IEEE floating point and 32-bit integer. 2135 // Conversion between IEEE floating point and 32-bit integer.
2136 // Instruction details available in ARM DDI 0406B, A8.6.295. 2136 // Instruction details available in ARM DDI 0406B, A8.6.295.
2137 // cond(31-28) | 11101(27-23)| D(22) | 11(21-20) | 1(19) | opc2(18-16) | 2137 // cond(31-28) | 11101(27-23)| D(22) | 11(21-20) | 1(19) | opc2(18-16) |
(...skipping 22 matching lines...) Expand all
2160 // Vd(15-12) | 101(11-9) | sz(8) | 1(7) | 1(6) | M(5) | 0(4) | Vm(3-0) 2160 // Vd(15-12) | 101(11-9) | sz(8) | 1(7) | 1(6) | M(5) | 0(4) | Vm(3-0)
2161 int sz = IsDoubleVFPType(src_type) ? 0x1 : 0x0; 2161 int sz = IsDoubleVFPType(src_type) ? 0x1 : 0x0;
2162 return (cond | 0xE*B24 | B23 | D*B22 | 0x3*B20 | 0x7*B16 | 2162 return (cond | 0xE*B24 | B23 | D*B22 | 0x3*B20 | 0x7*B16 |
2163 Vd*B12 | 0x5*B9 | sz*B8 | B7 | B6 | M*B5 | Vm); 2163 Vd*B12 | 0x5*B9 | sz*B8 | B7 | B6 | M*B5 | Vm);
2164 } 2164 }
2165 } 2165 }
2166 2166
2167 2167
2168 void Assembler::vcvt_f64_s32(const DwVfpRegister dst, 2168 void Assembler::vcvt_f64_s32(const DwVfpRegister dst,
2169 const SwVfpRegister src, 2169 const SwVfpRegister src,
2170 ConversionMode mode, 2170 VFPConversionMode mode,
2171 const Condition cond) { 2171 const Condition cond) {
2172 ASSERT(CpuFeatures::IsEnabled(VFP3)); 2172 ASSERT(CpuFeatures::IsEnabled(VFP3));
2173 emit(EncodeVCVT(F64, dst.code(), S32, src.code(), mode, cond)); 2173 emit(EncodeVCVT(F64, dst.code(), S32, src.code(), mode, cond));
2174 } 2174 }
2175 2175
2176 2176
2177 void Assembler::vcvt_f32_s32(const SwVfpRegister dst, 2177 void Assembler::vcvt_f32_s32(const SwVfpRegister dst,
2178 const SwVfpRegister src, 2178 const SwVfpRegister src,
2179 ConversionMode mode, 2179 VFPConversionMode mode,
2180 const Condition cond) { 2180 const Condition cond) {
2181 ASSERT(CpuFeatures::IsEnabled(VFP3)); 2181 ASSERT(CpuFeatures::IsEnabled(VFP3));
2182 emit(EncodeVCVT(F32, dst.code(), S32, src.code(), mode, cond)); 2182 emit(EncodeVCVT(F32, dst.code(), S32, src.code(), mode, cond));
2183 } 2183 }
2184 2184
2185 2185
2186 void Assembler::vcvt_f64_u32(const DwVfpRegister dst, 2186 void Assembler::vcvt_f64_u32(const DwVfpRegister dst,
2187 const SwVfpRegister src, 2187 const SwVfpRegister src,
2188 ConversionMode mode, 2188 VFPConversionMode mode,
2189 const Condition cond) { 2189 const Condition cond) {
2190 ASSERT(CpuFeatures::IsEnabled(VFP3)); 2190 ASSERT(CpuFeatures::IsEnabled(VFP3));
2191 emit(EncodeVCVT(F64, dst.code(), U32, src.code(), mode, cond)); 2191 emit(EncodeVCVT(F64, dst.code(), U32, src.code(), mode, cond));
2192 } 2192 }
2193 2193
2194 2194
2195 void Assembler::vcvt_s32_f64(const SwVfpRegister dst, 2195 void Assembler::vcvt_s32_f64(const SwVfpRegister dst,
2196 const DwVfpRegister src, 2196 const DwVfpRegister src,
2197 ConversionMode mode, 2197 VFPConversionMode mode,
2198 const Condition cond) { 2198 const Condition cond) {
2199 ASSERT(CpuFeatures::IsEnabled(VFP3)); 2199 ASSERT(CpuFeatures::IsEnabled(VFP3));
2200 emit(EncodeVCVT(S32, dst.code(), F64, src.code(), mode, cond)); 2200 emit(EncodeVCVT(S32, dst.code(), F64, src.code(), mode, cond));
2201 } 2201 }
2202 2202
2203 2203
2204 void Assembler::vcvt_u32_f64(const SwVfpRegister dst, 2204 void Assembler::vcvt_u32_f64(const SwVfpRegister dst,
2205 const DwVfpRegister src, 2205 const DwVfpRegister src,
2206 ConversionMode mode, 2206 VFPConversionMode mode,
2207 const Condition cond) { 2207 const Condition cond) {
2208 ASSERT(CpuFeatures::IsEnabled(VFP3)); 2208 ASSERT(CpuFeatures::IsEnabled(VFP3));
2209 emit(EncodeVCVT(U32, dst.code(), F64, src.code(), mode, cond)); 2209 emit(EncodeVCVT(U32, dst.code(), F64, src.code(), mode, cond));
2210 } 2210 }
2211 2211
2212 2212
2213 void Assembler::vcvt_f64_f32(const DwVfpRegister dst, 2213 void Assembler::vcvt_f64_f32(const DwVfpRegister dst,
2214 const SwVfpRegister src, 2214 const SwVfpRegister src,
2215 ConversionMode mode, 2215 VFPConversionMode mode,
2216 const Condition cond) { 2216 const Condition cond) {
2217 ASSERT(CpuFeatures::IsEnabled(VFP3)); 2217 ASSERT(CpuFeatures::IsEnabled(VFP3));
2218 emit(EncodeVCVT(F64, dst.code(), F32, src.code(), mode, cond)); 2218 emit(EncodeVCVT(F64, dst.code(), F32, src.code(), mode, cond));
2219 } 2219 }
2220 2220
2221 2221
2222 void Assembler::vcvt_f32_f64(const SwVfpRegister dst, 2222 void Assembler::vcvt_f32_f64(const SwVfpRegister dst,
2223 const DwVfpRegister src, 2223 const DwVfpRegister src,
2224 ConversionMode mode, 2224 VFPConversionMode mode,
2225 const Condition cond) { 2225 const Condition cond) {
2226 ASSERT(CpuFeatures::IsEnabled(VFP3)); 2226 ASSERT(CpuFeatures::IsEnabled(VFP3));
2227 emit(EncodeVCVT(F32, dst.code(), F64, src.code(), mode, cond)); 2227 emit(EncodeVCVT(F32, dst.code(), F64, src.code(), mode, cond));
2228 } 2228 }
2229 2229
2230 2230
2231 void Assembler::vabs(const DwVfpRegister dst, 2231 void Assembler::vabs(const DwVfpRegister dst,
2232 const DwVfpRegister src, 2232 const DwVfpRegister src,
2233 const Condition cond) { 2233 const Condition cond) {
2234 emit(cond | 0xE*B24 | 0xB*B20 | dst.code()*B12 | 2234 emit(cond | 0xE*B24 | 0xB*B20 | dst.code()*B12 |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
2615 2615
2616 // Since a constant pool was just emitted, move the check offset forward by 2616 // Since a constant pool was just emitted, move the check offset forward by
2617 // the standard interval. 2617 // the standard interval.
2618 next_buffer_check_ = pc_offset() + kCheckConstInterval; 2618 next_buffer_check_ = pc_offset() + kCheckConstInterval;
2619 } 2619 }
2620 2620
2621 2621
2622 } } // namespace v8::internal 2622 } } // namespace v8::internal
2623 2623
2624 #endif // V8_TARGET_ARCH_ARM 2624 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/assembler-arm.h ('k') | src/arm/constants-arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698