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

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

Issue 2559933002: assembler-arm: Use unsigned ints to avoid integer overflow. (Closed)
Patch Set: Formatting. 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 | « no previous file | no next file » | 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 3893 matching lines...) Expand 10 before | Expand all | Expand 10 after
3904 3904
3905 void Assembler::vmov(const QwNeonRegister dst, const QwNeonRegister src) { 3905 void Assembler::vmov(const QwNeonRegister dst, const QwNeonRegister src) {
3906 DCHECK(IsEnabled(NEON)); 3906 DCHECK(IsEnabled(NEON));
3907 // Instruction details available in ARM DDI 0406C.b, A8-938. 3907 // Instruction details available in ARM DDI 0406C.b, A8-938.
3908 DCHECK(VfpRegisterIsAvailable(dst)); 3908 DCHECK(VfpRegisterIsAvailable(dst));
3909 DCHECK(VfpRegisterIsAvailable(src)); 3909 DCHECK(VfpRegisterIsAvailable(src));
3910 int vd, d; 3910 int vd, d;
3911 dst.split_code(&vd, &d); 3911 dst.split_code(&vd, &d);
3912 int vm, m; 3912 int vm, m;
3913 src.split_code(&vm, &m); 3913 src.split_code(&vm, &m);
3914 emit(0x1E4 * B23 | d * B22 | 2 * B20 | vm * B16 | vd * B12 | B8 | m * B7 | 3914 emit(0x1E4U * B23 | d * B22 | 2 * B20 | vm * B16 | vd * B12 | B8 | m * B7 |
3915 B6 | m * B5 | B4 | vm); 3915 B6 | m * B5 | B4 | vm);
3916 } 3916 }
3917 3917
3918 void Assembler::vswp(DwVfpRegister dst, DwVfpRegister src) { 3918 void Assembler::vswp(DwVfpRegister dst, DwVfpRegister src) {
3919 // Instruction details available in ARM DDI 0406C.b, A8.8.418. 3919 // Instruction details available in ARM DDI 0406C.b, A8.8.418.
3920 // 1111(31-28) | 00111(27-23) | D(22) | 110010(21-16) | 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) 3921 // Vd(15-12) | 000000(11-6) | M(5) | 0(4) | Vm(3-0)
3922 DCHECK(IsEnabled(NEON)); 3922 DCHECK(IsEnabled(NEON));
3923 int vd, d; 3923 int vd, d;
3924 dst.split_code(&vd, &d); 3924 dst.split_code(&vd, &d);
(...skipping 18 matching lines...) Expand all
3943 void Assembler::veor(DwVfpRegister dst, DwVfpRegister src1, 3943 void Assembler::veor(DwVfpRegister dst, DwVfpRegister src1,
3944 DwVfpRegister src2) { 3944 DwVfpRegister src2) {
3945 // Instruction details available in ARM DDI 0406C.b, A8.8.888. 3945 // Instruction details available in ARM DDI 0406C.b, A8.8.888.
3946 DCHECK(IsEnabled(NEON)); 3946 DCHECK(IsEnabled(NEON));
3947 int vd, d; 3947 int vd, d;
3948 dst.split_code(&vd, &d); 3948 dst.split_code(&vd, &d);
3949 int vn, n; 3949 int vn, n;
3950 src1.split_code(&vn, &n); 3950 src1.split_code(&vn, &n);
3951 int vm, m; 3951 int vm, m;
3952 src2.split_code(&vm, &m); 3952 src2.split_code(&vm, &m);
3953 emit(0x1E6 * B23 | d * B22 | vn * B16 | vd * B12 | B8 | n * B7 | m * B5 | B4 | 3953 emit(0x1E6U * B23 | d * B22 | vn * B16 | vd * B12 | B8 | n * B7 | m * B5 |
3954 vm); 3954 B4 | vm);
3955 } 3955 }
3956 3956
3957 void Assembler::veor(QwNeonRegister dst, QwNeonRegister src1, 3957 void Assembler::veor(QwNeonRegister dst, QwNeonRegister src1,
3958 QwNeonRegister src2) { 3958 QwNeonRegister src2) {
3959 // Instruction details available in ARM DDI 0406C.b, A8.8.888. 3959 // Instruction details available in ARM DDI 0406C.b, A8.8.888.
3960 DCHECK(IsEnabled(NEON)); 3960 DCHECK(IsEnabled(NEON));
3961 int vd, d; 3961 int vd, d;
3962 dst.split_code(&vd, &d); 3962 dst.split_code(&vd, &d);
3963 int vn, n; 3963 int vn, n;
3964 src1.split_code(&vn, &n); 3964 src1.split_code(&vn, &n);
3965 int vm, m; 3965 int vm, m;
3966 src2.split_code(&vm, &m); 3966 src2.split_code(&vm, &m);
3967 emit(0x1E6 * B23 | d * B22 | vn * B16 | vd * B12 | B8 | n * B7 | B6 | m * B5 | 3967 emit(0x1E6U * B23 | d * B22 | vn * B16 | vd * B12 | B8 | n * B7 | B6 |
3968 B4 | vm); 3968 m * B5 | B4 | vm);
3969 } 3969 }
3970 3970
3971 // Pseudo instructions. 3971 // Pseudo instructions.
3972 void Assembler::nop(int type) { 3972 void Assembler::nop(int type) {
3973 // 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
3974 // 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
3975 // 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.
3976 // 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
3977 // a type. 3977 // a type.
3978 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
4514 DCHECK(is_uint12(offset)); 4514 DCHECK(is_uint12(offset));
4515 instr_at_put(pc, SetLdrRegisterImmediateOffset(instr, offset)); 4515 instr_at_put(pc, SetLdrRegisterImmediateOffset(instr, offset));
4516 } 4516 }
4517 } 4517 }
4518 4518
4519 4519
4520 } // namespace internal 4520 } // namespace internal
4521 } // namespace v8 4521 } // namespace v8
4522 4522
4523 #endif // V8_TARGET_ARCH_ARM 4523 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698