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

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

Issue 660072: Added fast support for Math.pow. This simply calculates the result using the... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 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
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 1180 matching lines...) Expand 10 before | Expand all | Expand 10 after
1191 1191
1192 1192
1193 void Assembler::shr_cl(Register dst) { 1193 void Assembler::shr_cl(Register dst) {
1194 EnsureSpace ensure_space(this); 1194 EnsureSpace ensure_space(this);
1195 last_pc_ = pc_; 1195 last_pc_ = pc_;
1196 EMIT(0xD3); 1196 EMIT(0xD3);
1197 EMIT(0xE8 | dst.code()); 1197 EMIT(0xE8 | dst.code());
1198 } 1198 }
1199 1199
1200 1200
1201 void Assembler::sqrt(XMMRegister dst, XMMRegister src) {
1202 EnsureSpace ensure_space(this);
1203 last_pc_ = pc_;
1204 EMIT(0xF2);
1205 EMIT(0x0F);
1206 EMIT(0x51);
1207 emit_sse_operand(dst, src);
1208 }
1209
1210
1201 void Assembler::subb(const Operand& op, int8_t imm8) { 1211 void Assembler::subb(const Operand& op, int8_t imm8) {
1202 EnsureSpace ensure_space(this); 1212 EnsureSpace ensure_space(this);
1203 last_pc_ = pc_; 1213 last_pc_ = pc_;
1204 if (op.is_reg(eax)) { 1214 if (op.is_reg(eax)) {
1205 EMIT(0x2c); 1215 EMIT(0x2c);
1206 } else { 1216 } else {
1207 EMIT(0x80); 1217 EMIT(0x80);
1208 emit_operand(ebp, op); // ebp == 5 1218 emit_operand(ebp, op); // ebp == 5
1209 } 1219 }
1210 EMIT(imm8); 1220 EMIT(imm8);
(...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after
2028 ASSERT(CpuFeatures::IsEnabled(SSE2)); 2038 ASSERT(CpuFeatures::IsEnabled(SSE2));
2029 EnsureSpace ensure_space(this); 2039 EnsureSpace ensure_space(this);
2030 last_pc_ = pc_; 2040 last_pc_ = pc_;
2031 EMIT(0xF2); 2041 EMIT(0xF2);
2032 EMIT(0x0F); 2042 EMIT(0x0F);
2033 EMIT(0x2A); 2043 EMIT(0x2A);
2034 emit_sse_operand(dst, src); 2044 emit_sse_operand(dst, src);
2035 } 2045 }
2036 2046
2037 2047
2048 void Assembler::cvtss2sd(XMMRegister dst, XMMRegister src) {
2049 ASSERT(CpuFeatures::IsEnabled(SSE2));
2050 EnsureSpace ensure_space(this);
2051 last_pc_ = pc_;
2052 EMIT(0xF3);
2053 EMIT(0x0F);
2054 EMIT(0x5A);
2055 emit_sse_operand(dst, src);
2056 }
2057
2058
2038 void Assembler::addsd(XMMRegister dst, XMMRegister src) { 2059 void Assembler::addsd(XMMRegister dst, XMMRegister src) {
2039 ASSERT(CpuFeatures::IsEnabled(SSE2)); 2060 ASSERT(CpuFeatures::IsEnabled(SSE2));
2040 EnsureSpace ensure_space(this); 2061 EnsureSpace ensure_space(this);
2041 last_pc_ = pc_; 2062 last_pc_ = pc_;
2042 EMIT(0xF2); 2063 EMIT(0xF2);
2043 EMIT(0x0F); 2064 EMIT(0x0F);
2044 EMIT(0x58); 2065 EMIT(0x58);
2045 emit_sse_operand(dst, src); 2066 emit_sse_operand(dst, src);
2046 } 2067 }
2047 2068
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
2173 void Assembler::movsd(XMMRegister dst, const Operand& src) { 2194 void Assembler::movsd(XMMRegister dst, const Operand& src) {
2174 ASSERT(CpuFeatures::IsEnabled(SSE2)); 2195 ASSERT(CpuFeatures::IsEnabled(SSE2));
2175 EnsureSpace ensure_space(this); 2196 EnsureSpace ensure_space(this);
2176 last_pc_ = pc_; 2197 last_pc_ = pc_;
2177 EMIT(0xF2); // double 2198 EMIT(0xF2); // double
2178 EMIT(0x0F); 2199 EMIT(0x0F);
2179 EMIT(0x10); // load 2200 EMIT(0x10); // load
2180 emit_sse_operand(dst, src); 2201 emit_sse_operand(dst, src);
2181 } 2202 }
2182 2203
2204 void Assembler::movsd(XMMRegister dst, XMMRegister src) {
2205 ASSERT(CpuFeatures::IsEnabled(SSE2));
2206 EnsureSpace ensure_space(this);
2207 last_pc_ = pc_;
2208 EMIT(0xF2);
2209 EMIT(0x0F);
2210 EMIT(0x10);
2211 emit_sse_operand(dst, src);
2212 }
2213
2214
2215 void Assembler::movd(XMMRegister dst, const Operand& src) {
2216 ASSERT(CpuFeatures::IsEnabled(SSE2));
2217 EnsureSpace ensure_space(this);
2218 last_pc_ = pc_;
2219 EMIT(0x66);
2220 EMIT(0x0F);
2221 EMIT(0x6E);
2222 emit_sse_operand(dst, src);
2223 }
2224
2225
2226 void Assembler::pxor(XMMRegister dst, XMMRegister src) {
2227 ASSERT(CpuFeatures::IsEnabled(SSE2));
2228 EnsureSpace ensure_space(this);
2229 last_pc_ = pc_;
2230 EMIT(0x66);
2231 EMIT(0x0F);
2232 EMIT(0xEF);
2233 emit_sse_operand(dst, src);
2234 }
2235
2236
2237 void Assembler::ptest(XMMRegister dst, XMMRegister src) {
2238 ASSERT(CpuFeatures::IsEnabled(SSE2));
2239 EnsureSpace ensure_space(this);
2240 last_pc_ = pc_;
2241 EMIT(0x66);
2242 EMIT(0x0F);
2243 EMIT(0x38);
2244 EMIT(0x17);
2245 emit_sse_operand(dst, src);
2246 }
2247
2183 2248
2184 void Assembler::emit_sse_operand(XMMRegister reg, const Operand& adr) { 2249 void Assembler::emit_sse_operand(XMMRegister reg, const Operand& adr) {
2185 Register ireg = { reg.code() }; 2250 Register ireg = { reg.code() };
2186 emit_operand(ireg, adr); 2251 emit_operand(ireg, adr);
2187 } 2252 }
2188 2253
2189 2254
2190 void Assembler::emit_sse_operand(XMMRegister dst, XMMRegister src) { 2255 void Assembler::emit_sse_operand(XMMRegister dst, XMMRegister src) {
2191 EMIT(0xC0 | dst.code() << 3 | src.code()); 2256 EMIT(0xC0 | dst.code() << 3 | src.code());
2192 } 2257 }
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
2414 push_insn[1] = 13; // Skip over coverage insns. 2479 push_insn[1] = 13; // Skip over coverage insns.
2415 if (coverage_log != NULL) { 2480 if (coverage_log != NULL) {
2416 fprintf(coverage_log, "%s\n", file_line); 2481 fprintf(coverage_log, "%s\n", file_line);
2417 fflush(coverage_log); 2482 fflush(coverage_log);
2418 } 2483 }
2419 } 2484 }
2420 2485
2421 #endif 2486 #endif
2422 2487
2423 } } // namespace v8::internal 2488 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/assembler-ia32.h ('k') | src/ia32/codegen-ia32.h » ('j') | src/ia32/codegen-ia32.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698