unopNarrower.S revision 89c1feb0a69a7707b271086e749975b3f7acacf7
1%default {"preinstr":""}
2    /*
3     * Generic 64bit-to-32bit unary operation.  Provide an "instr" line
4     * that specifies an instruction that performs "result = op r0/r1", where
5     * "result" is a 32-bit quantity in r0.
6     *
7     * For: long-to-float, double-to-int, double-to-float
8     *
9     * (This would work for long-to-int, but that instruction is actually
10     * an exact match for OP_MOVE.)
11     */
12    /* unop vA, vB */
13    mov     r3, rINST, lsr #12          @ r3<- B
14    mov     r9, rINST, lsr #8           @ r9<- A+
15    add     r3, rFP, r3, lsl #2         @ r3<- &fp[B]
16    and     r9, r9, #15
17    ldmia   r3, {r0-r1}                 @ r0/r1<- vB/vB+1
18    FETCH_ADVANCE_INST(1)               @ advance rPC, load rINST
19    $preinstr                           @ optional op; may set condition codes
20    $instr                              @ r0<- op, r0-r3 changed
21    GET_INST_OPCODE(ip)                 @ extract opcode from rINST
22    SET_VREG(r0, r9)                    @ vA<- r0
23    GOTO_OPCODE(ip)                     @ jump to next instruction
24    /* 10-11 instructions */
25