[PATCH] [mips] [IAS] Add support for BNE and BEQ with an immediate operand.

Toma Tabacu toma.tabacu at imgtec.com
Thu May 14 07:53:53 PDT 2015


================
Comment at: lib/Target/Mips/MipsInstrInfo.td:1676
@@ +1675,3 @@
+def BneImm : MipsAsmPseudoInst<(outs GPR32Opnd:$rt),
+                               (ins uimm5:$imm32, brtarget:$offset),
+                               "bne\t$rt, $imm32, $offset">;
----------------
dsanders wrote:
> tomatabacu wrote:
> > dsanders wrote:
> > > I don't think you mean uimm5 here. Doesn't this accept a 32-bit immediate?
> > I'm not sure what to put here. I chose uimm5 because that's what LoadImm32 and LoadAddrImm32 use.
> They will need correcting too at some point. At the moment we get away with a fair bit because we don't do range checking on assembly immediates.
> 
> For 32-bit immediates, you need to define a simm32 and use that. If this accepts 64-bit immediates as well then define simm64 instead.
AFAICT simm32 or simm64 are not defined anywhere.
There's an imm64 in Mips64InstrInfo.td, so I could move the defs in there and use that.
These instructions are supposed to accept 64-bit immediates on 64-bit archs.

Also, I forgot to add a test case in mips-expansions-bad.s for using these with 64-bit immediates on 32-bit archs.

http://reviews.llvm.org/D9666

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list