Next: , Previous: , Up: Instruction Set   [Contents][Index]


9.3.7.11 Inlined Mathematical Instructions

Inlining mathematical operations has the obvious advantage of handling fixnums without function calls or allocations. The trick, of course, is knowing when the result of an operation will be a fixnum, and there might be a couple bugs here.

More instructions could be added here over time.

All of these operations place their result in their first operand, dst.

Instruction: add u8:dst u8:a u8:b

Add a to b.

Instruction: add1 u12:dst u12:src

Add 1 to the value in src.

Instruction: sub u8:dst u8:a u8:b

Subtract b from a.

Instruction: sub1 u12:dst u12:src

Subtract 1 from src.

Instruction: mul u8:dst u8:a u8:b

Multiply a and b.

Instruction: div u8:dst u8:a u8:b

Divide a by b.

Instruction: quo u8:dst u8:a u8:b

Divide a by b.

Instruction: rem u8:dst u8:a u8:b

Divide a by b.

Instruction: mod u8:dst u8:a u8:b

Compute the modulo of a by b.

Instruction: ash u8:dst u8:a u8:b

Shift a arithmetically by b bits.

Instruction: logand u8:dst u8:a u8:b

Compute the bitwise and of a and b.

Instruction: logior u8:dst u8:a u8:b

Compute the bitwise inclusive or of a with b.

Instruction: logxor u8:dst u8:a u8:b

Compute the bitwise exclusive or of a with b.