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

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

Issue 60093005: Introduce addps/subps/mulps/divps for IA32/X64 (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Put all SSE1 instruction after SSE2 flag Created 7 years, 1 month 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
« no previous file with comments | « src/ia32/assembler-ia32.h ('k') | src/ia32/disasm-ia32.cc » ('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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 82
83 const char* IntelDoubleRegister::AllocationIndexToString(int index) { 83 const char* IntelDoubleRegister::AllocationIndexToString(int index) {
84 if (CpuFeatures::IsSupported(SSE2)) { 84 if (CpuFeatures::IsSupported(SSE2)) {
85 return XMMRegister::AllocationIndexToString(index); 85 return XMMRegister::AllocationIndexToString(index);
86 } else { 86 } else {
87 return X87Register::AllocationIndexToString(index); 87 return X87Register::AllocationIndexToString(index);
88 } 88 }
89 } 89 }
90 90
91 91
92 // The Probe method needs executable memory, so it uses Heap::CreateCode.
93 // Allocation failure is silent and leads to safe default.
94 void CpuFeatures::Probe() { 92 void CpuFeatures::Probe() {
95 ASSERT(!initialized_); 93 ASSERT(!initialized_);
96 ASSERT(supported_ == 0); 94 ASSERT(supported_ == 0);
97 #ifdef DEBUG 95 #ifdef DEBUG
98 initialized_ = true; 96 initialized_ = true;
99 #endif 97 #endif
100 if (Serializer::enabled()) { 98 if (Serializer::enabled()) {
101 supported_ |= OS::CpuFeaturesImpliedByPlatform(); 99 supported_ |= OS::CpuFeaturesImpliedByPlatform();
102 return; // No features if we might serialize. 100 return; // No features if we might serialize.
103 } 101 }
(...skipping 1958 matching lines...) Expand 10 before | Expand all | Expand 10 after
2062 void Assembler::xorpd(XMMRegister dst, XMMRegister src) { 2060 void Assembler::xorpd(XMMRegister dst, XMMRegister src) {
2063 ASSERT(IsEnabled(SSE2)); 2061 ASSERT(IsEnabled(SSE2));
2064 EnsureSpace ensure_space(this); 2062 EnsureSpace ensure_space(this);
2065 EMIT(0x66); 2063 EMIT(0x66);
2066 EMIT(0x0F); 2064 EMIT(0x0F);
2067 EMIT(0x57); 2065 EMIT(0x57);
2068 emit_sse_operand(dst, src); 2066 emit_sse_operand(dst, src);
2069 } 2067 }
2070 2068
2071 2069
2072 void Assembler::andps(XMMRegister dst, XMMRegister src) { 2070 void Assembler::andps(XMMRegister dst, const Operand& src) {
2071 ASSERT(IsEnabled(SSE2));
2073 EnsureSpace ensure_space(this); 2072 EnsureSpace ensure_space(this);
2074 EMIT(0x0F); 2073 EMIT(0x0F);
2075 EMIT(0x54); 2074 EMIT(0x54);
2076 emit_sse_operand(dst, src); 2075 emit_sse_operand(dst, src);
2077 } 2076 }
2078 2077
2079 2078
2080 void Assembler::orps(XMMRegister dst, XMMRegister src) { 2079 void Assembler::orps(XMMRegister dst, const Operand& src) {
2080 ASSERT(IsEnabled(SSE2));
2081 EnsureSpace ensure_space(this); 2081 EnsureSpace ensure_space(this);
2082 EMIT(0x0F); 2082 EMIT(0x0F);
2083 EMIT(0x56); 2083 EMIT(0x56);
2084 emit_sse_operand(dst, src); 2084 emit_sse_operand(dst, src);
2085 } 2085 }
2086 2086
2087 2087
2088 void Assembler::xorps(XMMRegister dst, XMMRegister src) { 2088 void Assembler::xorps(XMMRegister dst, const Operand& src) {
2089 ASSERT(IsEnabled(SSE2));
2089 EnsureSpace ensure_space(this); 2090 EnsureSpace ensure_space(this);
2090 EMIT(0x0F); 2091 EMIT(0x0F);
2091 EMIT(0x57); 2092 EMIT(0x57);
2092 emit_sse_operand(dst, src); 2093 emit_sse_operand(dst, src);
2093 } 2094 }
2094 2095
2095 2096
2097 void Assembler::addps(XMMRegister dst, const Operand& src) {
2098 ASSERT(IsEnabled(SSE2));
2099 EnsureSpace ensure_space(this);
2100 EMIT(0x0F);
2101 EMIT(0x58);
2102 emit_sse_operand(dst, src);
2103 }
2104
2105
2106 void Assembler::subps(XMMRegister dst, const Operand& src) {
2107 ASSERT(IsEnabled(SSE2));
2108 EnsureSpace ensure_space(this);
2109 EMIT(0x0F);
2110 EMIT(0x5C);
2111 emit_sse_operand(dst, src);
2112 }
2113
2114
2115 void Assembler::mulps(XMMRegister dst, const Operand& src) {
2116 ASSERT(IsEnabled(SSE2));
2117 EnsureSpace ensure_space(this);
2118 EMIT(0x0F);
2119 EMIT(0x59);
2120 emit_sse_operand(dst, src);
2121 }
2122
2123
2124 void Assembler::divps(XMMRegister dst, const Operand& src) {
2125 ASSERT(IsEnabled(SSE2));
2126 EnsureSpace ensure_space(this);
2127 EMIT(0x0F);
2128 EMIT(0x5E);
2129 emit_sse_operand(dst, src);
2130 }
2131
2132
2096 void Assembler::sqrtsd(XMMRegister dst, XMMRegister src) { 2133 void Assembler::sqrtsd(XMMRegister dst, XMMRegister src) {
2097 ASSERT(IsEnabled(SSE2)); 2134 ASSERT(IsEnabled(SSE2));
2098 EnsureSpace ensure_space(this); 2135 EnsureSpace ensure_space(this);
2099 EMIT(0xF2); 2136 EMIT(0xF2);
2100 EMIT(0x0F); 2137 EMIT(0x0F);
2101 EMIT(0x51); 2138 EMIT(0x51);
2102 emit_sse_operand(dst, src); 2139 emit_sse_operand(dst, src);
2103 } 2140 }
2104 2141
2105 2142
2106 void Assembler::andpd(XMMRegister dst, XMMRegister src) { 2143 void Assembler::andpd(XMMRegister dst, XMMRegister src) {
2107 ASSERT(IsEnabled(SSE2)); 2144 ASSERT(IsEnabled(SSE2));
2108 EnsureSpace ensure_space(this); 2145 EnsureSpace ensure_space(this);
2109 EMIT(0x66); 2146 EMIT(0x66);
2110 EMIT(0x0F); 2147 EMIT(0x0F);
2111 EMIT(0x54); 2148 EMIT(0x54);
2112 emit_sse_operand(dst, src); 2149 emit_sse_operand(dst, src);
2113 } 2150 }
2114 2151
2115 2152
2116 void Assembler::orpd(XMMRegister dst, XMMRegister src) { 2153 void Assembler::orpd(XMMRegister dst, XMMRegister src) {
2117 ASSERT(IsEnabled(SSE2)); 2154 ASSERT(IsEnabled(SSE2));
2118 EnsureSpace ensure_space(this); 2155 EnsureSpace ensure_space(this);
2119 EMIT(0x66); 2156 EMIT(0x66);
2120 EMIT(0x0F); 2157 EMIT(0x0F);
2121 EMIT(0x56); 2158 EMIT(0x56);
2122 emit_sse_operand(dst, src); 2159 emit_sse_operand(dst, src);
2123 } 2160 }
2124 2161
2125
2126 void Assembler::ucomisd(XMMRegister dst, XMMRegister src) {
2127 ASSERT(IsEnabled(SSE2));
2128 EnsureSpace ensure_space(this);
2129 EMIT(0x66);
2130 EMIT(0x0F);
2131 EMIT(0x2E);
2132 emit_sse_operand(dst, src);
2133 }
2134
2135 2162
2136 void Assembler::ucomisd(XMMRegister dst, const Operand& src) { 2163 void Assembler::ucomisd(XMMRegister dst, const Operand& src) {
2137 ASSERT(IsEnabled(SSE2)); 2164 ASSERT(IsEnabled(SSE2));
2138 EnsureSpace ensure_space(this); 2165 EnsureSpace ensure_space(this);
2139 EMIT(0x66); 2166 EMIT(0x66);
2140 EMIT(0x0F); 2167 EMIT(0x0F);
2141 EMIT(0x2E); 2168 EMIT(0x2E);
2142 emit_sse_operand(dst, src); 2169 emit_sse_operand(dst, src);
2143 } 2170 }
2144 2171
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
2198 2225
2199 void Assembler::movaps(XMMRegister dst, XMMRegister src) { 2226 void Assembler::movaps(XMMRegister dst, XMMRegister src) {
2200 ASSERT(IsEnabled(SSE2)); 2227 ASSERT(IsEnabled(SSE2));
2201 EnsureSpace ensure_space(this); 2228 EnsureSpace ensure_space(this);
2202 EMIT(0x0F); 2229 EMIT(0x0F);
2203 EMIT(0x28); 2230 EMIT(0x28);
2204 emit_sse_operand(dst, src); 2231 emit_sse_operand(dst, src);
2205 } 2232 }
2206 2233
2207 2234
2235 void Assembler::shufps(XMMRegister dst, XMMRegister src, byte imm8) {
2236 ASSERT(IsEnabled(SSE2));
2237 ASSERT(is_uint8(imm8));
2238 EnsureSpace ensure_space(this);
2239 EMIT(0x0F);
2240 EMIT(0xC6);
2241 emit_sse_operand(dst, src);
2242 EMIT(imm8);
2243 }
2244
2245
2208 void Assembler::movdqa(const Operand& dst, XMMRegister src) { 2246 void Assembler::movdqa(const Operand& dst, XMMRegister src) {
2209 ASSERT(IsEnabled(SSE2)); 2247 ASSERT(IsEnabled(SSE2));
2210 EnsureSpace ensure_space(this); 2248 EnsureSpace ensure_space(this);
2211 EMIT(0x66); 2249 EMIT(0x66);
2212 EMIT(0x0F); 2250 EMIT(0x0F);
2213 EMIT(0x7F); 2251 EMIT(0x7F);
2214 emit_sse_operand(src, dst); 2252 emit_sse_operand(src, dst);
2215 } 2253 }
2216 2254
2217 2255
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
2290 void Assembler::movsd(XMMRegister dst, const Operand& src) { 2328 void Assembler::movsd(XMMRegister dst, const Operand& src) {
2291 ASSERT(IsEnabled(SSE2)); 2329 ASSERT(IsEnabled(SSE2));
2292 EnsureSpace ensure_space(this); 2330 EnsureSpace ensure_space(this);
2293 EMIT(0xF2); // double 2331 EMIT(0xF2); // double
2294 EMIT(0x0F); 2332 EMIT(0x0F);
2295 EMIT(0x10); // load 2333 EMIT(0x10); // load
2296 emit_sse_operand(dst, src); 2334 emit_sse_operand(dst, src);
2297 } 2335 }
2298 2336
2299 2337
2300 void Assembler::movsd(XMMRegister dst, XMMRegister src) {
2301 ASSERT(IsEnabled(SSE2));
2302 EnsureSpace ensure_space(this);
2303 EMIT(0xF2);
2304 EMIT(0x0F);
2305 EMIT(0x10);
2306 emit_sse_operand(dst, src);
2307 }
2308
2309
2310 void Assembler::movss(const Operand& dst, XMMRegister src ) { 2338 void Assembler::movss(const Operand& dst, XMMRegister src ) {
2311 ASSERT(IsEnabled(SSE2)); 2339 ASSERT(IsEnabled(SSE2));
2312 EnsureSpace ensure_space(this); 2340 EnsureSpace ensure_space(this);
2313 EMIT(0xF3); // float 2341 EMIT(0xF3); // float
2314 EMIT(0x0F); 2342 EMIT(0x0F);
2315 EMIT(0x11); // store 2343 EMIT(0x11); // store
2316 emit_sse_operand(src, dst); 2344 emit_sse_operand(src, dst);
2317 } 2345 }
2318 2346
2319 2347
2320 void Assembler::movss(XMMRegister dst, const Operand& src) { 2348 void Assembler::movss(XMMRegister dst, const Operand& src) {
2321 ASSERT(IsEnabled(SSE2)); 2349 ASSERT(IsEnabled(SSE2));
2322 EnsureSpace ensure_space(this); 2350 EnsureSpace ensure_space(this);
2323 EMIT(0xF3); // float 2351 EMIT(0xF3); // float
2324 EMIT(0x0F); 2352 EMIT(0x0F);
2325 EMIT(0x10); // load 2353 EMIT(0x10); // load
2326 emit_sse_operand(dst, src); 2354 emit_sse_operand(dst, src);
2327 } 2355 }
2328 2356
2329 2357
2330 void Assembler::movss(XMMRegister dst, XMMRegister src) {
2331 ASSERT(IsEnabled(SSE2));
2332 EnsureSpace ensure_space(this);
2333 EMIT(0xF3);
2334 EMIT(0x0F);
2335 EMIT(0x10);
2336 emit_sse_operand(dst, src);
2337 }
2338
2339
2340 void Assembler::movd(XMMRegister dst, const Operand& src) { 2358 void Assembler::movd(XMMRegister dst, const Operand& src) {
2341 ASSERT(IsEnabled(SSE2)); 2359 ASSERT(IsEnabled(SSE2));
2342 EnsureSpace ensure_space(this); 2360 EnsureSpace ensure_space(this);
2343 EMIT(0x66); 2361 EMIT(0x66);
2344 EMIT(0x0F); 2362 EMIT(0x0F);
2345 EMIT(0x6E); 2363 EMIT(0x6E);
2346 emit_sse_operand(dst, src); 2364 emit_sse_operand(dst, src);
2347 } 2365 }
2348 2366
2349 2367
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
2707 fprintf(coverage_log, "%s\n", file_line); 2725 fprintf(coverage_log, "%s\n", file_line);
2708 fflush(coverage_log); 2726 fflush(coverage_log);
2709 } 2727 }
2710 } 2728 }
2711 2729
2712 #endif 2730 #endif
2713 2731
2714 } } // namespace v8::internal 2732 } } // namespace v8::internal
2715 2733
2716 #endif // V8_TARGET_ARCH_IA32 2734 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/assembler-ia32.h ('k') | src/ia32/disasm-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698