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 3021 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3032 if (TestConditionCode((Condition)2) || TestConditionCode((Condition)3)) { | 3032 if (TestConditionCode((Condition)2) || TestConditionCode((Condition)3)) { |
3033 alu_out = alu_out + 1; | 3033 alu_out = alu_out + 1; |
3034 isOF = isOF_original || CheckOverflowForUIntAdd(alu_out, 1); | 3034 isOF = isOF_original || CheckOverflowForUIntAdd(alu_out, 1); |
3035 } else { | 3035 } else { |
3036 isOF = isOF_original; | 3036 isOF = isOF_original; |
3037 } | 3037 } |
3038 set_low_register(r1, alu_out); | 3038 set_low_register(r1, alu_out); |
3039 SetS390ConditionCodeCarry<uint32_t>(alu_out, isOF); | 3039 SetS390ConditionCodeCarry<uint32_t>(alu_out, isOF); |
3040 break; | 3040 break; |
3041 } | 3041 } |
| 3042 case SLBR: { |
| 3043 RREInstruction* rrinst = reinterpret_cast<RREInstruction*>(instr); |
| 3044 int r1 = rrinst->R1Value(); |
| 3045 int r2 = rrinst->R2Value(); |
| 3046 uint32_t r1_val = get_low_register<uint32_t>(r1); |
| 3047 uint32_t r2_val = get_low_register<uint32_t>(r2); |
| 3048 uint32_t alu_out = 0; |
| 3049 bool isOF = false; |
| 3050 |
| 3051 alu_out = r1_val - r2_val; |
| 3052 bool isOF_original = CheckOverflowForUIntSub(r1_val, r2_val); |
| 3053 if (TestConditionCode((Condition)2) || TestConditionCode((Condition)3)) { |
| 3054 alu_out = alu_out - 1; |
| 3055 isOF = isOF_original || CheckOverflowForUIntSub(alu_out, 1); |
| 3056 } else { |
| 3057 isOF = isOF_original; |
| 3058 } |
| 3059 set_low_register(r1, alu_out); |
| 3060 SetS390ConditionCodeCarry<uint32_t>(alu_out, isOF); |
| 3061 break; |
| 3062 } |
3042 default: { return DecodeFourByteFloatingPoint(instr); } | 3063 default: { return DecodeFourByteFloatingPoint(instr); } |
3043 } | 3064 } |
3044 return true; | 3065 return true; |
3045 } | 3066 } |
3046 | 3067 |
3047 void Simulator::DecodeFourByteFloatingPointIntConversion(Instruction* instr) { | 3068 void Simulator::DecodeFourByteFloatingPointIntConversion(Instruction* instr) { |
3048 Opcode op = instr->S390OpcodeValue(); | 3069 Opcode op = instr->S390OpcodeValue(); |
3049 switch (op) { | 3070 switch (op) { |
3050 case CDLFBR: | 3071 case CDLFBR: |
3051 case CDLGBR: | 3072 case CDLGBR: |
(...skipping 2046 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5098 uintptr_t address = *stack_slot; | 5119 uintptr_t address = *stack_slot; |
5099 set_register(sp, current_sp + sizeof(uintptr_t)); | 5120 set_register(sp, current_sp + sizeof(uintptr_t)); |
5100 return address; | 5121 return address; |
5101 } | 5122 } |
5102 | 5123 |
5103 } // namespace internal | 5124 } // namespace internal |
5104 } // namespace v8 | 5125 } // namespace v8 |
5105 | 5126 |
5106 #endif // USE_SIMULATOR | 5127 #endif // USE_SIMULATOR |
5107 #endif // V8_TARGET_ARCH_S390 | 5128 #endif // V8_TARGET_ARCH_S390 |
OLD | NEW |