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

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

Issue 2712193002: PPC: Declare XX3 format assembler function with opcode list macro (Closed)
Patch Set: Created 3 years, 9 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/ppc/assembler-ppc.h ('k') | 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 633 matching lines...) Expand 10 before | Expand all | Expand 10 after
644 void Assembler::x_form(Instr instr, Register ra, Register rs, Register rb, 644 void Assembler::x_form(Instr instr, Register ra, Register rs, Register rb,
645 RCBit r) { 645 RCBit r) {
646 emit(instr | rs.code() * B21 | ra.code() * B16 | rb.code() * B11 | r); 646 emit(instr | rs.code() * B21 | ra.code() * B16 | rb.code() * B11 | r);
647 } 647 }
648 648
649 void Assembler::xo_form(Instr instr, Register rt, Register ra, Register rb, 649 void Assembler::xo_form(Instr instr, Register rt, Register ra, Register rb,
650 OEBit o, RCBit r) { 650 OEBit o, RCBit r) {
651 emit(instr | rt.code() * B21 | ra.code() * B16 | rb.code() * B11 | o | r); 651 emit(instr | rt.code() * B21 | ra.code() * B16 | rb.code() * B11 | o | r);
652 } 652 }
653 653
654 void Assembler::xx3_form(Instr instr, DoubleRegister t, DoubleRegister a,
655 DoubleRegister b) {
656 int AX = ((a.code() & 0x20) >> 5) & 0x1;
657 int BX = ((b.code() & 0x20) >> 5) & 0x1;
658 int TX = ((t.code() & 0x20) >> 5) & 0x1;
659 emit(instr | (t.code() & 0x1F) * B21 | (a.code() & 0x1F) * B16 | (b.code()
660 & 0x1F) * B11 | AX * B2 | BX * B1 | TX);
661 }
662
663 void Assembler::md_form(Instr instr, Register ra, Register rs, int shift, 654 void Assembler::md_form(Instr instr, Register ra, Register rs, int shift,
664 int maskbit, RCBit r) { 655 int maskbit, RCBit r) {
665 int sh0_4 = shift & 0x1f; 656 int sh0_4 = shift & 0x1f;
666 int sh5 = (shift >> 5) & 0x1; 657 int sh5 = (shift >> 5) & 0x1;
667 int m0_4 = maskbit & 0x1f; 658 int m0_4 = maskbit & 0x1f;
668 int m5 = (maskbit >> 5) & 0x1; 659 int m5 = (maskbit >> 5) & 0x1;
669 660
670 emit(instr | rs.code() * B21 | ra.code() * B16 | sh0_4 * B11 | m0_4 * B6 | 661 emit(instr | rs.code() * B21 | ra.code() * B16 | sh0_4 * B11 | m0_4 * B6 |
671 m5 * B5 | sh5 * B1 | r); 662 m5 * B5 | sh5 * B1 | r);
672 } 663 }
(...skipping 1675 matching lines...) Expand 10 before | Expand all | Expand 10 after
2348 } 2339 }
2349 2340
2350 2341
2351 void Assembler::fmsub(const DoubleRegister frt, const DoubleRegister fra, 2342 void Assembler::fmsub(const DoubleRegister frt, const DoubleRegister fra,
2352 const DoubleRegister frc, const DoubleRegister frb, 2343 const DoubleRegister frc, const DoubleRegister frb,
2353 RCBit rc) { 2344 RCBit rc) {
2354 emit(EXT4 | FMSUB | frt.code() * B21 | fra.code() * B16 | frb.code() * B11 | 2345 emit(EXT4 | FMSUB | frt.code() * B21 | fra.code() * B16 | frb.code() * B11 |
2355 frc.code() * B6 | rc); 2346 frc.code() * B6 | rc);
2356 } 2347 }
2357 2348
2358 // Support for VSX instructions
2359
2360 void Assembler::xsadddp(const DoubleRegister frt, const DoubleRegister fra,
2361 const DoubleRegister frb) {
2362 xx3_form(EXT6 | XSADDDP, frt, fra, frb);
2363 }
2364 void Assembler::xssubdp(const DoubleRegister frt, const DoubleRegister fra,
2365 const DoubleRegister frb) {
2366 xx3_form(EXT6 | XSSUBDP, frt, fra, frb);
2367 }
2368 void Assembler::xsdivdp(const DoubleRegister frt, const DoubleRegister fra,
2369 const DoubleRegister frb) {
2370 xx3_form(EXT6 | XSDIVDP, frt, fra, frb);
2371 }
2372 void Assembler::xsmuldp(const DoubleRegister frt, const DoubleRegister fra,
2373 const DoubleRegister frb) {
2374 xx3_form(EXT6 | XSMULDP, frt, fra, frb);
2375 }
2376
2377 // Pseudo instructions. 2349 // Pseudo instructions.
2378 void Assembler::nop(int type) { 2350 void Assembler::nop(int type) {
2379 Register reg = r0; 2351 Register reg = r0;
2380 switch (type) { 2352 switch (type) {
2381 case NON_MARKING_NOP: 2353 case NON_MARKING_NOP:
2382 reg = r0; 2354 reg = r0;
2383 break; 2355 break;
2384 case GROUP_ENDING_NOP: 2356 case GROUP_ENDING_NOP:
2385 reg = r2; 2357 reg = r2;
2386 break; 2358 break;
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
2566 2538
2567 trampoline_ = Trampoline(pc_offset() - size, tracked_branch_count_); 2539 trampoline_ = Trampoline(pc_offset() - size, tracked_branch_count_);
2568 } 2540 }
2569 } 2541 }
2570 2542
2571 2543
2572 } // namespace internal 2544 } // namespace internal
2573 } // namespace v8 2545 } // namespace v8
2574 2546
2575 #endif // V8_TARGET_ARCH_PPC 2547 #endif // V8_TARGET_ARCH_PPC
OLDNEW
« no previous file with comments | « src/ppc/assembler-ppc.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698