Home | History | Annotate | Download | only in mips
      1 %default {"preinstr":""}
      2     /*
      3      * Generic 32-bit unary operation.  Provide an "instr" line that
      4      * specifies an instruction that performs "result = op a0".
      5      * This could be a MIPS instruction or a function call.
      6      *
      7      * for: int-to-float, float-to-int
      8      */
      9     /* unop vA, vB */
     10     GET_OPB(a3)                            #  a3 <- B
     11     GET_OPA4(rOBJ)                         #  t0 <- A+
     12 #ifdef SOFT_FLOAT
     13     GET_VREG(a0, a3)                       #  a0 <- vB
     14 #else
     15     GET_VREG_F(fa0, a3)
     16 #endif
     17     $preinstr                              #  optional op
     18     FETCH_ADVANCE_INST(1)                  #  advance rPC, load rINST
     19 #ifdef SOFT_FLOAT
     20     $instr                                 #  a0 <- op, a0-a3 changed
     21 
     22 .L${opcode}_set_vreg:
     23     SET_VREG(v0, rOBJ)                     #  vAA <- result0
     24 #else
     25     $instr_f
     26 
     27 .L${opcode}_set_vreg_f:
     28     SET_VREG_F(fv0, rOBJ)
     29 #endif
     30     GET_INST_OPCODE(t1)                    #  extract opcode from rINST
     31     GOTO_OPCODE(t1)                        #  jump to next instruction
     32     /* 9-10 instructions */
     33