| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // | 2 // |
| 3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
| 4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
| 5 | 5 |
| 6 #include "src/crankshaft/s390/lithium-codegen-s390.h" | 6 #include "src/crankshaft/s390/lithium-codegen-s390.h" |
| 7 | 7 |
| 8 #include "src/base/bits.h" | 8 #include "src/base/bits.h" |
| 9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
| 10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
| (...skipping 1951 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1962 __ ldr(result_reg, left_reg); | 1962 __ ldr(result_reg, left_reg); |
| 1963 } | 1963 } |
| 1964 __ bind(&done); | 1964 __ bind(&done); |
| 1965 } | 1965 } |
| 1966 } | 1966 } |
| 1967 | 1967 |
| 1968 void LCodeGen::DoArithmeticD(LArithmeticD* instr) { | 1968 void LCodeGen::DoArithmeticD(LArithmeticD* instr) { |
| 1969 DoubleRegister left = ToDoubleRegister(instr->left()); | 1969 DoubleRegister left = ToDoubleRegister(instr->left()); |
| 1970 DoubleRegister right = ToDoubleRegister(instr->right()); | 1970 DoubleRegister right = ToDoubleRegister(instr->right()); |
| 1971 DoubleRegister result = ToDoubleRegister(instr->result()); | 1971 DoubleRegister result = ToDoubleRegister(instr->result()); |
| 1972 // All operations except MOD are computed in-place. | |
| 1973 DCHECK(instr->op() == Token::MOD || left.is(result)); | |
| 1974 switch (instr->op()) { | 1972 switch (instr->op()) { |
| 1975 case Token::ADD: | 1973 case Token::ADD: |
| 1976 __ adbr(result, right); | 1974 if (CpuFeatures::IsSupported(VECTOR_FACILITY)) { |
| 1975 __ vfa(result, left, right); |
| 1976 } else { |
| 1977 DCHECK(result.is(left)); |
| 1978 __ adbr(result, right); |
| 1979 } |
| 1977 break; | 1980 break; |
| 1978 case Token::SUB: | 1981 case Token::SUB: |
| 1979 __ sdbr(result, right); | 1982 if (CpuFeatures::IsSupported(VECTOR_FACILITY)) { |
| 1983 __ vfs(result, left, right); |
| 1984 } else { |
| 1985 DCHECK(result.is(left)); |
| 1986 __ sdbr(result, right); |
| 1987 } |
| 1980 break; | 1988 break; |
| 1981 case Token::MUL: | 1989 case Token::MUL: |
| 1982 __ mdbr(result, right); | 1990 if (CpuFeatures::IsSupported(VECTOR_FACILITY)) { |
| 1991 __ vfm(result, left, right); |
| 1992 } else { |
| 1993 DCHECK(result.is(left)); |
| 1994 __ mdbr(result, right); |
| 1995 } |
| 1983 break; | 1996 break; |
| 1984 case Token::DIV: | 1997 case Token::DIV: |
| 1985 __ ddbr(result, right); | 1998 if (CpuFeatures::IsSupported(VECTOR_FACILITY)) { |
| 1999 __ vfd(result, left, right); |
| 2000 } else { |
| 2001 DCHECK(result.is(left)); |
| 2002 __ ddbr(result, right); |
| 2003 } |
| 1986 break; | 2004 break; |
| 1987 case Token::MOD: { | 2005 case Token::MOD: { |
| 1988 __ PrepareCallCFunction(0, 2, scratch0()); | 2006 __ PrepareCallCFunction(0, 2, scratch0()); |
| 1989 __ MovToFloatParameters(left, right); | 2007 __ MovToFloatParameters(left, right); |
| 1990 __ CallCFunction(ExternalReference::mod_two_doubles_operation(isolate()), | 2008 __ CallCFunction(ExternalReference::mod_two_doubles_operation(isolate()), |
| 1991 0, 2); | 2009 0, 2); |
| 1992 // Move the result in the double result register. | 2010 // Move the result in the double result register. |
| 1993 __ MovFromFloatResult(result); | 2011 __ MovFromFloatResult(result); |
| 1994 break; | 2012 break; |
| 1995 } | 2013 } |
| (...skipping 3541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5537 __ LoadP(result, | 5555 __ LoadP(result, |
| 5538 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); | 5556 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); |
| 5539 __ bind(deferred->exit()); | 5557 __ bind(deferred->exit()); |
| 5540 __ bind(&done); | 5558 __ bind(&done); |
| 5541 } | 5559 } |
| 5542 | 5560 |
| 5543 #undef __ | 5561 #undef __ |
| 5544 | 5562 |
| 5545 } // namespace internal | 5563 } // namespace internal |
| 5546 } // namespace v8 | 5564 } // namespace v8 |
| OLD | NEW |