OLD | NEW |
1 // Copyright (c) 1994-2006 Sun Microsystems Inc. | 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. |
2 // All Rights Reserved. | 2 // All Rights Reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions | 5 // modification, are permitted provided that the following conditions |
6 // are met: | 6 // are met: |
7 // | 7 // |
8 // - Redistributions of source code must retain the above copyright notice, | 8 // - Redistributions of source code must retain the above copyright notice, |
9 // this list of conditions and the following disclaimer. | 9 // this list of conditions and the following disclaimer. |
10 // | 10 // |
(...skipping 3887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3898 // 000(18-16) | Vd(15-12) | 101000(11-6) | M(5) | 1(4) | Vm(3-0) | 3898 // 000(18-16) | Vd(15-12) | 101000(11-6) | M(5) | 1(4) | Vm(3-0) |
3899 DCHECK(CpuFeatures::IsSupported(NEON)); | 3899 DCHECK(CpuFeatures::IsSupported(NEON)); |
3900 int vd, d; | 3900 int vd, d; |
3901 dst.split_code(&vd, &d); | 3901 dst.split_code(&vd, &d); |
3902 int vm, m; | 3902 int vm, m; |
3903 src.split_code(&vm, &m); | 3903 src.split_code(&vm, &m); |
3904 emit(0xFU*B28 | B25 | (dt & NeonDataTypeUMask) | B23 | d*B22 | | 3904 emit(0xFU*B28 | B25 | (dt & NeonDataTypeUMask) | B23 | d*B22 | |
3905 (dt & NeonDataTypeSizeMask)*B19 | vd*B12 | 0xA*B8 | m*B5 | B4 | vm); | 3905 (dt & NeonDataTypeSizeMask)*B19 | vd*B12 | 0xA*B8 | m*B5 | B4 | vm); |
3906 } | 3906 } |
3907 | 3907 |
| 3908 void Assembler::vswp(DwVfpRegister srcdst0, DwVfpRegister srcdst1) { |
| 3909 DCHECK(!srcdst0.is(kScratchDoubleReg)); |
| 3910 DCHECK(!srcdst1.is(kScratchDoubleReg)); |
| 3911 |
| 3912 if (srcdst0.is(srcdst1)) return; // Swapping aliased registers emits nothing. |
| 3913 |
| 3914 if (CpuFeatures::IsSupported(NEON)) { |
| 3915 // Instruction details available in ARM DDI 0406C.b, A8.8.418. |
| 3916 // 1111(31-28) | 00111(27-23) | D(22) | 110010(21-16) | |
| 3917 // Vd(15-12) | 000000(11-6) | M(5) | 0(4) | Vm(3-0) |
| 3918 int vd, d; |
| 3919 srcdst0.split_code(&vd, &d); |
| 3920 int vm, m; |
| 3921 srcdst1.split_code(&vm, &m); |
| 3922 emit(0xFU * B28 | 7 * B23 | d * B22 | 0x32 * B16 | vd * B12 | m * B5 | vm); |
| 3923 } else { |
| 3924 vmov(kScratchDoubleReg, srcdst0); |
| 3925 vmov(srcdst0, srcdst1); |
| 3926 vmov(srcdst1, kScratchDoubleReg); |
| 3927 } |
| 3928 } |
3908 | 3929 |
3909 // Pseudo instructions. | 3930 // Pseudo instructions. |
3910 void Assembler::nop(int type) { | 3931 void Assembler::nop(int type) { |
3911 // ARMv6{K/T2} and v7 have an actual NOP instruction but it serializes | 3932 // ARMv6{K/T2} and v7 have an actual NOP instruction but it serializes |
3912 // some of the CPU's pipeline and has to issue. Older ARM chips simply used | 3933 // some of the CPU's pipeline and has to issue. Older ARM chips simply used |
3913 // MOV Rx, Rx as NOP and it performs better even in newer CPUs. | 3934 // MOV Rx, Rx as NOP and it performs better even in newer CPUs. |
3914 // We therefore use MOV Rx, Rx, even on newer CPUs, and use Rx to encode | 3935 // We therefore use MOV Rx, Rx, even on newer CPUs, and use Rx to encode |
3915 // a type. | 3936 // a type. |
3916 DCHECK(0 <= type && type <= 14); // mov pc, pc isn't a nop. | 3937 DCHECK(0 <= type && type <= 14); // mov pc, pc isn't a nop. |
3917 emit(al | 13*B21 | type*B12 | type); | 3938 emit(al | 13*B21 | type*B12 | type); |
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4451 DCHECK(is_uint12(offset)); | 4472 DCHECK(is_uint12(offset)); |
4452 instr_at_put(pc, SetLdrRegisterImmediateOffset(instr, offset)); | 4473 instr_at_put(pc, SetLdrRegisterImmediateOffset(instr, offset)); |
4453 } | 4474 } |
4454 } | 4475 } |
4455 | 4476 |
4456 | 4477 |
4457 } // namespace internal | 4478 } // namespace internal |
4458 } // namespace v8 | 4479 } // namespace v8 |
4459 | 4480 |
4460 #endif // V8_TARGET_ARCH_ARM | 4481 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |