This is an archive of the discontinued LLVM Phabricator instance.

[mips] Define certain instructions in microMIPS32r3
ClosedPublic

Authored by smaksimovic on Jan 31 2018, 7:49 AM.

Details

Summary

Instructions affected:
mthc1, mfhc1, add.d, sub.d, mul.d, div.d,
mov.d, neg.d, cvt.w.d, cvt.d.s, cvt.d.w, cvt.s.d

These instructions are now defined for
microMIPS32r3 + microMIPS32r6 in MicroMipsInstrFPU.td
since they shared their encoding with those already defined
in microMIPS32r6InstrInfo.td and have been therefore
removed from the latter file.

Some instructions present in MicroMipsInstrFPU.td which
did not have both AFGR64 and FGR64 variants defined have
been altered to do so.

Diff Detail

Repository
rL LLVM

Event Timeline

smaksimovic created this revision.Jan 31 2018, 7:49 AM
sdardis accepted this revision.Feb 7 2018, 4:01 AM

LGTM with two inline nits addressed.

test/CodeGen/Mips/llvm-ir/arith.ll
1 ↗(On Diff #132173)

This file should be called 'fp-arith.ll' or something similar. 'arith.ll' suggests integer arithmetic to me, which we have test files already for.

test/CodeGen/Mips/llvm-ir/cp1move.ll
1 ↗(On Diff #132173)

You can use the debug option "-mno-ldc1-sdc1" to disable the generation of ldc1 and sdc1. That along with simple bitcasts will generate mthc1 and mfhc1 instructions. Then this file can be called bitcast.ll

This is better than replying on inline asm as we want to test code generation from llvm ir.

This revision is now accepted and ready to land.Feb 7 2018, 4:01 AM

Addressed review comments.
Slightly modified expandBuildPairF64/expandExtractElementF64 to check when in micromips mode.

Indentation

This revision was automatically updated to reflect the committed changes.

Had some changes from another patch sneak in this commit.
Reverted in r324585.