diff options
| author | 2012-10-02 18:10:35 -0700 | |
|---|---|---|
| committer | 2012-10-03 13:34:43 -0700 | |
| commit | 4f8f04ad94e68d2307a955d6bd72415fc0852725 (patch) | |
| tree | f4c7f58a5149667b5f8e3376064faa81f5b9842e /src/compiler/codegen/mips/Assemble.cc | |
| parent | 3e96a16c27c986275f60afe682d0b2a3064f45c9 (diff) | |
Fix endianness of compiled code and stacks of stubs for MIPS.
The gtests now all work on MIPS.
Change-Id: I2883ce002f23d75e700366014517c863fb626d09
Diffstat (limited to 'src/compiler/codegen/mips/Assemble.cc')
| -rw-r--r-- | src/compiler/codegen/mips/Assemble.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/compiler/codegen/mips/Assemble.cc b/src/compiler/codegen/mips/Assemble.cc index 25e13d7d8f..8c906ccdb3 100644 --- a/src/compiler/codegen/mips/Assemble.cc +++ b/src/compiler/codegen/mips/Assemble.cc @@ -691,19 +691,19 @@ AssemblerStatus oatAssembleInstructions(CompilationUnit *cUnit, << (int)encoder->fieldLoc[i].kind; } } - // FIXME: need multi-endian handling here - cUnit->codeBuffer.push_back((bits >> 24) & 0xff); - cUnit->codeBuffer.push_back((bits >> 16) & 0xff); - cUnit->codeBuffer.push_back((bits >> 8) & 0xff); + // We only support little-endian MIPS. cUnit->codeBuffer.push_back(bits & 0xff); + cUnit->codeBuffer.push_back((bits >> 8) & 0xff); + cUnit->codeBuffer.push_back((bits >> 16) & 0xff); + cUnit->codeBuffer.push_back((bits >> 24) & 0xff); // TUNING: replace with proper delay slot handling if (encoder->size == 8) { const MipsEncodingMap *encoder = &EncodingMap[kMipsNop]; u4 bits = encoder->skeleton; - cUnit->codeBuffer.push_back((bits >> 24) & 0xff); - cUnit->codeBuffer.push_back((bits >> 16) & 0xff); - cUnit->codeBuffer.push_back((bits >> 8) & 0xff); cUnit->codeBuffer.push_back(bits & 0xff); + cUnit->codeBuffer.push_back((bits >> 8) & 0xff); + cUnit->codeBuffer.push_back((bits >> 16) & 0xff); + cUnit->codeBuffer.push_back((bits >> 24) & 0xff); } } return res; |