Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Side by Side Diff: src/arm/assembler-arm.cc

Issue 2523933002: [Turbofan] Add ARM support for simd128 moves and swaps. (Closed)
Patch Set: Rebase. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/arm/assembler-arm.h ('k') | src/arm/constants-arm.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2855 matching lines...) Expand 10 before | Expand all | Expand 10 after
2866 DCHECK(VfpRegisterIsAvailable(dst)); 2866 DCHECK(VfpRegisterIsAvailable(dst));
2867 DCHECK(VfpRegisterIsAvailable(src)); 2867 DCHECK(VfpRegisterIsAvailable(src));
2868 int vd, d; 2868 int vd, d;
2869 dst.split_code(&vd, &d); 2869 dst.split_code(&vd, &d);
2870 int vm, m; 2870 int vm, m;
2871 src.split_code(&vm, &m); 2871 src.split_code(&vm, &m);
2872 emit(cond | 0x1D*B23 | d*B22 | 0x3*B20 | vd*B12 | 0x5*B9 | B8 | B6 | m*B5 | 2872 emit(cond | 0x1D*B23 | d*B22 | 0x3*B20 | vd*B12 | 0x5*B9 | B8 | B6 | m*B5 |
2873 vm); 2873 vm);
2874 } 2874 }
2875 2875
2876
2877 void Assembler::vmov(const DwVfpRegister dst, 2876 void Assembler::vmov(const DwVfpRegister dst,
2878 const VmovIndex index, 2877 const VmovIndex index,
2879 const Register src, 2878 const Register src,
2880 const Condition cond) { 2879 const Condition cond) {
2881 // Dd[index] = Rt 2880 // Dd[index] = Rt
2882 // Instruction details available in ARM DDI 0406C.b, A8-940. 2881 // Instruction details available in ARM DDI 0406C.b, A8-940.
2883 // cond(31-28) | 1110(27-24) | 0(23) | opc1=0index(22-21) | 0(20) | 2882 // cond(31-28) | 1110(27-24) | 0(23) | opc1=0index(22-21) | 0(20) |
2884 // Vd(19-16) | Rt(15-12) | 1011(11-8) | D(7) | opc2=00(6-5) | 1(4) | 0000(3-0) 2883 // Vd(19-16) | Rt(15-12) | 1011(11-8) | D(7) | opc2=00(6-5) | 1(4) | 0000(3-0)
2885 DCHECK(VfpRegisterIsAvailable(dst)); 2884 DCHECK(VfpRegisterIsAvailable(dst));
2886 DCHECK(index.index == 0 || index.index == 1); 2885 DCHECK(index.index == 0 || index.index == 1);
(...skipping 1009 matching lines...) Expand 10 before | Expand all | Expand 10 after
3896 // 000(18-16) | Vd(15-12) | 101000(11-6) | M(5) | 1(4) | Vm(3-0) 3895 // 000(18-16) | Vd(15-12) | 101000(11-6) | M(5) | 1(4) | Vm(3-0)
3897 DCHECK(IsEnabled(NEON)); 3896 DCHECK(IsEnabled(NEON));
3898 int vd, d; 3897 int vd, d;
3899 dst.split_code(&vd, &d); 3898 dst.split_code(&vd, &d);
3900 int vm, m; 3899 int vm, m;
3901 src.split_code(&vm, &m); 3900 src.split_code(&vm, &m);
3902 emit(0xFU*B28 | B25 | (dt & NeonDataTypeUMask) | B23 | d*B22 | 3901 emit(0xFU*B28 | B25 | (dt & NeonDataTypeUMask) | B23 | d*B22 |
3903 (dt & NeonDataTypeSizeMask)*B19 | vd*B12 | 0xA*B8 | m*B5 | B4 | vm); 3902 (dt & NeonDataTypeSizeMask)*B19 | vd*B12 | 0xA*B8 | m*B5 | B4 | vm);
3904 } 3903 }
3905 3904
3906 void Assembler::vswp(DwVfpRegister srcdst0, DwVfpRegister srcdst1) { 3905 void Assembler::vmov(const QwNeonRegister dst, const QwNeonRegister src) {
3907 DCHECK(VfpRegisterIsAvailable(srcdst0)); 3906 DCHECK(IsEnabled(NEON));
3908 DCHECK(VfpRegisterIsAvailable(srcdst1)); 3907 // Instruction details available in ARM DDI 0406C.b, A8-938.
3909 DCHECK(!srcdst0.is(kScratchDoubleReg)); 3908 DCHECK(VfpRegisterIsAvailable(dst));
3910 DCHECK(!srcdst1.is(kScratchDoubleReg)); 3909 DCHECK(VfpRegisterIsAvailable(src));
3910 int vd, d;
3911 dst.split_code(&vd, &d);
3912 int vm, m;
3913 src.split_code(&vm, &m);
3914 emit(0x1E4 * B23 | d * B22 | 2 * B20 | vm * B16 | vd * B12 | B8 | m * B7 |
3915 B6 | m * B5 | B4 | vm);
3916 }
3911 3917
3912 if (srcdst0.is(srcdst1)) return; // Swapping aliased registers emits nothing. 3918 void Assembler::vswp(DwVfpRegister dst, DwVfpRegister src) {
3919 // Instruction details available in ARM DDI 0406C.b, A8.8.418.
3920 // 1111(31-28) | 00111(27-23) | D(22) | 110010(21-16) |
3921 // Vd(15-12) | 000000(11-6) | M(5) | 0(4) | Vm(3-0)
3922 DCHECK(IsEnabled(NEON));
3923 int vd, d;
3924 dst.split_code(&vd, &d);
3925 int vm, m;
3926 src.split_code(&vm, &m);
3927 emit(0xFU * B28 | 7 * B23 | d * B22 | 0x32 * B16 | vd * B12 | m * B5 | vm);
3928 }
3913 3929
3914 if (CpuFeatures::IsSupported(NEON)) { 3930 void Assembler::vswp(QwNeonRegister dst, QwNeonRegister src) {
3915 // Instruction details available in ARM DDI 0406C.b, A8.8.418. 3931 // Instruction details available in ARM DDI 0406C.b, A8.8.418.
3916 // 1111(31-28) | 00111(27-23) | D(22) | 110010(21-16) | 3932 // 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) 3933 // Vd(15-12) | 000000(11-6) | M(5) | 0(4) | Vm(3-0)
3918 int vd, d; 3934 DCHECK(IsEnabled(NEON));
3919 srcdst0.split_code(&vd, &d); 3935 int vd, d;
3920 int vm, m; 3936 dst.split_code(&vd, &d);
3921 srcdst1.split_code(&vm, &m); 3937 int vm, m;
3922 emit(0xFU * B28 | 7 * B23 | d * B22 | 0x32 * B16 | vd * B12 | m * B5 | vm); 3938 src.split_code(&vm, &m);
3923 } else { 3939 emit(0xFU * B28 | 7 * B23 | d * B22 | 0x32 * B16 | vd * B12 | B6 | m * B5 |
3924 vmov(kScratchDoubleReg, srcdst0); 3940 vm);
3925 vmov(srcdst0, srcdst1); 3941 }
3926 vmov(srcdst1, kScratchDoubleReg); 3942
3927 } 3943 void Assembler::veor(DwVfpRegister dst, DwVfpRegister src1,
3944 DwVfpRegister src2) {
3945 // Instruction details available in ARM DDI 0406C.b, A8.8.888.
3946 DCHECK(IsEnabled(NEON));
3947 int vd, d;
3948 dst.split_code(&vd, &d);
3949 int vn, n;
3950 src1.split_code(&vn, &n);
3951 int vm, m;
3952 src2.split_code(&vm, &m);
3953 emit(0x1E6 * B23 | d * B22 | vn * B16 | vd * B12 | B8 | n * B7 | m * B5 | B4 |
3954 vm);
3955 }
3956
3957 void Assembler::veor(QwNeonRegister dst, QwNeonRegister src1,
3958 QwNeonRegister src2) {
3959 // Instruction details available in ARM DDI 0406C.b, A8.8.888.
3960 DCHECK(IsEnabled(NEON));
3961 int vd, d;
3962 dst.split_code(&vd, &d);
3963 int vn, n;
3964 src1.split_code(&vn, &n);
3965 int vm, m;
3966 src2.split_code(&vm, &m);
3967 emit(0x1E6 * B23 | d * B22 | vn * B16 | vd * B12 | B8 | n * B7 | B6 | m * B5 |
3968 B4 | vm);
3928 } 3969 }
3929 3970
3930 // Pseudo instructions. 3971 // Pseudo instructions.
3931 void Assembler::nop(int type) { 3972 void Assembler::nop(int type) {
3932 // ARMv6{K/T2} and v7 have an actual NOP instruction but it serializes 3973 // ARMv6{K/T2} and v7 have an actual NOP instruction but it serializes
3933 // some of the CPU's pipeline and has to issue. Older ARM chips simply used 3974 // some of the CPU's pipeline and has to issue. Older ARM chips simply used
3934 // MOV Rx, Rx as NOP and it performs better even in newer CPUs. 3975 // MOV Rx, Rx as NOP and it performs better even in newer CPUs.
3935 // We therefore use MOV Rx, Rx, even on newer CPUs, and use Rx to encode 3976 // We therefore use MOV Rx, Rx, even on newer CPUs, and use Rx to encode
3936 // a type. 3977 // a type.
3937 DCHECK(0 <= type && type <= 14); // mov pc, pc isn't a nop. 3978 DCHECK(0 <= type && type <= 14); // mov pc, pc isn't a nop.
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after
4473 DCHECK(is_uint12(offset)); 4514 DCHECK(is_uint12(offset));
4474 instr_at_put(pc, SetLdrRegisterImmediateOffset(instr, offset)); 4515 instr_at_put(pc, SetLdrRegisterImmediateOffset(instr, offset));
4475 } 4516 }
4476 } 4517 }
4477 4518
4478 4519
4479 } // namespace internal 4520 } // namespace internal
4480 } // namespace v8 4521 } // namespace v8
4481 4522
4482 #endif // V8_TARGET_ARCH_ARM 4523 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/assembler-arm.h ('k') | src/arm/constants-arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698