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

Side by Side Diff: src/assembler.cc

Issue 2161513002: [x64] add Absps/d and Negps/d macro (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: add Abspd and Negpd, and move constants to external reference Created 4 years, 5 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
« no previous file with comments | « src/assembler.h ('k') | src/external-reference-table.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 are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 double min_int; 119 double min_int;
120 double one_half; 120 double one_half;
121 double minus_one_half; 121 double minus_one_half;
122 double negative_infinity; 122 double negative_infinity;
123 double the_hole_nan; 123 double the_hole_nan;
124 double uint32_bias; 124 double uint32_bias;
125 }; 125 };
126 126
127 static DoubleConstant double_constants; 127 static DoubleConstant double_constants;
128 128
129 static struct V8_ALIGNED(16) {
130 uint32_t a;
131 uint32_t b;
132 uint32_t c;
133 uint32_t d;
134 } float_absolute_constant = {0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF};
135
136 static struct V8_ALIGNED(16) {
137 uint32_t a;
138 uint32_t b;
139 uint32_t c;
140 uint32_t d;
141 } float_negate_constant = {0x80000000, 0x80000000, 0x80000000, 0x80000000};
142
143 static struct V8_ALIGNED(16) {
144 uint64_t a;
145 uint64_t b;
146 } double_absolute_constant = {V8_UINT64_C(0x7FFFFFFFFFFFFFFF),
147 V8_UINT64_C(0x7FFFFFFFFFFFFFFF)};
148
149 static struct V8_ALIGNED(16) {
150 uint64_t a;
151 uint64_t b;
152 } double_negate_constant = {V8_UINT64_C(0x8000000000000000),
153 V8_UINT64_C(0x8000000000000000)};
154
129 const char* const RelocInfo::kFillerCommentString = "DEOPTIMIZATION PADDING"; 155 const char* const RelocInfo::kFillerCommentString = "DEOPTIMIZATION PADDING";
130 156
131 // ----------------------------------------------------------------------------- 157 // -----------------------------------------------------------------------------
132 // Implementation of AssemblerBase 158 // Implementation of AssemblerBase
133 159
134 AssemblerBase::AssemblerBase(Isolate* isolate, void* buffer, int buffer_size) 160 AssemblerBase::AssemblerBase(Isolate* isolate, void* buffer, int buffer_size)
135 : isolate_(isolate), 161 : isolate_(isolate),
136 jit_cookie_(0), 162 jit_cookie_(0),
137 enabled_cpu_features_(0), 163 enabled_cpu_features_(0),
138 emit_debug_code_(FLAG_debug_code), 164 emit_debug_code_(FLAG_debug_code),
(...skipping 1166 matching lines...) Expand 10 before | Expand all | Expand 10 after
1305 reinterpret_cast<void*>(&double_constants.the_hole_nan)); 1331 reinterpret_cast<void*>(&double_constants.the_hole_nan));
1306 } 1332 }
1307 1333
1308 1334
1309 ExternalReference ExternalReference::address_of_uint32_bias() { 1335 ExternalReference ExternalReference::address_of_uint32_bias() {
1310 return ExternalReference( 1336 return ExternalReference(
1311 reinterpret_cast<void*>(&double_constants.uint32_bias)); 1337 reinterpret_cast<void*>(&double_constants.uint32_bias));
1312 } 1338 }
1313 1339
1314 1340
1341 ExternalReference ExternalReference::address_of_float_abs_constant() {
1342 return ExternalReference(reinterpret_cast<void*>(&float_absolute_constant));
1343 }
1344
1345
1346 ExternalReference ExternalReference::address_of_float_neg_constant() {
1347 return ExternalReference(reinterpret_cast<void*>(&float_negate_constant));
1348 }
1349
1350
1351 ExternalReference ExternalReference::address_of_double_abs_constant() {
1352 return ExternalReference(reinterpret_cast<void*>(&double_absolute_constant));
1353 }
1354
1355
1356 ExternalReference ExternalReference::address_of_double_neg_constant() {
1357 return ExternalReference(reinterpret_cast<void*>(&double_negate_constant));
1358 }
1359
1360
1315 ExternalReference ExternalReference::is_profiling_address(Isolate* isolate) { 1361 ExternalReference ExternalReference::is_profiling_address(Isolate* isolate) {
1316 return ExternalReference(isolate->is_profiling_address()); 1362 return ExternalReference(isolate->is_profiling_address());
1317 } 1363 }
1318 1364
1319 1365
1320 ExternalReference ExternalReference::invoke_function_callback( 1366 ExternalReference ExternalReference::invoke_function_callback(
1321 Isolate* isolate) { 1367 Isolate* isolate) {
1322 Address thunk_address = FUNCTION_ADDR(&InvokeFunctionCallback); 1368 Address thunk_address = FUNCTION_ADDR(&InvokeFunctionCallback);
1323 ExternalReference::Type thunk_type = ExternalReference::PROFILING_API_CALL; 1369 ExternalReference::Type thunk_type = ExternalReference::PROFILING_API_CALL;
1324 ApiFunction thunk_fun(thunk_address); 1370 ApiFunction thunk_fun(thunk_address);
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after
1893 1939
1894 1940
1895 void Assembler::DataAlign(int m) { 1941 void Assembler::DataAlign(int m) {
1896 DCHECK(m >= 2 && base::bits::IsPowerOfTwo32(m)); 1942 DCHECK(m >= 2 && base::bits::IsPowerOfTwo32(m));
1897 while ((pc_offset() & (m - 1)) != 0) { 1943 while ((pc_offset() & (m - 1)) != 0) {
1898 db(0); 1944 db(0);
1899 } 1945 }
1900 } 1946 }
1901 } // namespace internal 1947 } // namespace internal
1902 } // namespace v8 1948 } // namespace v8
OLDNEW
« no previous file with comments | « src/assembler.h ('k') | src/external-reference-table.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698