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

Unified Diff: src/arm/disasm-arm.cc

Issue 155047: ARM improvements to constant div, mod and mul.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 6 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/arm/disasm-arm.cc
===================================================================
--- src/arm/disasm-arm.cc (revision 2339)
+++ src/arm/disasm-arm.cc (working copy)
@@ -438,7 +438,19 @@
return 6;
}
case 'u': { // 'u: signed or unsigned multiplies
- if (instr->Bit(22) == 1) {
+ // The manual gets the meaning of bit 22 backwards in the multiply
+ // instruction overview on page A3.16.2. The instructions that
+ // exist in u and s variants are the following:
+ // smull A4.1.87
+ // umull A4.1.129
+ // umlal A4.1.128
+ // smlal A4.1.76
+ // For these 0 means u and 1 means s. As can be seen on their individual
+ // pages. The other 18 mul instructions have the bit set or unset in
+ // arbitrary ways that are unrelated to the signedness of the instruction.
+ // None of these 18 instructions exist in both a 'u' and an 's' variant.
+
+ if (instr->Bit(22) == 0) {
Print("u");
} else {
Print("s");
@@ -494,11 +506,16 @@
// multiply instructions
if (instr->Bit(23) == 0) {
if (instr->Bit(21) == 0) {
- Format(instr, "mul'cond's 'rd, 'rm, 'rs");
+ // Mul calls it Rd. Everyone else calls it Rn.
+ Format(instr, "mul'cond's 'rn, 'rm, 'rs");
} else {
- Format(instr, "mla'cond's 'rd, 'rm, 'rs, 'rn");
+ // In the manual the order is rd, rm, rs, rn. But mla swaps the
+ // positions of rn and rd in the encoding.
+ Format(instr, "mla'cond's 'rn, 'rm, 'rs, 'rd");
}
} else {
+ // In the manual the order is RdHi, RdLo, Rm, Rs.
+ // RdHi is what other instructions call Rn and RdLo is Rd.
Format(instr, "'um'al'cond's 'rn, 'rd, 'rm, 'rs");
}
} else {
« src/arm/codegen-arm.cc ('K') | « src/arm/codegen-arm.cc ('k') | src/arm/simulator-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698