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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: src/x64/disasm-x64.cc
diff --git a/src/x64/disasm-x64.cc b/src/x64/disasm-x64.cc
index d8d6dbb23bca454cb7716b60c51b32df4d6f5ff8..ab0c2ec65a8c806feafd295561e90cdd8f629e8b 100644
--- a/src/x64/disasm-x64.cc
+++ b/src/x64/disasm-x64.cc
@@ -860,22 +860,44 @@ int DisassemblerX64::FPUInstruction(byte* data) {
return count + 1;
}
} else if (b1 == 0xDD) {
- if ((b2 & 0xF8) == 0xC0) {
- AppendToBuffer("ffree st%d", b2 & 0x7);
+ int mod, regop, rm;
+ get_modrm(*(data + 1), &mod, &regop, &rm);
+ if (mod == 3) {
+ switch (regop & 7) {
+ case 0:
+ AppendToBuffer("ffree st%d", rm & 7);
+ break;
+ case 2:
+ AppendToBuffer("fst st%d", rm & 7);
+ break;
+ case 3:
+ AppendToBuffer("fstp st%d", rm & 7);
+ break;
+ case 4:
+ AppendToBuffer("fucom st%d", rm & 7);
+ break;
+ case 5:
+ AppendToBuffer("fucomp st%d", rm & 7);
+ break;
+ default:
+ UnimplementedInstruction();
+ }
return 2;
} else {
- int mod, regop, rm;
- get_modrm(*(data + 1), &mod, &regop, &rm);
const char* mnem = "?";
switch (regop) {
case 0:
mnem = "fld_d";
break;
+ case 2:
+ mnem = "fst_d";
+ break;
case 3:
mnem = "fstp_d";
break;
default:
UnimplementedInstruction();
+ return 2;
}
AppendToBuffer("%s ", mnem);
int count = PrintRightOperand(data + 1);

Powered by Google App Engine
This is Rietveld 408576698