Home | History | Annotate | Download | only in x86
      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     movzbl    2(rPC),%eax              # eax<- BB
     14     movsbl    3(rPC),%ecx              # ecx<- ssssssCC
     15     GET_VREG_R   %eax %eax             # eax<- rBB
     16     $instr                             # ex: addl %ecx,%eax
     17     SET_VREG   $result rINST
     18     FETCH_INST_OPCODE 2 %ecx
     19     ADVANCE_PC 2
     20     GOTO_NEXT_R %ecx
     21