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

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

Issue 2871663002: MIPS64: Add/fix bit insertion/extraction instrs. (Closed)
Patch Set: Remove pps variable use Created 3 years, 7 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/mips64/assembler-mips64.h ('k') | src/mips64/constants-mips64.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 are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // 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 2479 matching lines...) Expand 10 before | Expand all | Expand 10 after
2490 // GPR. 2490 // GPR.
2491 void Assembler::selnez(Register rd, Register rs, Register rt) { 2491 void Assembler::selnez(Register rd, Register rs, Register rt) {
2492 DCHECK(kArchVariant == kMips64r6); 2492 DCHECK(kArchVariant == kMips64r6);
2493 GenInstrRegister(SPECIAL, rs, rt, rd, 0, SELNEZ_S); 2493 GenInstrRegister(SPECIAL, rs, rt, rd, 0, SELNEZ_S);
2494 } 2494 }
2495 2495
2496 2496
2497 // Bit twiddling. 2497 // Bit twiddling.
2498 void Assembler::clz(Register rd, Register rs) { 2498 void Assembler::clz(Register rd, Register rs) {
2499 if (kArchVariant != kMips64r6) { 2499 if (kArchVariant != kMips64r6) {
2500 // Clz instr requires same GPR number in 'rd' and 'rt' fields. 2500 // clz instr requires same GPR number in 'rd' and 'rt' fields.
2501 GenInstrRegister(SPECIAL2, rs, rd, rd, 0, CLZ); 2501 GenInstrRegister(SPECIAL2, rs, rd, rd, 0, CLZ);
2502 } else { 2502 } else {
2503 GenInstrRegister(SPECIAL, rs, zero_reg, rd, 1, CLZ_R6); 2503 GenInstrRegister(SPECIAL, rs, zero_reg, rd, 1, CLZ_R6);
2504 } 2504 }
2505 } 2505 }
2506 2506
2507 2507
2508 void Assembler::dclz(Register rd, Register rs) { 2508 void Assembler::dclz(Register rd, Register rs) {
2509 if (kArchVariant != kMips64r6) { 2509 if (kArchVariant != kMips64r6) {
2510 // dclz instr requires same GPR number in 'rd' and 'rt' fields. 2510 // dclz instr requires same GPR number in 'rd' and 'rt' fields.
2511 GenInstrRegister(SPECIAL2, rs, rd, rd, 0, DCLZ); 2511 GenInstrRegister(SPECIAL2, rs, rd, rd, 0, DCLZ);
2512 } else { 2512 } else {
2513 GenInstrRegister(SPECIAL, rs, zero_reg, rd, 1, DCLZ_R6); 2513 GenInstrRegister(SPECIAL, rs, zero_reg, rd, 1, DCLZ_R6);
2514 } 2514 }
2515 } 2515 }
2516 2516
2517 2517
2518 void Assembler::ins_(Register rt, Register rs, uint16_t pos, uint16_t size) { 2518 void Assembler::ins_(Register rt, Register rs, uint16_t pos, uint16_t size) {
2519 // Should be called via MacroAssembler::Ins. 2519 // Should be called via MacroAssembler::Ins.
2520 // Ins instr has 'rt' field as dest, and two uint5: msb, lsb. 2520 // ins instr has 'rt' field as dest, and two uint5: msb, lsb.
2521 DCHECK((kArchVariant == kMips64r2) || (kArchVariant == kMips64r6)); 2521 DCHECK((kArchVariant == kMips64r2) || (kArchVariant == kMips64r6));
2522 GenInstrRegister(SPECIAL3, rs, rt, pos + size - 1, pos, INS); 2522 GenInstrRegister(SPECIAL3, rs, rt, pos + size - 1, pos, INS);
2523 } 2523 }
2524 2524
2525 2525
2526 void Assembler::dins_(Register rt, Register rs, uint16_t pos, uint16_t size) { 2526 void Assembler::dins_(Register rt, Register rs, uint16_t pos, uint16_t size) {
2527 // Should be called via MacroAssembler::Dins. 2527 // Should be called via MacroAssembler::Dins.
2528 // Dext instr has 'rt' field as dest, and two uint5: msb, lsb. 2528 // dins instr has 'rt' field as dest, and two uint5: msb, lsb.
2529 DCHECK(kArchVariant == kMips64r2 || kArchVariant == kMips64r6); 2529 DCHECK(kArchVariant == kMips64r2 || kArchVariant == kMips64r6);
2530 GenInstrRegister(SPECIAL3, rs, rt, pos + size - 1, pos, DINS); 2530 GenInstrRegister(SPECIAL3, rs, rt, pos + size - 1, pos, DINS);
2531 } 2531 }
2532 2532
2533 void Assembler::dinsm_(Register rt, Register rs, uint16_t pos, uint16_t size) {
2534 // Should be called via MacroAssembler::Dins.
2535 // dinsm instr has 'rt' field as dest, and two uint5: msbminus32, lsb.
2536 DCHECK(kArchVariant == kMips64r2 || kArchVariant == kMips64r6);
2537 GenInstrRegister(SPECIAL3, rs, rt, pos + size - 1 - 32, pos, DINSM);
2538 }
2539
2540 void Assembler::dinsu_(Register rt, Register rs, uint16_t pos, uint16_t size) {
2541 // Should be called via MacroAssembler::Dins.
2542 // dinsu instr has 'rt' field as dest, and two uint5: msbminus32, lsbminus32.
2543 DCHECK(kArchVariant == kMips64r2 || kArchVariant == kMips64r6);
2544 GenInstrRegister(SPECIAL3, rs, rt, pos + size - 1 - 32, pos - 32, DINSU);
2545 }
2533 2546
2534 void Assembler::ext_(Register rt, Register rs, uint16_t pos, uint16_t size) { 2547 void Assembler::ext_(Register rt, Register rs, uint16_t pos, uint16_t size) {
2535 // Should be called via MacroAssembler::Ext. 2548 // Should be called via MacroAssembler::Ext.
2536 // Ext instr has 'rt' field as dest, and two uint5: msb, lsb. 2549 // ext instr has 'rt' field as dest, and two uint5: msbd, lsb.
2537 DCHECK(kArchVariant == kMips64r2 || kArchVariant == kMips64r6); 2550 DCHECK(kArchVariant == kMips64r2 || kArchVariant == kMips64r6);
2538 GenInstrRegister(SPECIAL3, rs, rt, size - 1, pos, EXT); 2551 GenInstrRegister(SPECIAL3, rs, rt, size - 1, pos, EXT);
2539 } 2552 }
2540 2553
2541 2554
2542 void Assembler::dext_(Register rt, Register rs, uint16_t pos, uint16_t size) { 2555 void Assembler::dext_(Register rt, Register rs, uint16_t pos, uint16_t size) {
2543 // Should be called via MacroAssembler::Dext. 2556 // Should be called via MacroAssembler::Dext.
2544 // Dext instr has 'rt' field as dest, and two uint5: msb, lsb. 2557 // dext instr has 'rt' field as dest, and two uint5: msbd, lsb.
2545 DCHECK(kArchVariant == kMips64r2 || kArchVariant == kMips64r6); 2558 DCHECK(kArchVariant == kMips64r2 || kArchVariant == kMips64r6);
2546 GenInstrRegister(SPECIAL3, rs, rt, size - 1, pos, DEXT); 2559 GenInstrRegister(SPECIAL3, rs, rt, size - 1, pos, DEXT);
2547 } 2560 }
2548 2561
2549 2562 void Assembler::dextm_(Register rt, Register rs, uint16_t pos, uint16_t size) {
2550 void Assembler::dextm(Register rt, Register rs, uint16_t pos, uint16_t size) {
2551 // Should be called via MacroAssembler::Dextm. 2563 // Should be called via MacroAssembler::Dextm.
2552 // Dextm instr has 'rt' field as dest, and two uint5: msb, lsb. 2564 // dextm instr has 'rt' field as dest, and two uint5: msbdminus32, lsb.
2553 DCHECK(kArchVariant == kMips64r2 || kArchVariant == kMips64r6); 2565 DCHECK(kArchVariant == kMips64r2 || kArchVariant == kMips64r6);
2554 GenInstrRegister(SPECIAL3, rs, rt, size - 1 - 32, pos, DEXTM); 2566 GenInstrRegister(SPECIAL3, rs, rt, size - 1 - 32, pos, DEXTM);
2555 } 2567 }
2556 2568
2557 2569 void Assembler::dextu_(Register rt, Register rs, uint16_t pos, uint16_t size) {
2558 void Assembler::dextu(Register rt, Register rs, uint16_t pos, uint16_t size) {
2559 // Should be called via MacroAssembler::Dextu. 2570 // Should be called via MacroAssembler::Dextu.
2560 // Dext instr has 'rt' field as dest, and two uint5: msb, lsb. 2571 // dextu instr has 'rt' field as dest, and two uint5: msbd, lsbminus32.
2561 DCHECK(kArchVariant == kMips64r2 || kArchVariant == kMips64r6); 2572 DCHECK(kArchVariant == kMips64r2 || kArchVariant == kMips64r6);
2562 GenInstrRegister(SPECIAL3, rs, rt, size - 1, pos - 32, DEXTU); 2573 GenInstrRegister(SPECIAL3, rs, rt, size - 1, pos - 32, DEXTU);
2563 } 2574 }
2564 2575
2565 2576
2566 void Assembler::bitswap(Register rd, Register rt) { 2577 void Assembler::bitswap(Register rd, Register rt) {
2567 DCHECK(kArchVariant == kMips64r6); 2578 DCHECK(kArchVariant == kMips64r6);
2568 GenInstrRegister(SPECIAL3, zero_reg, rt, rd, 0, BSHFL); 2579 GenInstrRegister(SPECIAL3, zero_reg, rt, rd, 0, BSHFL);
2569 } 2580 }
2570 2581
(...skipping 1482 matching lines...) Expand 10 before | Expand all | Expand 10 after
4053 4064
4054 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { 4065 if (icache_flush_mode != SKIP_ICACHE_FLUSH) {
4055 Assembler::FlushICache(isolate, pc, 4 * Assembler::kInstrSize); 4066 Assembler::FlushICache(isolate, pc, 4 * Assembler::kInstrSize);
4056 } 4067 }
4057 } 4068 }
4058 4069
4059 } // namespace internal 4070 } // namespace internal
4060 } // namespace v8 4071 } // namespace v8
4061 4072
4062 #endif // V8_TARGET_ARCH_MIPS64 4073 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/mips64/assembler-mips64.h ('k') | src/mips64/constants-mips64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698