blob: bc99263adb61bcc71de1a11d119480c820baeb69 [file] [log] [blame]
Douglas Leung200f0402016-02-25 20:05:47 -08001%default {"preinstr":"", "result0":"a0"}
2 /*
3 * Generic 32-bit unary operation. Provide an "instr" line that
Alexey Frunze84603bf2016-10-21 19:54:43 -07004 * specifies an instruction that performs "result0 = op a0".
Douglas Leung200f0402016-02-25 20:05:47 -08005 * This could be a MIPS instruction or a function call.
6 *
Alexey Frunze84603bf2016-10-21 19:54:43 -07007 * for: int-to-byte, int-to-char, int-to-short,
8 * neg-int, not-int, neg-float
Douglas Leung200f0402016-02-25 20:05:47 -08009 */
10 /* unop vA, vB */
11 GET_OPB(a3) # a3 <- B
12 GET_OPA4(t0) # t0 <- A+
13 GET_VREG(a0, a3) # a0 <- vB
14 FETCH_ADVANCE_INST(1) # advance rPC, load rINST
15 $preinstr # optional op
16 $instr # a0 <- op, a0-a3 changed
17 GET_INST_OPCODE(t1) # extract opcode from rINST
Alexey Frunze84603bf2016-10-21 19:54:43 -070018 SET_VREG_GOTO($result0, t0, t1) # vA <- result0