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

Side by Side Diff: src/compiler/s390/code-generator-s390.cc

Issue 2064783002: S390: [builtins] Introduce proper Float64Log1p, Float64Atan and Float64Atan2 operators. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 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 | « no previous file | src/compiler/s390/instruction-codes-s390.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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/code-generator.h" 5 #include "src/compiler/code-generator.h"
6 6
7 #include "src/ast/scopes.h" 7 #include "src/ast/scopes.h"
8 #include "src/compiler/code-generator-impl.h" 8 #include "src/compiler/code-generator-impl.h"
9 #include "src/compiler/gap-resolver.h" 9 #include "src/compiler/gap-resolver.h"
10 #include "src/compiler/node-matchers.h" 10 #include "src/compiler/node-matchers.h"
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 do { \ 378 do { \
379 FrameScope scope(masm(), StackFrame::MANUAL); \ 379 FrameScope scope(masm(), StackFrame::MANUAL); \
380 __ PrepareCallCFunction(0, 2, kScratchReg); \ 380 __ PrepareCallCFunction(0, 2, kScratchReg); \
381 __ MovToFloatParameters(i.InputDoubleRegister(0), \ 381 __ MovToFloatParameters(i.InputDoubleRegister(0), \
382 i.InputDoubleRegister(1)); \ 382 i.InputDoubleRegister(1)); \
383 __ CallCFunction(ExternalReference::mod_two_doubles_operation(isolate()), \ 383 __ CallCFunction(ExternalReference::mod_two_doubles_operation(isolate()), \
384 0, 2); \ 384 0, 2); \
385 __ MovFromFloatResult(i.OutputDoubleRegister()); \ 385 __ MovFromFloatResult(i.OutputDoubleRegister()); \
386 } while (0) 386 } while (0)
387 387
388 #define ASSEMBLE_IEEE754_UNOP(name) \
389 do { \
390 /* TODO(bmeurer): We should really get rid of this special instruction, */ \
391 /* and generate a CallAddress instruction instead. */ \
392 FrameScope scope(masm(), StackFrame::MANUAL); \
393 __ PrepareCallCFunction(0, 1, kScratchReg); \
394 __ MovToFloatParameter(i.InputDoubleRegister(0)); \
395 __ CallCFunction(ExternalReference::ieee754_##name##_function(isolate()), \
396 0, 1); \
397 /* Move the result in the double result register. */ \
398 __ MovFromFloatResult(i.OutputDoubleRegister()); \
399 DCHECK_EQ(LeaveRC, i.OutputRCBit()); \
400 } while (0)
401
402 #define ASSEMBLE_IEEE754_BINOP(name) \
403 do { \
404 /* TODO(bmeurer): We should really get rid of this special instruction, */ \
405 /* and generate a CallAddress instruction instead. */ \
406 FrameScope scope(masm(), StackFrame::MANUAL); \
407 __ PrepareCallCFunction(0, 2, kScratchReg); \
408 __ MovToFloatParameters(i.InputDoubleRegister(0), \
409 i.InputDoubleRegister(1)); \
410 __ CallCFunction(ExternalReference::ieee754_##name##_function(isolate()), \
411 0, 2); \
412 /* Move the result in the double result register. */ \
413 __ MovFromFloatResult(i.OutputDoubleRegister()); \
414 DCHECK_EQ(LeaveRC, i.OutputRCBit()); \
415 } while (0)
416
388 #define ASSEMBLE_FLOAT_MAX(double_scratch_reg, general_scratch_reg) \ 417 #define ASSEMBLE_FLOAT_MAX(double_scratch_reg, general_scratch_reg) \
389 do { \ 418 do { \
390 Label ge, done; \ 419 Label ge, done; \
391 __ cdbr(i.InputDoubleRegister(0), i.InputDoubleRegister(1)); \ 420 __ cdbr(i.InputDoubleRegister(0), i.InputDoubleRegister(1)); \
392 __ bge(&ge, Label::kNear); \ 421 __ bge(&ge, Label::kNear); \
393 __ Move(i.OutputDoubleRegister(), i.InputDoubleRegister(1)); \ 422 __ Move(i.OutputDoubleRegister(), i.InputDoubleRegister(1)); \
394 __ b(&done, Label::kNear); \ 423 __ b(&done, Label::kNear); \
395 __ bind(&ge); \ 424 __ bind(&ge); \
396 __ Move(i.OutputDoubleRegister(), i.InputDoubleRegister(0)); \ 425 __ Move(i.OutputDoubleRegister(), i.InputDoubleRegister(0)); \
397 __ bind(&done); \ 426 __ bind(&done); \
(...skipping 814 matching lines...) Expand 10 before | Expand all | Expand 10 after
1212 v8::internal::Assembler::FIDBRA_ROUND_TOWARD_POS_INF); 1241 v8::internal::Assembler::FIDBRA_ROUND_TOWARD_POS_INF);
1213 break; 1242 break;
1214 case kS390_TruncateFloat: 1243 case kS390_TruncateFloat:
1215 __ fiebra(i.OutputDoubleRegister(), i.InputDoubleRegister(0), 1244 __ fiebra(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
1216 v8::internal::Assembler::FIDBRA_ROUND_TOWARD_0); 1245 v8::internal::Assembler::FIDBRA_ROUND_TOWARD_0);
1217 break; 1246 break;
1218 // Double operations 1247 // Double operations
1219 case kS390_ModDouble: 1248 case kS390_ModDouble:
1220 ASSEMBLE_FLOAT_MODULO(); 1249 ASSEMBLE_FLOAT_MODULO();
1221 break; 1250 break;
1222 case kS390_LogDouble: { 1251 case kIeee754Float64Atan:
1223 // TODO(bmeurer): We should really get rid of this special instruction, 1252 ASSEMBLE_IEEE754_UNOP(atan);
1224 // and generate a CallAddress instruction instead.
1225 FrameScope scope(masm(), StackFrame::MANUAL);
1226 __ PrepareCallCFunction(0, 1, kScratchReg);
1227 __ MovToFloatParameter(i.InputDoubleRegister(0));
1228 __ CallCFunction(ExternalReference::ieee754_log_function(isolate()), 0,
1229 1);
1230 // Move the result in the double result register.
1231 __ MovFromFloatResult(i.OutputDoubleRegister());
1232 break; 1253 break;
1233 } 1254 case kIeee754Float64Atan2:
1255 ASSEMBLE_IEEE754_BINOP(atan2);
1256 break;
1257 case kIeee754Float64Log:
1258 ASSEMBLE_IEEE754_UNOP(log);
1259 break;
1260 case kIeee754Float64Log1p:
1261 ASSEMBLE_IEEE754_UNOP(log1p);
1262 break;
1234 case kS390_Neg: 1263 case kS390_Neg:
1235 __ LoadComplementRR(i.OutputRegister(), i.InputRegister(0)); 1264 __ LoadComplementRR(i.OutputRegister(), i.InputRegister(0));
1236 break; 1265 break;
1237 case kS390_MaxDouble: 1266 case kS390_MaxDouble:
1238 ASSEMBLE_FLOAT_MAX(kScratchDoubleReg, kScratchReg); 1267 ASSEMBLE_FLOAT_MAX(kScratchDoubleReg, kScratchReg);
1239 break; 1268 break;
1240 case kS390_MinDouble: 1269 case kS390_MinDouble:
1241 ASSEMBLE_FLOAT_MIN(kScratchDoubleReg, kScratchReg); 1270 ASSEMBLE_FLOAT_MIN(kScratchDoubleReg, kScratchReg);
1242 break; 1271 break;
1243 case kS390_AbsDouble: 1272 case kS390_AbsDouble:
(...skipping 922 matching lines...) Expand 10 before | Expand all | Expand 10 after
2166 padding_size -= 2; 2195 padding_size -= 2;
2167 } 2196 }
2168 } 2197 }
2169 } 2198 }
2170 2199
2171 #undef __ 2200 #undef __
2172 2201
2173 } // namespace compiler 2202 } // namespace compiler
2174 } // namespace internal 2203 } // namespace internal
2175 } // namespace v8 2204 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/compiler/s390/instruction-codes-s390.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698