OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
730 | 730 |
731 | 731 |
732 void MacroAssembler::Fmov(FPRegister fd, Register rn) { | 732 void MacroAssembler::Fmov(FPRegister fd, Register rn) { |
733 ASSERT(allow_macro_instructions_); | 733 ASSERT(allow_macro_instructions_); |
734 fmov(fd, rn); | 734 fmov(fd, rn); |
735 } | 735 } |
736 | 736 |
737 | 737 |
738 void MacroAssembler::Fmov(FPRegister fd, double imm) { | 738 void MacroAssembler::Fmov(FPRegister fd, double imm) { |
739 ASSERT(allow_macro_instructions_); | 739 ASSERT(allow_macro_instructions_); |
740 if ((fd.Is64Bits() && IsImmFP64(imm)) || | 740 if (fd.Is32Bits()) { |
741 (fd.Is32Bits() && IsImmFP32(imm)) || | 741 Fmov(fd, static_cast<float>(imm)); |
742 ((imm == 0.0) && (copysign(1.0, imm) == 1.0))) { | 742 return; |
743 // These cases can be handled by the Assembler. | 743 } |
| 744 |
| 745 ASSERT(fd.Is64Bits()); |
| 746 if (IsImmFP64(imm)) { |
744 fmov(fd, imm); | 747 fmov(fd, imm); |
| 748 } else if ((imm == 0.0) && (copysign(1.0, imm) == 1.0)) { |
| 749 fmov(fd, xzr); |
745 } else { | 750 } else { |
746 UseScratchRegisterScope temps(this); | 751 UseScratchRegisterScope temps(this); |
747 // TODO(all): The Assembler would try to relocate the immediate with | 752 Register tmp = temps.AcquireX(); |
748 // Assembler::ldr(const FPRegister& ft, double imm) but it is not | 753 // TODO(all): Use Assembler::ldr(const FPRegister& ft, double imm). |
749 // implemented yet. | 754 Mov(tmp, double_to_rawbits(imm)); |
750 if (fd.SizeInBits() == kDRegSize) { | 755 Fmov(fd, tmp); |
751 Register tmp = temps.AcquireX(); | |
752 Mov(tmp, double_to_rawbits(imm)); | |
753 Fmov(fd, tmp); | |
754 } else { | |
755 ASSERT(fd.SizeInBits() == kSRegSize); | |
756 Register tmp = temps.AcquireW(); | |
757 Mov(tmp, float_to_rawbits(static_cast<float>(imm))); | |
758 Fmov(fd, tmp); | |
759 } | |
760 } | 756 } |
761 } | 757 } |
762 | 758 |
| 759 |
| 760 void MacroAssembler::Fmov(FPRegister fd, float imm) { |
| 761 ASSERT(allow_macro_instructions_); |
| 762 if (fd.Is64Bits()) { |
| 763 Fmov(fd, static_cast<double>(imm)); |
| 764 return; |
| 765 } |
| 766 |
| 767 ASSERT(fd.Is32Bits()); |
| 768 if (IsImmFP32(imm)) { |
| 769 fmov(fd, imm); |
| 770 } else if ((imm == 0.0) && (copysign(1.0, imm) == 1.0)) { |
| 771 fmov(fd, wzr); |
| 772 } else { |
| 773 UseScratchRegisterScope temps(this); |
| 774 Register tmp = temps.AcquireW(); |
| 775 // TODO(all): Use Assembler::ldr(const FPRegister& ft, float imm). |
| 776 Mov(tmp, float_to_rawbits(imm)); |
| 777 Fmov(fd, tmp); |
| 778 } |
| 779 } |
| 780 |
763 | 781 |
764 void MacroAssembler::Fmov(Register rd, FPRegister fn) { | 782 void MacroAssembler::Fmov(Register rd, FPRegister fn) { |
765 ASSERT(allow_macro_instructions_); | 783 ASSERT(allow_macro_instructions_); |
766 ASSERT(!rd.IsZero()); | 784 ASSERT(!rd.IsZero()); |
767 fmov(rd, fn); | 785 fmov(rd, fn); |
768 } | 786 } |
769 | 787 |
770 | 788 |
771 void MacroAssembler::Fmsub(const FPRegister& fd, | 789 void MacroAssembler::Fmsub(const FPRegister& fd, |
772 const FPRegister& fn, | 790 const FPRegister& fn, |
(...skipping 876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1649 // characters are reserved for controlling features of the instrumentation. | 1667 // characters are reserved for controlling features of the instrumentation. |
1650 ASSERT(isprint(marker_name[0]) && isprint(marker_name[1])); | 1668 ASSERT(isprint(marker_name[0]) && isprint(marker_name[1])); |
1651 | 1669 |
1652 InstructionAccurateScope scope(this, 1); | 1670 InstructionAccurateScope scope(this, 1); |
1653 movn(xzr, (marker_name[1] << 8) | marker_name[0]); | 1671 movn(xzr, (marker_name[1] << 8) | marker_name[0]); |
1654 } | 1672 } |
1655 | 1673 |
1656 } } // namespace v8::internal | 1674 } } // namespace v8::internal |
1657 | 1675 |
1658 #endif // V8_A64_MACRO_ASSEMBLER_A64_INL_H_ | 1676 #endif // V8_A64_MACRO_ASSEMBLER_A64_INL_H_ |
OLD | NEW |