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 771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
782 const double src2, | 782 const double src2, |
783 const Register fpscr_flags, | 783 const Register fpscr_flags, |
784 const Condition cond) { | 784 const Condition cond) { |
785 // Compare and load FPSCR. | 785 // Compare and load FPSCR. |
786 vcmp(src1, src2, cond); | 786 vcmp(src1, src2, cond); |
787 vmrs(fpscr_flags, cond); | 787 vmrs(fpscr_flags, cond); |
788 } | 788 } |
789 | 789 |
790 void MacroAssembler::Vmov(const DwVfpRegister dst, | 790 void MacroAssembler::Vmov(const DwVfpRegister dst, |
791 const double imm, | 791 const double imm, |
792 const Register scratch, | |
793 const Condition cond) { | 792 const Condition cond) { |
794 ASSERT(CpuFeatures::IsEnabled(VFP2)); | 793 ASSERT(CpuFeatures::IsEnabled(VFP2)); |
795 static const DoubleRepresentation minus_zero(-0.0); | 794 static const DoubleRepresentation minus_zero(-0.0); |
796 static const DoubleRepresentation zero(0.0); | 795 static const DoubleRepresentation zero(0.0); |
797 DoubleRepresentation value(imm); | 796 DoubleRepresentation value(imm); |
798 // Handle special values first. | 797 // Handle special values first. |
799 if (value.bits == zero.bits) { | 798 if (value.bits == zero.bits) { |
800 vmov(dst, kDoubleRegZero, cond); | 799 vmov(dst, kDoubleRegZero, cond); |
801 } else if (value.bits == minus_zero.bits) { | 800 } else if (value.bits == minus_zero.bits) { |
802 vneg(dst, kDoubleRegZero, cond); | 801 vneg(dst, kDoubleRegZero, cond); |
803 } else { | 802 } else { |
804 vmov(dst, imm, scratch, cond); | 803 vmov(dst, imm, cond); |
805 } | 804 } |
806 } | 805 } |
807 | 806 |
808 | 807 |
809 void MacroAssembler::EnterFrame(StackFrame::Type type) { | 808 void MacroAssembler::EnterFrame(StackFrame::Type type) { |
810 // r0-r3: preserved | 809 // r0-r3: preserved |
811 stm(db_w, sp, cp.bit() | fp.bit() | lr.bit()); | 810 stm(db_w, sp, cp.bit() | fp.bit() | lr.bit()); |
812 mov(ip, Operand(Smi::FromInt(type))); | 811 mov(ip, Operand(Smi::FromInt(type))); |
813 push(ip); | 812 push(ip); |
814 mov(ip, Operand(CodeObject())); | 813 mov(ip, Operand(CodeObject())); |
(...skipping 1166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1981 Operand(key_reg, LSL, kDoubleSizeLog2 - kSmiTagSize)); | 1980 Operand(key_reg, LSL, kDoubleSizeLog2 - kSmiTagSize)); |
1982 // scratch1 is now effective address of the double element | 1981 // scratch1 is now effective address of the double element |
1983 | 1982 |
1984 FloatingPointHelper::Destination destination; | 1983 FloatingPointHelper::Destination destination; |
1985 if (CpuFeatures::IsSupported(VFP2)) { | 1984 if (CpuFeatures::IsSupported(VFP2)) { |
1986 destination = FloatingPointHelper::kVFPRegisters; | 1985 destination = FloatingPointHelper::kVFPRegisters; |
1987 } else { | 1986 } else { |
1988 destination = FloatingPointHelper::kCoreRegisters; | 1987 destination = FloatingPointHelper::kCoreRegisters; |
1989 } | 1988 } |
1990 | 1989 |
1991 Register untagged_value = elements_reg; | 1990 Register untagged_value = receiver_reg; |
1992 SmiUntag(untagged_value, value_reg); | 1991 SmiUntag(untagged_value, value_reg); |
1993 FloatingPointHelper::ConvertIntToDouble(this, | 1992 FloatingPointHelper::ConvertIntToDouble(this, |
1994 untagged_value, | 1993 untagged_value, |
1995 destination, | 1994 destination, |
1996 d0, | 1995 d0, |
1997 mantissa_reg, | 1996 mantissa_reg, |
1998 exponent_reg, | 1997 exponent_reg, |
1999 scratch4, | 1998 scratch4, |
2000 s2); | 1999 s2); |
2001 if (destination == FloatingPointHelper::kVFPRegisters) { | 2000 if (destination == FloatingPointHelper::kVFPRegisters) { |
(...skipping 1668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3670 Vmov(temp_double_reg, 0.0); | 3669 Vmov(temp_double_reg, 0.0); |
3671 VFPCompareAndSetFlags(input_reg, temp_double_reg); | 3670 VFPCompareAndSetFlags(input_reg, temp_double_reg); |
3672 b(gt, &above_zero); | 3671 b(gt, &above_zero); |
3673 | 3672 |
3674 // Double value is less than zero, NaN or Inf, return 0. | 3673 // Double value is less than zero, NaN or Inf, return 0. |
3675 mov(result_reg, Operand(0)); | 3674 mov(result_reg, Operand(0)); |
3676 b(al, &done); | 3675 b(al, &done); |
3677 | 3676 |
3678 // Double value is >= 255, return 255. | 3677 // Double value is >= 255, return 255. |
3679 bind(&above_zero); | 3678 bind(&above_zero); |
3680 Vmov(temp_double_reg, 255.0, result_reg); | 3679 Vmov(temp_double_reg, 255.0); |
3681 VFPCompareAndSetFlags(input_reg, temp_double_reg); | 3680 VFPCompareAndSetFlags(input_reg, temp_double_reg); |
3682 b(le, &in_bounds); | 3681 b(le, &in_bounds); |
3683 mov(result_reg, Operand(255)); | 3682 mov(result_reg, Operand(255)); |
3684 b(al, &done); | 3683 b(al, &done); |
3685 | 3684 |
3686 // In 0-255 range, round and truncate. | 3685 // In 0-255 range, round and truncate. |
3687 bind(&in_bounds); | 3686 bind(&in_bounds); |
3688 // Save FPSCR. | 3687 // Save FPSCR. |
3689 vmrs(ip); | 3688 vmrs(ip); |
3690 // Set rounding mode to round to the nearest integer by clearing bits[23:22]. | 3689 // Set rounding mode to round to the nearest integer by clearing bits[23:22]. |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3723 bind(&load_from_back_pointer); | 3722 bind(&load_from_back_pointer); |
3724 ldr(temp, FieldMemOperand(temp, Map::kTransitionsOrBackPointerOffset)); | 3723 ldr(temp, FieldMemOperand(temp, Map::kTransitionsOrBackPointerOffset)); |
3725 ldr(temp, FieldMemOperand(temp, TransitionArray::kDescriptorsPointerOffset)); | 3724 ldr(temp, FieldMemOperand(temp, TransitionArray::kDescriptorsPointerOffset)); |
3726 ldr(descriptors, FieldMemOperand(temp, JSGlobalPropertyCell::kValueOffset)); | 3725 ldr(descriptors, FieldMemOperand(temp, JSGlobalPropertyCell::kValueOffset)); |
3727 | 3726 |
3728 bind(&ok); | 3727 bind(&ok); |
3729 } | 3728 } |
3730 | 3729 |
3731 | 3730 |
3732 void MacroAssembler::NumberOfOwnDescriptors(Register dst, Register map) { | 3731 void MacroAssembler::NumberOfOwnDescriptors(Register dst, Register map) { |
3733 ldr(dst, FieldMemOperand(map, Map::kBitField3Offset)); | 3732 ldr(dst, FieldMemOperand(map, Map::kBitFieldOffset)); |
3734 DecodeField<Map::NumberOfOwnDescriptorsBits>(dst); | 3733 DecodeField<Map::NumberOfOwnDescriptorsBits>(dst); |
3735 } | 3734 } |
3736 | 3735 |
3737 | 3736 |
3738 void MacroAssembler::EnumLength(Register dst, Register map) { | 3737 void MacroAssembler::EnumLength(Register dst, Register map) { |
3739 STATIC_ASSERT(Map::EnumLengthBits::kShift == 0); | 3738 STATIC_ASSERT(Map::EnumLengthBits::kShift == 0); |
3740 ldr(dst, FieldMemOperand(map, Map::kBitField3Offset)); | 3739 ldr(dst, FieldMemOperand(map, Map::kBitField3Offset)); |
3741 and_(dst, dst, Operand(Smi::FromInt(Map::EnumLengthBits::kMask))); | 3740 and_(dst, dst, Operand(Smi::FromInt(Map::EnumLengthBits::kMask))); |
3742 } | 3741 } |
3743 | 3742 |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3839 void CodePatcher::EmitCondition(Condition cond) { | 3838 void CodePatcher::EmitCondition(Condition cond) { |
3840 Instr instr = Assembler::instr_at(masm_.pc_); | 3839 Instr instr = Assembler::instr_at(masm_.pc_); |
3841 instr = (instr & ~kCondMask) | cond; | 3840 instr = (instr & ~kCondMask) | cond; |
3842 masm_.emit(instr); | 3841 masm_.emit(instr); |
3843 } | 3842 } |
3844 | 3843 |
3845 | 3844 |
3846 } } // namespace v8::internal | 3845 } } // namespace v8::internal |
3847 | 3846 |
3848 #endif // V8_TARGET_ARCH_ARM | 3847 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |