if (ai->has_immed) {
/* MSB overlaps with STORE */
assert(ai->tok != T_OP_MSB);
+ if (ai->xmov) {
+ fprintf(stderr, "ALU instruction cannot have immediate and xmov\n");
+ exit(1);
+ }
opc = tok2alu(ai->tok);
instr.alui.dst = ai->dst;
instr.alui.src = ai->src1;
instr.alu.dst = ai->dst;
instr.alu.src1 = ai->src1;
instr.alu.src2 = ai->src2;
+ instr.alu.xmov = ai->xmov;
instr.alu.alu = tok2alu(ai->tok);
}
break;
/* move can either be encoded as movi (ie. move w/ immed) or
* an alu instruction
*/
+ if ((ai->has_immed || ai->label) && ai->xmov) {
+ fprintf(stderr, "ALU instruction cannot have immediate and xmov\n");
+ exit(1);
+ }
if (ai->has_immed) {
opc = OPC_MOVI;
instr.movi.dst = ai->dst;
instr.alu.dst = ai->dst;
instr.alu.src1 = 0x00; /* $00 reads-back 0 */
instr.alu.src2 = ai->src1;
+ instr.alu.xmov = ai->xmov;
instr.alu.alu = OPC_OR;
}
break;