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

Side by Side Diff: src/ia32/disasm-ia32.cc

Issue 21509003: Extend assembler and codegen with more fpu arithmetic (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « src/ia32/assembler-ia32.cc ('k') | src/ia32/lithium-codegen-ia32.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after
736 return count + 1; 736 return count + 1;
737 } 737 }
738 738
739 int DisassemblerIA32::RegisterFPUInstruction(int escape_opcode, 739 int DisassemblerIA32::RegisterFPUInstruction(int escape_opcode,
740 byte modrm_byte) { 740 byte modrm_byte) {
741 bool has_register = false; // Is the FPU register encoded in modrm_byte? 741 bool has_register = false; // Is the FPU register encoded in modrm_byte?
742 const char* mnem = "?"; 742 const char* mnem = "?";
743 743
744 switch (escape_opcode) { 744 switch (escape_opcode) {
745 case 0xD8: 745 case 0xD8:
746 UnimplementedInstruction(); 746 has_register = true;
747 switch (modrm_byte & 0xF8) {
748 case 0xC0: mnem = "fadd_i"; break;
749 case 0xE0: mnem = "fsub_i"; break;
750 case 0xC8: mnem = "fmul_i"; break;
751 case 0xF0: mnem = "fdiv_i"; break;
752 default: UnimplementedInstruction();
753 }
747 break; 754 break;
748 755
749 case 0xD9: 756 case 0xD9:
750 switch (modrm_byte & 0xF8) { 757 switch (modrm_byte & 0xF8) {
751 case 0xC0: 758 case 0xC0:
752 mnem = "fld"; 759 mnem = "fld";
753 has_register = true; 760 has_register = true;
754 break; 761 break;
755 case 0xC8: 762 case 0xC8:
756 mnem = "fxch"; 763 mnem = "fxch";
757 has_register = true; 764 has_register = true;
758 break; 765 break;
759 default: 766 default:
760 switch (modrm_byte) { 767 switch (modrm_byte) {
761 case 0xE0: mnem = "fchs"; break; 768 case 0xE0: mnem = "fchs"; break;
762 case 0xE1: mnem = "fabs"; break; 769 case 0xE1: mnem = "fabs"; break;
763 case 0xE4: mnem = "ftst"; break; 770 case 0xE4: mnem = "ftst"; break;
764 case 0xE8: mnem = "fld1"; break; 771 case 0xE8: mnem = "fld1"; break;
765 case 0xEB: mnem = "fldpi"; break; 772 case 0xEB: mnem = "fldpi"; break;
766 case 0xED: mnem = "fldln2"; break; 773 case 0xED: mnem = "fldln2"; break;
767 case 0xEE: mnem = "fldz"; break; 774 case 0xEE: mnem = "fldz"; break;
768 case 0xF0: mnem = "f2xm1"; break; 775 case 0xF0: mnem = "f2xm1"; break;
769 case 0xF1: mnem = "fyl2x"; break; 776 case 0xF1: mnem = "fyl2x"; break;
777 case 0xF4: mnem = "fxtract"; break;
770 case 0xF5: mnem = "fprem1"; break; 778 case 0xF5: mnem = "fprem1"; break;
771 case 0xF7: mnem = "fincstp"; break; 779 case 0xF7: mnem = "fincstp"; break;
772 case 0xF8: mnem = "fprem"; break; 780 case 0xF8: mnem = "fprem"; break;
773 case 0xFC: mnem = "frndint"; break; 781 case 0xFC: mnem = "frndint"; break;
774 case 0xFD: mnem = "fscale"; break; 782 case 0xFD: mnem = "fscale"; break;
775 case 0xFE: mnem = "fsin"; break; 783 case 0xFE: mnem = "fsin"; break;
776 case 0xFF: mnem = "fcos"; break; 784 case 0xFF: mnem = "fcos"; break;
777 default: UnimplementedInstruction(); 785 default: UnimplementedInstruction();
778 } 786 }
779 } 787 }
(...skipping 28 matching lines...) Expand all
808 case 0xC8: mnem = "fmul"; break; 816 case 0xC8: mnem = "fmul"; break;
809 case 0xF8: mnem = "fdiv"; break; 817 case 0xF8: mnem = "fdiv"; break;
810 default: UnimplementedInstruction(); 818 default: UnimplementedInstruction();
811 } 819 }
812 break; 820 break;
813 821
814 case 0xDD: 822 case 0xDD:
815 has_register = true; 823 has_register = true;
816 switch (modrm_byte & 0xF8) { 824 switch (modrm_byte & 0xF8) {
817 case 0xC0: mnem = "ffree"; break; 825 case 0xC0: mnem = "ffree"; break;
826 case 0xD0: mnem = "fst"; break;
818 case 0xD8: mnem = "fstp"; break; 827 case 0xD8: mnem = "fstp"; break;
819 default: UnimplementedInstruction(); 828 default: UnimplementedInstruction();
820 } 829 }
821 break; 830 break;
822 831
823 case 0xDE: 832 case 0xDE:
824 if (modrm_byte == 0xD9) { 833 if (modrm_byte == 0xD9) {
825 mnem = "fcompp"; 834 mnem = "fcompp";
826 } else { 835 } else {
827 has_register = true; 836 has_register = true;
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after
1442 AppendToBuffer("test eax,0x%x", *reinterpret_cast<int32_t*>(data+1)); 1451 AppendToBuffer("test eax,0x%x", *reinterpret_cast<int32_t*>(data+1));
1443 data += 5; 1452 data += 5;
1444 break; 1453 break;
1445 1454
1446 case 0xD1: // fall through 1455 case 0xD1: // fall through
1447 case 0xD3: // fall through 1456 case 0xD3: // fall through
1448 case 0xC1: 1457 case 0xC1:
1449 data += D1D3C1Instruction(data); 1458 data += D1D3C1Instruction(data);
1450 break; 1459 break;
1451 1460
1461 case 0xD8: // fall through
1452 case 0xD9: // fall through 1462 case 0xD9: // fall through
1453 case 0xDA: // fall through 1463 case 0xDA: // fall through
1454 case 0xDB: // fall through 1464 case 0xDB: // fall through
1455 case 0xDC: // fall through 1465 case 0xDC: // fall through
1456 case 0xDD: // fall through 1466 case 0xDD: // fall through
1457 case 0xDE: // fall through 1467 case 0xDE: // fall through
1458 case 0xDF: 1468 case 0xDF:
1459 data += FPUInstruction(data); 1469 data += FPUInstruction(data);
1460 break; 1470 break;
1461 1471
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
1718 fprintf(f, " "); 1728 fprintf(f, " ");
1719 } 1729 }
1720 fprintf(f, " %s\n", buffer.start()); 1730 fprintf(f, " %s\n", buffer.start());
1721 } 1731 }
1722 } 1732 }
1723 1733
1724 1734
1725 } // namespace disasm 1735 } // namespace disasm
1726 1736
1727 #endif // V8_TARGET_ARCH_IA32 1737 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/assembler-ia32.cc ('k') | src/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698