OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 <stdarg.h> | 5 #include <stdarg.h> |
6 #include <stdlib.h> | 6 #include <stdlib.h> |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #if V8_TARGET_ARCH_S390 | 9 #if V8_TARGET_ARCH_S390 |
10 | 10 |
(...skipping 6548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6559 return 0; | 6559 return 0; |
6560 } | 6560 } |
6561 | 6561 |
6562 EVALUATE(CLCL) { | 6562 EVALUATE(CLCL) { |
6563 UNIMPLEMENTED(); | 6563 UNIMPLEMENTED(); |
6564 USE(instr); | 6564 USE(instr); |
6565 return 0; | 6565 return 0; |
6566 } | 6566 } |
6567 | 6567 |
6568 EVALUATE(LPR) { | 6568 EVALUATE(LPR) { |
6569 UNIMPLEMENTED(); | 6569 DCHECK_OPCODE(LPR); |
6570 USE(instr); | 6570 // Load Positive (32) |
6571 return 0; | 6571 DECODE_RR_INSTRUCTION(r1, r2); |
| 6572 int32_t r2_val = get_low_register<int32_t>(r2); |
| 6573 // If negative, then negate it. |
| 6574 r2_val = (r2_val < 0) ? -r2_val : r2_val; |
| 6575 set_low_register(r1, r2_val); |
| 6576 SetS390ConditionCode<int32_t>(r2_val, 0); |
| 6577 if (r2_val == (static_cast<int32_t>(1) << 31)) { |
| 6578 SetS390OverflowCode(true); |
| 6579 } |
| 6580 return length; |
6572 } | 6581 } |
6573 | 6582 |
6574 EVALUATE(LNR) { | 6583 EVALUATE(LNR) { |
6575 DCHECK_OPCODE(LNR); | 6584 DCHECK_OPCODE(LNR); |
6576 // Load Negative (32) | 6585 // Load Negative (32) |
6577 DECODE_RR_INSTRUCTION(r1, r2); | 6586 DECODE_RR_INSTRUCTION(r1, r2); |
6578 int32_t r2_val = get_low_register<int32_t>(r2); | 6587 int32_t r2_val = get_low_register<int32_t>(r2); |
6579 r2_val = (r2_val >= 0) ? -r2_val : r2_val; // If pos, then negate it. | 6588 r2_val = (r2_val >= 0) ? -r2_val : r2_val; // If pos, then negate it. |
6580 set_low_register(r1, r2_val); | 6589 set_low_register(r1, r2_val); |
6581 condition_reg_ = (r2_val == 0) ? CC_EQ : CC_LT; // CC0 - result is zero | 6590 condition_reg_ = (r2_val == 0) ? CC_EQ : CC_LT; // CC0 - result is zero |
(...skipping 3303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9885 return 0; | 9894 return 0; |
9886 } | 9895 } |
9887 | 9896 |
9888 EVALUATE(RRXTR) { | 9897 EVALUATE(RRXTR) { |
9889 UNIMPLEMENTED(); | 9898 UNIMPLEMENTED(); |
9890 USE(instr); | 9899 USE(instr); |
9891 return 0; | 9900 return 0; |
9892 } | 9901 } |
9893 | 9902 |
9894 EVALUATE(LPGR) { | 9903 EVALUATE(LPGR) { |
9895 UNIMPLEMENTED(); | 9904 DCHECK_OPCODE(LPGR); |
9896 USE(instr); | 9905 // Load Positive (32) |
9897 return 0; | 9906 DECODE_RRE_INSTRUCTION(r1, r2); |
| 9907 int64_t r2_val = get_register(r2); |
| 9908 r2_val = (r2_val < 0) ? -r2_val : r2_val; // If negative, then negate it. |
| 9909 set_register(r1, r2_val); |
| 9910 SetS390ConditionCode<int64_t>(r2_val, 0); |
| 9911 if (r2_val == (static_cast<int64_t>(1) << 63)) { |
| 9912 SetS390OverflowCode(true); |
| 9913 } |
| 9914 return length; |
9898 } | 9915 } |
9899 | 9916 |
9900 EVALUATE(LNGR) { | 9917 EVALUATE(LNGR) { |
9901 DCHECK_OPCODE(LNGR); | 9918 DCHECK_OPCODE(LNGR); |
9902 // Load Negative (64) | 9919 // Load Negative (64) |
9903 DECODE_RRE_INSTRUCTION(r1, r2); | 9920 DECODE_RRE_INSTRUCTION(r1, r2); |
9904 int64_t r2_val = get_register(r2); | 9921 int64_t r2_val = get_register(r2); |
9905 r2_val = (r2_val >= 0) ? -r2_val : r2_val; // If pos, then negate it. | 9922 r2_val = (r2_val >= 0) ? -r2_val : r2_val; // If pos, then negate it. |
9906 set_register(r1, r2_val); | 9923 set_register(r1, r2_val); |
9907 condition_reg_ = (r2_val == 0) ? CC_EQ : CC_LT; // CC0 - result is zero | 9924 condition_reg_ = (r2_val == 0) ? CC_EQ : CC_LT; // CC0 - result is zero |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9986 DCHECK_OPCODE(LRVGR); | 10003 DCHECK_OPCODE(LRVGR); |
9987 DECODE_RRE_INSTRUCTION(r1, r2); | 10004 DECODE_RRE_INSTRUCTION(r1, r2); |
9988 int64_t r2_val = get_register(r2); | 10005 int64_t r2_val = get_register(r2); |
9989 int64_t r1_val = ByteReverse(r2_val); | 10006 int64_t r1_val = ByteReverse(r2_val); |
9990 | 10007 |
9991 set_register(r1, r1_val); | 10008 set_register(r1, r1_val); |
9992 return length; | 10009 return length; |
9993 } | 10010 } |
9994 | 10011 |
9995 EVALUATE(LPGFR) { | 10012 EVALUATE(LPGFR) { |
9996 UNIMPLEMENTED(); | 10013 DCHECK_OPCODE(LPGFR); |
9997 USE(instr); | 10014 // Load Positive (32) |
9998 return 0; | 10015 DECODE_RRE_INSTRUCTION(r1, r2); |
| 10016 int32_t r2_val = get_low_register<int32_t>(r2); |
| 10017 // If negative, then negate it. |
| 10018 int64_t r1_val = static_cast<int64_t>((r2_val < 0) ? -r2_val : r2_val); |
| 10019 set_register(r1, r1_val); |
| 10020 SetS390ConditionCode<int64_t>(r1_val, 0); |
| 10021 return length; |
9999 } | 10022 } |
10000 | 10023 |
10001 EVALUATE(LNGFR) { | 10024 EVALUATE(LNGFR) { |
10002 UNIMPLEMENTED(); | 10025 UNIMPLEMENTED(); |
10003 USE(instr); | 10026 USE(instr); |
10004 return 0; | 10027 return 0; |
10005 } | 10028 } |
10006 | 10029 |
10007 EVALUATE(LTGFR) { | 10030 EVALUATE(LTGFR) { |
10008 DCHECK_OPCODE(LTGFR); | 10031 DCHECK_OPCODE(LTGFR); |
(...skipping 2720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12729 return 0; | 12752 return 0; |
12730 } | 12753 } |
12731 | 12754 |
12732 #undef EVALUATE | 12755 #undef EVALUATE |
12733 | 12756 |
12734 } // namespace internal | 12757 } // namespace internal |
12735 } // namespace v8 | 12758 } // namespace v8 |
12736 | 12759 |
12737 #endif // USE_SIMULATOR | 12760 #endif // USE_SIMULATOR |
12738 #endif // V8_TARGET_ARCH_S390 | 12761 #endif // V8_TARGET_ARCH_S390 |
OLD | NEW |