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

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

Issue 300004: X64 Win64: Reimplement fmod so that it works. (Closed)
Patch Set: And it lints. Created 11 years, 2 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
OLDNEW
1 // Copyright 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 842 matching lines...) Expand 10 before | Expand all | Expand 10 after
853 mnem = "fstp_s"; 853 mnem = "fstp_s";
854 break; 854 break;
855 default: 855 default:
856 UnimplementedInstruction(); 856 UnimplementedInstruction();
857 } 857 }
858 AppendToBuffer("%s ", mnem); 858 AppendToBuffer("%s ", mnem);
859 int count = PrintRightOperand(data + 1); 859 int count = PrintRightOperand(data + 1);
860 return count + 1; 860 return count + 1;
861 } 861 }
862 } else if (b1 == 0xDD) { 862 } else if (b1 == 0xDD) {
863 if ((b2 & 0xF8) == 0xC0) { 863 int mod, regop, rm;
864 AppendToBuffer("ffree st%d", b2 & 0x7); 864 get_modrm(*(data + 1), &mod, &regop, &rm);
865 if (mod == 3) {
866 switch (regop & 7) {
867 case 0:
868 AppendToBuffer("ffree st%d", rm & 7);
869 break;
870 case 2:
871 AppendToBuffer("fst st%d", rm & 7);
872 break;
873 case 3:
874 AppendToBuffer("fstp st%d", rm & 7);
875 break;
876 case 4:
877 AppendToBuffer("fucom st%d", rm & 7);
878 break;
879 case 5:
880 AppendToBuffer("fucomp st%d", rm & 7);
881 break;
882 default:
883 UnimplementedInstruction();
884 }
865 return 2; 885 return 2;
866 } else { 886 } else {
867 int mod, regop, rm;
868 get_modrm(*(data + 1), &mod, &regop, &rm);
869 const char* mnem = "?"; 887 const char* mnem = "?";
870 switch (regop) { 888 switch (regop) {
871 case 0: 889 case 0:
872 mnem = "fld_d"; 890 mnem = "fld_d";
873 break; 891 break;
892 case 2:
893 mnem = "fst_d";
894 break;
874 case 3: 895 case 3:
875 mnem = "fstp_d"; 896 mnem = "fstp_d";
876 break; 897 break;
877 default: 898 default:
878 UnimplementedInstruction(); 899 UnimplementedInstruction();
900 return 2;
879 } 901 }
880 AppendToBuffer("%s ", mnem); 902 AppendToBuffer("%s ", mnem);
881 int count = PrintRightOperand(data + 1); 903 int count = PrintRightOperand(data + 1);
882 return count + 1; 904 return count + 1;
883 } 905 }
884 } else if (b1 == 0xDB) { 906 } else if (b1 == 0xDB) {
885 int mod, regop, rm; 907 int mod, regop, rm;
886 get_modrm(*(data + 1), &mod, &regop, &rm); 908 get_modrm(*(data + 1), &mod, &regop, &rm);
887 const char* mnem = "?"; 909 const char* mnem = "?";
888 switch (regop) { 910 switch (regop) {
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after
1582 fprintf(f, "%02x", *bp); 1604 fprintf(f, "%02x", *bp);
1583 } 1605 }
1584 for (int i = 6 - (pc - prev_pc); i >= 0; i--) { 1606 for (int i = 6 - (pc - prev_pc); i >= 0; i--) {
1585 fprintf(f, " "); 1607 fprintf(f, " ");
1586 } 1608 }
1587 fprintf(f, " %s\n", buffer.start()); 1609 fprintf(f, " %s\n", buffer.start());
1588 } 1610 }
1589 } 1611 }
1590 1612
1591 } // namespace disasm 1613 } // namespace disasm
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698