Douglas Leung | 200f040 | 2016-02-25 20:05:47 -0800 | [diff] [blame] | 1 | %default {"preinstr":"", "result0":"a0", "result1":"a1"} |
| 2 | /* |
| 3 | * Generic 32bit-to-64bit unary operation. Provide an "instr" line |
| 4 | * that specifies an instruction that performs "result = op a0", where |
| 5 | * "result" is a 64-bit quantity in a0/a1. |
| 6 | * |
| 7 | * For: int-to-long |
| 8 | */ |
| 9 | /* unop vA, vB */ |
| 10 | GET_OPA4(rOBJ) # rOBJ <- A+ |
| 11 | GET_OPB(a3) # a3 <- B |
| 12 | GET_VREG(a0, a3) # a0 <- vB |
| 13 | FETCH_ADVANCE_INST(1) # advance rPC, load rINST |
| 14 | $preinstr # optional op |
| 15 | $instr # result <- op, a0-a3 changed |
| 16 | GET_INST_OPCODE(t0) # extract opcode from rINST |
| 17 | SET_VREG64($result0, $result1, rOBJ) # vA/vA+1 <- a0/a1 |
| 18 | GOTO_OPCODE(t0) # jump to next instruction |
| 19 | /* 10-11 instructions */ |