buzbee | 1452bee | 2015-03-06 14:43:04 -0800 | [diff] [blame^] | 1 | %default {"preinstr":""} |
| 2 | /* |
| 3 | * Generic 32bit-to-64bit unary operation. Provide an "instr" line |
| 4 | * that specifies an instruction that performs "result = op r0", where |
| 5 | * "result" is a 64-bit quantity in r0/r1. |
| 6 | * |
| 7 | * For: int-to-long, int-to-double, float-to-long, float-to-double |
| 8 | */ |
| 9 | /* unop vA, vB */ |
| 10 | mov r3, rINST, lsr #12 @ r3<- B |
| 11 | ubfx r9, rINST, #8, #4 @ r9<- A |
| 12 | GET_VREG r0, r3 @ r0<- vB |
| 13 | add r9, rFP, r9, lsl #2 @ r9<- &fp[A] |
| 14 | $preinstr @ optional op; may set condition codes |
| 15 | FETCH_ADVANCE_INST 1 @ advance rPC, load rINST |
| 16 | $instr @ r0<- op, r0-r3 changed |
| 17 | GET_INST_OPCODE ip @ extract opcode from rINST |
| 18 | stmia r9, {r0-r1} @ vA/vA+1<- r0/r1 |
| 19 | GOTO_OPCODE ip @ jump to next instruction |
| 20 | /* 9-10 instructions */ |