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

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

Issue 8749002: Implement Math.pow using FPU instructions and inline it in crankshaft (ia32). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Also do NaN/infinity check on base for TAGGED case. Created 9 years 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
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 745 matching lines...) Expand 10 before | Expand all | Expand 10 after
756 break; 756 break;
757 default: 757 default:
758 switch (modrm_byte) { 758 switch (modrm_byte) {
759 case 0xE0: mnem = "fchs"; break; 759 case 0xE0: mnem = "fchs"; break;
760 case 0xE1: mnem = "fabs"; break; 760 case 0xE1: mnem = "fabs"; break;
761 case 0xE4: mnem = "ftst"; break; 761 case 0xE4: mnem = "ftst"; break;
762 case 0xE8: mnem = "fld1"; break; 762 case 0xE8: mnem = "fld1"; break;
763 case 0xEB: mnem = "fldpi"; break; 763 case 0xEB: mnem = "fldpi"; break;
764 case 0xED: mnem = "fldln2"; break; 764 case 0xED: mnem = "fldln2"; break;
765 case 0xEE: mnem = "fldz"; break; 765 case 0xEE: mnem = "fldz"; break;
766 case 0xF0: mnem = "f2xm1"; break;
766 case 0xF1: mnem = "fyl2x"; break; 767 case 0xF1: mnem = "fyl2x"; break;
767 case 0xF5: mnem = "fprem1"; break; 768 case 0xF5: mnem = "fprem1"; break;
768 case 0xF7: mnem = "fincstp"; break; 769 case 0xF7: mnem = "fincstp"; break;
769 case 0xF8: mnem = "fprem"; break; 770 case 0xF8: mnem = "fprem"; break;
771 case 0xFC: mnem = "frndint"; break;
772 case 0xFD: mnem = "fscale"; break;
770 case 0xFE: mnem = "fsin"; break; 773 case 0xFE: mnem = "fsin"; break;
771 case 0xFF: mnem = "fcos"; break; 774 case 0xFF: mnem = "fcos"; break;
772 default: UnimplementedInstruction(); 775 default: UnimplementedInstruction();
773 } 776 }
774 } 777 }
775 break; 778 break;
776 779
777 case 0xDA: 780 case 0xDA:
778 if (modrm_byte == 0xE9) { 781 if (modrm_byte == 0xE9) {
779 mnem = "fucompp"; 782 mnem = "fucompp";
780 } else { 783 } else {
781 UnimplementedInstruction(); 784 UnimplementedInstruction();
782 } 785 }
783 break; 786 break;
784 787
785 case 0xDB: 788 case 0xDB:
786 if ((modrm_byte & 0xF8) == 0xE8) { 789 if ((modrm_byte & 0xF8) == 0xE8) {
787 mnem = "fucomi"; 790 mnem = "fucomi";
788 has_register = true; 791 has_register = true;
789 } else if (modrm_byte == 0xE2) { 792 } else if (modrm_byte == 0xE2) {
790 mnem = "fclex"; 793 mnem = "fclex";
794 } else if (modrm_byte == 0xE3) {
795 mnem = "fninit";
791 } else { 796 } else {
792 UnimplementedInstruction(); 797 UnimplementedInstruction();
793 } 798 }
794 break; 799 break;
795 800
796 case 0xDC: 801 case 0xDC:
797 has_register = true; 802 has_register = true;
798 switch (modrm_byte & 0xF8) { 803 switch (modrm_byte & 0xF8) {
799 case 0xC0: mnem = "fadd"; break; 804 case 0xC0: mnem = "fadd"; break;
800 case 0xE8: mnem = "fsub"; break; 805 case 0xE8: mnem = "fsub"; break;
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
1178 } else if (*data == 0x16) { 1183 } else if (*data == 0x16) {
1179 data++; 1184 data++;
1180 int mod, regop, rm; 1185 int mod, regop, rm;
1181 get_modrm(*data, &mod, &regop, &rm); 1186 get_modrm(*data, &mod, &regop, &rm);
1182 int8_t imm8 = static_cast<int8_t>(data[1]); 1187 int8_t imm8 = static_cast<int8_t>(data[1]);
1183 AppendToBuffer("pextrd %s,%s,%d", 1188 AppendToBuffer("pextrd %s,%s,%d",
1184 NameOfCPURegister(regop), 1189 NameOfCPURegister(regop),
1185 NameOfXMMRegister(rm), 1190 NameOfXMMRegister(rm),
1186 static_cast<int>(imm8)); 1191 static_cast<int>(imm8));
1187 data += 2; 1192 data += 2;
1193 } else if (*data == 0x17){
1194 data++;
1195 int mod, regop, rm;
1196 get_modrm(*data, &mod, &regop, &rm);
1197 int8_t imm8 = static_cast<int8_t>(data[1]);
1198 AppendToBuffer("extractps %s,%s,%d",
1199 NameOfCPURegister(regop),
1200 NameOfXMMRegister(rm),
1201 static_cast<int>(imm8));
1202 data += 2;
1188 } else if (*data == 0x22) { 1203 } else if (*data == 0x22) {
1189 data++; 1204 data++;
1190 int mod, regop, rm; 1205 int mod, regop, rm;
1191 get_modrm(*data, &mod, &regop, &rm); 1206 get_modrm(*data, &mod, &regop, &rm);
1192 int8_t imm8 = static_cast<int8_t>(data[1]); 1207 int8_t imm8 = static_cast<int8_t>(data[1]);
1193 AppendToBuffer("pinsrd %s,%s,%d", 1208 AppendToBuffer("pinsrd %s,%s,%d",
1194 NameOfXMMRegister(regop), 1209 NameOfXMMRegister(regop),
1195 NameOfCPURegister(rm), 1210 NameOfCPURegister(rm),
1196 static_cast<int>(imm8)); 1211 static_cast<int>(imm8));
1197 data += 2; 1212 data += 2;
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
1649 fprintf(f, " "); 1664 fprintf(f, " ");
1650 } 1665 }
1651 fprintf(f, " %s\n", buffer.start()); 1666 fprintf(f, " %s\n", buffer.start());
1652 } 1667 }
1653 } 1668 }
1654 1669
1655 1670
1656 } // namespace disasm 1671 } // namespace disasm
1657 1672
1658 #endif // V8_TARGET_ARCH_IA32 1673 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698