Serguei Katkov | 6cbe081 | 2016-03-01 16:10:48 +0600 | [diff] [blame] | 1 | %default {"result":"%eax"} |
| 2 | /* |
| 3 | * Generic 32-bit "/2addr" binary operation. Provide an "instr" line |
| 4 | * that specifies an instruction that performs "result = r0 op r1". |
| 5 | * This could be an instruction or a function call. |
| 6 | * |
| 7 | * For: add-int/2addr, sub-int/2addr, mul-int/2addr, div-int/2addr, |
| 8 | * rem-int/2addr, and-int/2addr, or-int/2addr, xor-int/2addr, |
| 9 | * shl-int/2addr, shr-int/2addr, ushr-int/2addr, add-float/2addr, |
| 10 | * sub-float/2addr, mul-float/2addr, div-float/2addr, rem-float/2addr |
| 11 | */ |
| 12 | /* binop/2addr vA, vB */ |
| 13 | movl rINST, %ecx # rcx <- A+ |
| 14 | sarl $$4, rINST # rINST <- B |
| 15 | andb $$0xf, %cl # ecx <- A |
| 16 | GET_VREG %eax, rINSTq # eax <- vB |
| 17 | $instr # for ex: addl %eax,(rFP,%ecx,4) |
| 18 | CLEAR_REF %rcx |
| 19 | ADVANCE_PC_FETCH_AND_GOTO_NEXT 1 |