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

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

Issue 2602293002: [ARM] Add vcge, vcgt instructions to assembler. (Closed)
Patch Set: Rebase. Created 3 years, 11 months 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/disasm-arm.cc » ('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 4301 matching lines...) Expand 10 before | Expand all | Expand 10 after
4312 int vm, m; 4312 int vm, m;
4313 src2.split_code(&vm, &m); 4313 src2.split_code(&vm, &m);
4314 int sz = static_cast<int>(size); 4314 int sz = static_cast<int>(size);
4315 emit(0x1E4U * B23 | d * B22 | sz * B20 | vn * B16 | vd * B12 | 0x8 * B8 | 4315 emit(0x1E4U * B23 | d * B22 | sz * B20 | vn * B16 | vd * B12 | 0x8 * B8 |
4316 n * B7 | B6 | m * B5 | B4 | vm); 4316 n * B7 | B6 | m * B5 | B4 | vm);
4317 } 4317 }
4318 4318
4319 void Assembler::vceq(const QwNeonRegister dst, const QwNeonRegister src1, 4319 void Assembler::vceq(const QwNeonRegister dst, const QwNeonRegister src1,
4320 const QwNeonRegister src2) { 4320 const QwNeonRegister src2) {
4321 DCHECK(IsEnabled(NEON)); 4321 DCHECK(IsEnabled(NEON));
4322 // Qd = vceq(Qn, Qm) SIMD integer compare equal. 4322 // Qd = vceq(Qn, Qm) SIMD floating point compare equal.
4323 // Instruction details available in ARM DDI 0406C.b, A8-844. 4323 // Instruction details available in ARM DDI 0406C.b, A8-844.
4324 int vd, d; 4324 int vd, d;
4325 dst.split_code(&vd, &d); 4325 dst.split_code(&vd, &d);
4326 int vn, n; 4326 int vn, n;
4327 src1.split_code(&vn, &n); 4327 src1.split_code(&vn, &n);
4328 int vm, m; 4328 int vm, m;
4329 src2.split_code(&vm, &m); 4329 src2.split_code(&vm, &m);
4330 emit(0x1E4U * B23 | d * B22 | vn * B16 | vd * B12 | 0xe * B8 | n * B7 | B6 | 4330 emit(0x1E4U * B23 | d * B22 | vn * B16 | vd * B12 | 0xe * B8 | n * B7 | B6 |
4331 m * B5 | vm); 4331 m * B5 | vm);
4332 } 4332 }
4333 4333
4334 void Assembler::vceq(NeonSize size, QwNeonRegister dst, 4334 void Assembler::vceq(NeonSize size, QwNeonRegister dst,
4335 const QwNeonRegister src1, const QwNeonRegister src2) { 4335 const QwNeonRegister src1, const QwNeonRegister src2) {
4336 DCHECK(IsEnabled(NEON)); 4336 DCHECK(IsEnabled(NEON));
4337 // Qd = vceq(Qn, Qm) SIMD bitwise compare equal. 4337 // Qd = vceq(Qn, Qm) SIMD integer compare equal.
4338 // Instruction details available in ARM DDI 0406C.b, A8-844. 4338 // Instruction details available in ARM DDI 0406C.b, A8-844.
4339 int vd, d; 4339 int vd, d;
4340 dst.split_code(&vd, &d); 4340 dst.split_code(&vd, &d);
4341 int vn, n; 4341 int vn, n;
4342 src1.split_code(&vn, &n); 4342 src1.split_code(&vn, &n);
4343 int vm, m; 4343 int vm, m;
4344 src2.split_code(&vm, &m); 4344 src2.split_code(&vm, &m);
4345 int sz = static_cast<int>(size); 4345 int sz = static_cast<int>(size);
4346 emit(0x1E6U * B23 | d * B22 | sz * B20 | vn * B16 | vd * B12 | 0x8 * B8 | 4346 emit(0x1E6U * B23 | d * B22 | sz * B20 | vn * B16 | vd * B12 | 0x8 * B8 |
4347 n * B7 | B6 | m * B5 | B4 | vm); 4347 n * B7 | B6 | m * B5 | B4 | vm);
4348 } 4348 }
4349 4349
4350 static Instr EncodeNeonCompareOp(const QwNeonRegister dst,
4351 const QwNeonRegister src1,
4352 const QwNeonRegister src2, Condition cond) {
4353 DCHECK(cond == ge || cond == gt);
4354 int vd, d;
4355 dst.split_code(&vd, &d);
4356 int vn, n;
4357 src1.split_code(&vn, &n);
4358 int vm, m;
4359 src2.split_code(&vm, &m);
4360 int is_gt = (cond == gt) ? 1 : 0;
4361 return 0x1E6U * B23 | d * B22 | is_gt * B21 | vn * B16 | vd * B12 | 0xe * B8 |
4362 n * B7 | B6 | m * B5 | vm;
4363 }
4364
4365 static Instr EncodeNeonCompareOp(NeonDataType dt, const QwNeonRegister dst,
4366 const QwNeonRegister src1,
4367 const QwNeonRegister src2, Condition cond) {
4368 DCHECK(cond == ge || cond == gt);
4369 int vd, d;
4370 dst.split_code(&vd, &d);
4371 int vn, n;
4372 src1.split_code(&vn, &n);
4373 int vm, m;
4374 src2.split_code(&vm, &m);
4375 int size = (dt & NeonDataTypeSizeMask) / 2;
4376 int U = dt & NeonDataTypeUMask;
4377 int is_ge = (cond == ge) ? 1 : 0;
4378 return 0x1E4U * B23 | U | d * B22 | size * B20 | vn * B16 | vd * B12 |
4379 0x3 * B8 | n * B7 | B6 | m * B5 | is_ge * B4 | vm;
4380 }
4381
4382 void Assembler::vcge(const QwNeonRegister dst, const QwNeonRegister src1,
4383 const QwNeonRegister src2) {
4384 DCHECK(IsEnabled(NEON));
4385 // Qd = vcge(Qn, Qm) SIMD floating point compare greater or equal.
4386 // Instruction details available in ARM DDI 0406C.b, A8-848.
4387 emit(EncodeNeonCompareOp(dst, src1, src2, ge));
4388 }
4389
4390 void Assembler::vcge(NeonDataType dt, QwNeonRegister dst,
4391 const QwNeonRegister src1, const QwNeonRegister src2) {
4392 DCHECK(IsEnabled(NEON));
4393 // Qd = vcge(Qn, Qm) SIMD integer compare greater or equal.
4394 // Instruction details available in ARM DDI 0406C.b, A8-848.
4395 emit(EncodeNeonCompareOp(dt, dst, src1, src2, ge));
4396 }
4397
4398 void Assembler::vcgt(const QwNeonRegister dst, const QwNeonRegister src1,
4399 const QwNeonRegister src2) {
4400 DCHECK(IsEnabled(NEON));
4401 // Qd = vcgt(Qn, Qm) SIMD floating point compare greater than.
4402 // Instruction details available in ARM DDI 0406C.b, A8-852.
4403 emit(EncodeNeonCompareOp(dst, src1, src2, gt));
4404 }
4405
4406 void Assembler::vcgt(NeonDataType dt, QwNeonRegister dst,
4407 const QwNeonRegister src1, const QwNeonRegister src2) {
4408 DCHECK(IsEnabled(NEON));
4409 // Qd = vcgt(Qn, Qm) SIMD integer compare greater than.
4410 // Instruction details available in ARM DDI 0406C.b, A8-852.
4411 emit(EncodeNeonCompareOp(dt, dst, src1, src2, gt));
4412 }
4413
4350 void Assembler::vbsl(QwNeonRegister dst, const QwNeonRegister src1, 4414 void Assembler::vbsl(QwNeonRegister dst, const QwNeonRegister src1,
4351 const QwNeonRegister src2) { 4415 const QwNeonRegister src2) {
4352 DCHECK(IsEnabled(NEON)); 4416 DCHECK(IsEnabled(NEON));
4353 // Qd = vbsl(Qn, Qm) SIMD bitwise select. 4417 // Qd = vbsl(Qn, Qm) SIMD bitwise select.
4354 // Instruction details available in ARM DDI 0406C.b, A8-844. 4418 // Instruction details available in ARM DDI 0406C.b, A8-844.
4355 int vd, d; 4419 int vd, d;
4356 dst.split_code(&vd, &d); 4420 dst.split_code(&vd, &d);
4357 int vn, n; 4421 int vn, n;
4358 src1.split_code(&vn, &n); 4422 src1.split_code(&vn, &n);
4359 int vm, m; 4423 int vm, m;
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after
5003 DCHECK(is_uint12(offset)); 5067 DCHECK(is_uint12(offset));
5004 instr_at_put(pc, SetLdrRegisterImmediateOffset(instr, offset)); 5068 instr_at_put(pc, SetLdrRegisterImmediateOffset(instr, offset));
5005 } 5069 }
5006 } 5070 }
5007 5071
5008 5072
5009 } // namespace internal 5073 } // namespace internal
5010 } // namespace v8 5074 } // namespace v8
5011 5075
5012 #endif // V8_TARGET_ARCH_ARM 5076 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/assembler-arm.h ('k') | src/arm/disasm-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698