This is an archive of the discontinued LLVM Phabricator instance.

[mips][microMIPS] Implement ADDIUSP instruction
ClosedPublic

Authored by jkolek on Aug 27 2014, 3:01 AM.

Details

Summary

Implement 16-bit microMIPS add immediate unsigned word to stack pointer - ADDIUSP.

Diff Detail

Repository
rL LLVM

Event Timeline

jkolek updated this revision to Diff 12982.Aug 27 2014, 3:01 AM
jkolek retitled this revision from to [mips][microMIPS] Implement ADDIUSP instruction.
jkolek updated this object.
jkolek edited the test plan for this revision. (Show Details)
jkolek added reviewers: dsanders, vmedic.
jkolek added a subscriber: zoran.jovanovic.
jkolek updated this revision to Diff 12983.Aug 27 2014, 4:03 AM
jkolek updated this revision to Diff 12984.Aug 27 2014, 5:10 AM
jkolek updated this revision to Diff 14111.Sep 26 2014, 6:08 AM
jkolek added a reviewer: sstankovic.
jkolek updated this revision to Diff 14114.Sep 26 2014, 6:33 AM
sstankovic edited edge metadata.Sep 29 2014, 8:23 AM

For this instruction there seems to be a difference between microMIPS reference and GAS, regarding the decoded value of a offset. microMIPS reference says that allowable values for a offset are [2, 3, ..., 256, 257] and [-3, -4, ..., -257, -258], and this value is shifted by 2 to give final stack offset. GAS allows only shifted (final) values: [8, 12, ... , 1024, 1028] and [-12, -16, ... , -1028, -1032]. I suggest to follow GAS approach, because .s file is much easier to read if final offset is used. Of course, encoded values are identical.

jkolek updated this revision to Diff 14209.Sep 30 2014, 4:33 AM
jkolek edited edge metadata.

LGTM, with a change of variable name to uppercase.

lib/Target/Mips/MCTargetDesc/MipsMCCodeEmitter.cpp
373 ↗(On Diff #14209)

Variable name should start with uppercase.

sstankovic accepted this revision.Oct 1 2014, 8:58 AM
sstankovic edited edge metadata.
This revision is now accepted and ready to land.Oct 1 2014, 8:58 AM
Diffusion closed this revision.Oct 10 2014, 7:47 AM
Diffusion updated this revision to Diff 14731.

Closed by commit rL219500 (authored by zjovanovic).

jkolek edited edge metadata.Nov 18 2014, 5:56 AM
jkolek added a subscriber: Unknown Object (MLST).