1%default {"result":"%eax"} 2/* 3 * Generic 32-bit "lit8" binary operation. Provide an "instr" line 4 * that specifies an instruction that performs "result = eax op ecx". 5 * This could be an x86 instruction or a function call. (If the result 6 * comes back in a register other than r0, you can override "result".) 7 * 8 * For: add-int/lit8, rsub-int/lit8 9 * and-int/lit8, or-int/lit8, xor-int/lit8, 10 * shl-int/lit8, shr-int/lit8, ushr-int/lit8 11 */ 12 /* binop/lit8 vAA, vBB, #+CC */ 13 movzbq 2(rPC), %rax # rax <- BB 14 movsbl 3(rPC), %ecx # rcx <- ssssssCC 15 GET_VREG %eax, %rax # eax <- rBB 16 $instr # ex: addl %ecx,%eax 17 SET_VREG $result, rINSTq 18 ADVANCE_PC_FETCH_AND_GOTO_NEXT 2 19