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

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

Issue 1862993002: [arm] Implement Float(32|64)(Min|Max) using vsel. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 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 3353 matching lines...) Expand 10 before | Expand all | Expand 10 after
3364 // Instruction details available in ARM DDI 0406C.b, A8-864. 3364 // Instruction details available in ARM DDI 0406C.b, A8-864.
3365 // cond(31-28) | 11101(27-23)| D(22) | 11(21-20) | 0101(19-16) | 3365 // cond(31-28) | 11101(27-23)| D(22) | 11(21-20) | 0101(19-16) |
3366 // Vd(15-12) | 101(11-9) | sz=0(8) | E=0(7) | 1(6) | 0(5) | 0(4) | 0000(3-0) 3366 // Vd(15-12) | 101(11-9) | sz=0(8) | E=0(7) | 1(6) | 0(5) | 0(4) | 0000(3-0)
3367 DCHECK(src2 == 0.0); 3367 DCHECK(src2 == 0.0);
3368 int vd, d; 3368 int vd, d;
3369 src1.split_code(&vd, &d); 3369 src1.split_code(&vd, &d);
3370 emit(cond | 0x1D * B23 | d * B22 | 0x3 * B20 | 0x5 * B16 | vd * B12 | 3370 emit(cond | 0x1D * B23 | d * B22 | 0x3 * B20 | 0x5 * B16 | vd * B12 |
3371 0x5 * B9 | B6); 3371 0x5 * B9 | B6);
3372 } 3372 }
3373 3373
3374 void Assembler::vsel(Condition cond, const DwVfpRegister dst,
3375 const DwVfpRegister src1, const DwVfpRegister src2) {
3376 // cond=kSpecialCondition(31-28) | 11100(27-23) | D(22) |
3377 // vsel_cond=XX(21-20) | Vn(19-16) | Vd(15-12) | 101(11-9) | sz=1(8) | N(7) |
3378 // 0(6) | M(5) | 0(4) | Vm(3-0)
3379 DCHECK(CpuFeatures::IsSupported(ARMv8));
3380 int vd, d;
3381 dst.split_code(&vd, &d);
3382 int vn, n;
3383 src1.split_code(&vn, &n);
3384 int vm, m;
3385 src2.split_code(&vm, &m);
3386 int sz = 1;
3387
3388 // VSEL has a special (restricted) condition encoding.
3389 // eq(0b0000)... -> 0b00
3390 // ge(0b1010)... -> 0b10
3391 // gt(0b1100)... -> 0b11
3392 // vs(0b0110)... -> 0b01
3393 // No other conditions are supported.
3394 int vsel_cond = (cond >> 30) & 0x3;
3395 if ((cond != eq) && (cond != ge) && (cond != gt) && (cond != vs)) {
3396 // We can implement some other conditions by swapping the inputs.
3397 DCHECK((cond == ne) | (cond == lt) | (cond == le) | (cond == vc));
3398 std::swap(vn, vm);
3399 std::swap(n, m);
3400 }
3401
3402 emit(kSpecialCondition | 0x1C * B23 | d * B22 | vsel_cond * B20 | vn * B16 |
3403 vd * B12 | 0x5 * B9 | sz * B8 | n * B7 | m * B5 | vm);
3404 }
3405
3406 void Assembler::vsel(Condition cond, const SwVfpRegister dst,
3407 const SwVfpRegister src1, const SwVfpRegister src2) {
3408 // cond=kSpecialCondition(31-28) | 11100(27-23) | D(22) |
3409 // vsel_cond=XX(21-20) | Vn(19-16) | Vd(15-12) | 101(11-9) | sz=0(8) | N(7) |
3410 // 0(6) | M(5) | 0(4) | Vm(3-0)
3411 DCHECK(CpuFeatures::IsSupported(ARMv8));
3412 int vd, d;
3413 dst.split_code(&vd, &d);
3414 int vn, n;
3415 src1.split_code(&vn, &n);
3416 int vm, m;
3417 src2.split_code(&vm, &m);
3418 int sz = 0;
3419
3420 // VSEL has a special (restricted) condition encoding.
3421 // eq(0b0000)... -> 0b00
3422 // ge(0b1010)... -> 0b10
3423 // gt(0b1100)... -> 0b11
3424 // vs(0b0110)... -> 0b01
3425 // No other conditions are supported.
3426 int vsel_cond = (cond >> 30) & 0x3;
3427 if ((cond != eq) && (cond != ge) && (cond != gt) && (cond != vs)) {
3428 // We can implement some other conditions by swapping the inputs.
3429 DCHECK((cond == ne) | (cond == lt) | (cond == le) | (cond == vc));
3430 std::swap(vn, vm);
3431 std::swap(n, m);
3432 }
3433
3434 emit(kSpecialCondition | 0x1C * B23 | d * B22 | vsel_cond * B20 | vn * B16 |
3435 vd * B12 | 0x5 * B9 | sz * B8 | n * B7 | m * B5 | vm);
3436 }
3374 3437
3375 void Assembler::vsqrt(const DwVfpRegister dst, 3438 void Assembler::vsqrt(const DwVfpRegister dst,
3376 const DwVfpRegister src, 3439 const DwVfpRegister src,
3377 const Condition cond) { 3440 const Condition cond) {
3378 // Instruction details available in ARM DDI 0406C.b, A8-1058. 3441 // Instruction details available in ARM DDI 0406C.b, A8-1058.
3379 // cond(31-28) | 11101(27-23)| D(22) | 11(21-20) | 0001(19-16) | 3442 // cond(31-28) | 11101(27-23)| D(22) | 11(21-20) | 0001(19-16) |
3380 // Vd(15-12) | 101(11-9) | sz=1(8) | 11(7-6) | M(5) | 0(4) | Vm(3-0) 3443 // Vd(15-12) | 101(11-9) | sz=1(8) | 11(7-6) | M(5) | 0(4) | Vm(3-0)
3381 int vd, d; 3444 int vd, d;
3382 dst.split_code(&vd, &d); 3445 dst.split_code(&vd, &d);
3383 int vm, m; 3446 int vm, m;
(...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after
4165 DCHECK(is_uint12(offset)); 4228 DCHECK(is_uint12(offset));
4166 instr_at_put(pc, SetLdrRegisterImmediateOffset(instr, offset)); 4229 instr_at_put(pc, SetLdrRegisterImmediateOffset(instr, offset));
4167 } 4230 }
4168 } 4231 }
4169 4232
4170 4233
4171 } // namespace internal 4234 } // namespace internal
4172 } // namespace v8 4235 } // namespace v8
4173 4236
4174 #endif // V8_TARGET_ARCH_ARM 4237 #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