wrong operand in getBinaryCodeForInstr

Hi,

case MICROBLAZE::BGEID:

{

// op: raencoder

op = getMachineOpValue(MI, MI.getOperand(0), Fixups, STI);

Value |= (op & UINT64_C(31)) << 16;

// op: imm16

op = getMachineOpValue**(MI, MI.getOperand(0)**, Fixups, STI); → should be operand[1]

Value |= op & UINT64_C(65535);

break;

}

I have added different encoder method for operand(1) but that operand is not even propagated in Encodeinstruction…

by the way,this is how I have defined BGEID…

def : Pat<(brcond (setcc (i32 GR32:$L), (i32 GR32:$R), SETGE), bb:$T),

(BGEID (CMP GR32:$L, GR32:$R), bb:$T)>;

def BGEID : TBT<0b101110, (outs), (ins GR32:$ra, brtarget:$offset), “bgeid\t$ra,$offset”, [], IIC_BRc> {

let rd = 0b10101;

}

I don’t know where I am doing wrong.please provide your notes…

Thanks,
Mahesh B