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

Issue 12545024: Adds a few MIPS arithmetic instructions to the simulator, assembler, disassembler (Closed)

Created:
7 years, 9 months ago by zra
Modified:
7 years, 9 months ago
Reviewers:
regis, Ivan Posva
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Visibility:
Public.

Description

Adds a few MIPS arithmetic instructions to the simulator, assembler, disassembler Committed: https://code.google.com/p/dart/source/detail?r=19730

Patch Set 1 #

Total comments: 15

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Total comments: 19
Unified diffs Side-by-side diffs Delta from patch set Stats (+571 lines, -1 line) Patch
M runtime/vm/assembler_mips.h View 1 2 3 chunks +76 lines, -0 lines 6 comments Download
M runtime/vm/assembler_mips_test.cc View 1 2 1 chunk +237 lines, -0 lines 7 comments Download
M runtime/vm/constants_mips.h View 1 2 2 chunks +5 lines, -0 lines 0 comments Download
M runtime/vm/disassembler_mips.cc View 1 2 3 chunks +64 lines, -0 lines 4 comments Download
M runtime/vm/simulator_mips.h View 1 2 3 chunks +16 lines, -0 lines 0 comments Download
M runtime/vm/simulator_mips.cc View 1 2 3 2 chunks +173 lines, -1 line 2 comments Download

Messages

Total messages: 7 (0 generated)
zra
There are lots of instructions, but I'll try to keep the CL's small, and just ...
7 years, 9 months ago (2013-03-08 19:02:13 UTC) #1
regis
LGTM with a few things to fix. https://codereview.chromium.org/12545024/diff/1/runtime/vm/assembler_mips.h File runtime/vm/assembler_mips.h (right): https://codereview.chromium.org/12545024/diff/1/runtime/vm/assembler_mips.h#newcode293 runtime/vm/assembler_mips.h:293: sll(rd, rd, ...
7 years, 9 months ago (2013-03-08 21:09:03 UTC) #2
zra
On 2013/03/08 21:09:03, regis wrote: > https://codereview.chromium.org/12545024/diff/1/runtime/vm/assembler_mips.h#newcode293 > runtime/vm/assembler_mips.h:293: sll(rd, rd, 16); > The 2 ...
7 years, 9 months ago (2013-03-08 21:45:14 UTC) #3
zra
Committed patchset #4 manually as r19730 (presubmit successful).
7 years, 9 months ago (2013-03-08 21:47:08 UTC) #4
regis
On 2013/03/08 21:47:08, zra wrote: > Committed patchset #4 manually as r19730 (presubmit successful). For ...
7 years, 9 months ago (2013-03-08 22:26:24 UTC) #5
Ivan Posva
https://codereview.chromium.org/12545024/diff/20002/runtime/vm/assembler_mips.h File runtime/vm/assembler_mips.h (right): https://codereview.chromium.org/12545024/diff/20002/runtime/vm/assembler_mips.h#newcode224 runtime/vm/assembler_mips.h:224: ASSERT(Utils::IsUint(16, imm.value())); I would expect that imm is checked ...
7 years, 9 months ago (2013-03-11 06:03:27 UTC) #6
zra
7 years, 9 months ago (2013-03-11 15:46:03 UTC) #7
Message was sent while issue was closed.
https://codereview.chromium.org/12545024/diff/20002/runtime/vm/assembler_mips.h
File runtime/vm/assembler_mips.h (right):

https://codereview.chromium.org/12545024/diff/20002/runtime/vm/assembler_mips...
runtime/vm/assembler_mips.h:224: ASSERT(Utils::IsUint(16, imm.value()));
On 2013/03/11 06:03:27, Ivan Posva wrote:
> I would expect that imm is checked against Utils::IsInt(16, imm.value()) due
to:
> The 16-bit signed immediate is added to the 32-bit value in GPR rs to produce
a
> 32-bit result.
> 
> And then do the static cast to uint16_t below.

Yah, you're right. I've already fixed this in my next CL.

https://codereview.chromium.org/12545024/diff/20002/runtime/vm/assembler_mips...
runtime/vm/assembler_mips.h:226: EmitIType(ADDI, rs, rt, imm_value);
On 2013/03/11 06:03:27, Ivan Posva wrote:
> Also I am not sure we even use this instruction due to its trap causing
> implications.

Should I remove it?

https://codereview.chromium.org/12545024/diff/20002/runtime/vm/assembler_mips...
runtime/vm/assembler_mips.h:230: ASSERT(Utils::IsUint(16, imm.value()));
On 2013/03/11 06:03:27, Ivan Posva wrote:
> ditto (sign extension)

In next CL

https://codereview.chromium.org/12545024/diff/20002/runtime/vm/assembler_mips...
File runtime/vm/assembler_mips_test.cc (right):

https://codereview.chromium.org/12545024/diff/20002/runtime/vm/assembler_mips...
runtime/vm/assembler_mips_test.cc:39:
EXPECT_EQ(static_cast<int32_t>(0x7fffffff),
On 2013/03/11 06:03:27, Ivan Posva wrote:
> Shouldn't this execute a trap?

It should execute a trap, yes. Is there any way to test that behavior, or should
I just remove this test?

https://codereview.chromium.org/12545024/diff/20002/runtime/vm/assembler_mips...
runtime/vm/assembler_mips_test.cc:58: __ addiu(V0, V0, Immediate(1));  // V0 is
set on overflow
On 2013/03/11 06:03:27, Ivan Posva wrote:
> V0 is set to which value?
> Probably it would be clearer to say:
> V0 is modified on overflow.

Done.

https://codereview.chromium.org/12545024/diff/20002/runtime/vm/assembler_mips...
runtime/vm/assembler_mips_test.cc:127: __ addi(R1, ZR, Immediate(0xffff));
On 2013/03/11 06:03:27, Ivan Posva wrote:
> It would be much clearer if you passed a -1 here.

Done.

https://codereview.chromium.org/12545024/diff/20002/runtime/vm/disassembler_m...
File runtime/vm/disassembler_mips.cc (right):

https://codereview.chromium.org/12545024/diff/20002/runtime/vm/disassembler_m...
runtime/vm/disassembler_mips.cc:259: Format(instr, "addi 'rt, 'rs, 'immu");
On 2013/03/11 06:03:27, Ivan Posva wrote:
> 'imms as this immediate is sign-extended.

Done.

https://codereview.chromium.org/12545024/diff/20002/runtime/vm/disassembler_m...
runtime/vm/disassembler_mips.cc:263: Format(instr, "addiu 'rt, 'rs, 'immu");
On 2013/03/11 06:03:27, Ivan Posva wrote:
> ditto.

Done.

https://codereview.chromium.org/12545024/diff/20002/runtime/vm/simulator_mips.cc
File runtime/vm/simulator_mips.cc (right):

https://codereview.chromium.org/12545024/diff/20002/runtime/vm/simulator_mips...
runtime/vm/simulator_mips.cc:289: set_register(instr->RtField(), res);
On 2013/03/11 06:03:27, Ivan Posva wrote:
> Shouldn't this also dispatch to a trap handler?

Yes. I've added a TODO for myself that I'll fill in once I bring the debugger
over from ARM.

Powered by Google App Engine
This is Rietveld 408576698