buzbee | 1452bee | 2015-03-06 14:43:04 -0800 | [diff] [blame^] | 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 | ubfx r9, rINST, #8, #4 @ r9<- A |
| 15 | add r3, rFP, r3, lsl #2 @ r3<- &fp[B] |
| 16 | ldmia r3, {r0-r1} @ r0/r1<- vB/vB+1 |
| 17 | FETCH_ADVANCE_INST 1 @ advance rPC, load rINST |
| 18 | $preinstr @ optional op; may set condition codes |
| 19 | $instr @ r0<- op, r0-r3 changed |
| 20 | GET_INST_OPCODE ip @ extract opcode from rINST |
| 21 | SET_VREG r0, r9 @ vA<- r0 |
| 22 | GOTO_OPCODE ip @ jump to next instruction |
| 23 | /* 9-10 instructions */ |