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    lsr     w4, wINST, #8               // w4<- A+
12    GET_VREG $srcreg, w3
13    FETCH_ADVANCE_INST 1                // advance rPC, load wINST
14    and     w4, w4, #15                 // w4<- A
15    $instr                              // d0<- op
16    GET_INST_OPCODE ip                  // extract opcode from wINST
17    SET_VREG $tgtreg, w4                // vA<- d0
18    GOTO_OPCODE ip                      // jump to next instruction
19