OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 2715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2726 if (instr->Bits(5, 4) == 0x1) { | 2726 if (instr->Bits(5, 4) == 0x1) { |
2727 if ((instr->Bit(22) == 0x0) && (instr->Bit(20) == 0x1)) { | 2727 if ((instr->Bit(22) == 0x0) && (instr->Bit(20) == 0x1)) { |
2728 // sdiv (in V8 notation matching ARM ISA format) rn = rm/rs | 2728 // sdiv (in V8 notation matching ARM ISA format) rn = rm/rs |
2729 // Format(instr, "'sdiv'cond'b 'rn, 'rm, 'rs); | 2729 // Format(instr, "'sdiv'cond'b 'rn, 'rm, 'rs); |
2730 int rm = instr->RmValue(); | 2730 int rm = instr->RmValue(); |
2731 int32_t rm_val = get_register(rm); | 2731 int32_t rm_val = get_register(rm); |
2732 int rs = instr->RsValue(); | 2732 int rs = instr->RsValue(); |
2733 int32_t rs_val = get_register(rs); | 2733 int32_t rs_val = get_register(rs); |
2734 int32_t ret_val = 0; | 2734 int32_t ret_val = 0; |
2735 ASSERT(rs_val != 0); | 2735 ASSERT(rs_val != 0); |
2736 ret_val = rm_val/rs_val; | 2736 if ((rm_val == kMinInt) && (rs_val == -1)) { |
| 2737 ret_val = kMinInt; |
| 2738 } else { |
| 2739 ret_val = rm_val / rs_val; |
| 2740 } |
2737 set_register(rn, ret_val); | 2741 set_register(rn, ret_val); |
2738 return; | 2742 return; |
2739 } | 2743 } |
2740 } | 2744 } |
2741 } | 2745 } |
2742 } | 2746 } |
2743 // Format(instr, "'memop'cond'b 'rd, ['rn, -'shift_rm]'w"); | 2747 // Format(instr, "'memop'cond'b 'rd, ['rn, -'shift_rm]'w"); |
2744 addr = rn_val - shifter_operand; | 2748 addr = rn_val - shifter_operand; |
2745 if (instr->HasW()) { | 2749 if (instr->HasW()) { |
2746 set_register(rn, addr); | 2750 set_register(rn, addr); |
(...skipping 1088 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3835 uintptr_t address = *stack_slot; | 3839 uintptr_t address = *stack_slot; |
3836 set_register(sp, current_sp + sizeof(uintptr_t)); | 3840 set_register(sp, current_sp + sizeof(uintptr_t)); |
3837 return address; | 3841 return address; |
3838 } | 3842 } |
3839 | 3843 |
3840 } } // namespace v8::internal | 3844 } } // namespace v8::internal |
3841 | 3845 |
3842 #endif // USE_SIMULATOR | 3846 #endif // USE_SIMULATOR |
3843 | 3847 |
3844 #endif // V8_TARGET_ARCH_ARM | 3848 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |