From 4f8f04ad94e68d2307a955d6bd72415fc0852725 Mon Sep 17 00:00:00 2001 From: jeffhao Date: Tue, 2 Oct 2012 18:10:35 -0700 Subject: Fix endianness of compiled code and stacks of stubs for MIPS. The gtests now all work on MIPS. Change-Id: I2883ce002f23d75e700366014517c863fb626d09 --- src/compiler/codegen/mips/Assemble.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/compiler/codegen/mips/Assemble.cc') 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; -- cgit v1.2.3-59-g8ed1b