blob: 00d9118c85db0bff35f17c8832056df754cc62a4 [file] [log] [blame]
%default {"result":"%eax"}
/*
* Generic 32-bit binary operation. Provide an "instr" line that
* specifies an instruction that performs "result = eax op (rFP,%ecx,4)".
* This could be an x86 instruction or a function call. (If the result
* comes back in a register other than eax, you can override "result".)
*
* For: add-int, sub-int, and-int, or-int,
* xor-int, shl-int, shr-int, ushr-int
*/
/* binop vAA, vBB, vCC */
movzbl 2(rPC),%eax # eax<- BB
movzbl 3(rPC),%ecx # ecx<- CC
GET_VREG(%eax,%eax) # eax<- vBB
$instr # ex: addl (rFP,%ecx,4),%eax
movzbl rINST_HI,%ecx # ecx<- AA
FETCH_INST_WORD(2)
ADVANCE_PC(2)
SET_VREG($result,%ecx)
GOTO_NEXT