1%default {"srcreg":"s0", "tgtreg":"d0"} 2 /* 3 * Generic 32bit-to-32bit floating point unary operation. Provide an 4 * "instr" line that specifies an instruction that performs "$tgtreg = op $srcreg". 5 * 6 * For: int-to-float, float-to-int 7 * TODO: refactor all of the conversions - parameterize width and use same template. 8 */ 9 /* unop vA, vB */ 10 lsr w3, wINST, #12 // w3<- B 11 ubfx w4, wINST, #8, #4 // w4<- A 12 GET_VREG $srcreg, w3 13 FETCH_ADVANCE_INST 1 // advance rPC, load wINST 14 $instr // d0<- op 15 GET_INST_OPCODE ip // extract opcode from wINST 16 SET_VREG $tgtreg, w4 // vA<- d0 17 GOTO_OPCODE ip // jump to next instruction 18