Arithmetic


ADD

Original EVMarrow-up-right instruction.

LLVM IR

%addition_result = add i256 %value1, %value2

The LLVM IR generator codearrow-up-right is common for Yul and EVMLA representations.

LLVM IR instruction documentationarrow-up-right

EraVM Assembly

add     r1, r2, r1

For more detail, see the EraVM specification referencearrow-up-right

MUL

Original EVMarrow-up-right instruction.

  1. The carry is written to the 2nd output register

LLVM IR

EraVM can output the carry of the multiplication operation. In this case, the result is a tuple of two values: the multiplication result and the carry. The carry is written to the 2nd output register. The snippet below returns the carry value.

The LLVM IR generator codearrow-up-right is common for Yul and EVMLA representations.

LLVM IR instruction documentationarrow-up-right

EraVM Assembly

For more detail, see the EraVM specification referencearrow-up-right

SUB

Original EVMarrow-up-right instruction.

LLVM IR

The LLVM IR generator codearrow-up-right is common for Yul and EVMLA representations.

LLVM IR instruction documentationarrow-up-right

EraVM Assembly

For more detail, see the EraVM specification referencearrow-up-right

DIV

Original EVMarrow-up-right instruction.

  1. The remainder is written to the 2nd output register

LLVM IR

The LLVM IR generator codearrow-up-right is common for Yul and EVMLA representations.

LLVM IR instruction documentationarrow-up-right

For more detail, see the EraVM specification referencearrow-up-right

SDIV

Original EVMarrow-up-right instruction.

LLVM IR

The LLVM IR generator codearrow-up-right is common for Yul and EVMLA representations.

LLVM IR instruction documentationarrow-up-right

EraVM does not have a similar instruction.

MOD

Original EVMarrow-up-right instruction.

  1. The remainder is written to the 2nd output register

LLVM IR

The LLVM IR generator codearrow-up-right is common for Yul and EVMLA representations.

LLVM IR instruction documentationarrow-up-right

For more detail, see the EraVM specification referencearrow-up-right

SMOD

Original EVMarrow-up-right instruction.

LLVM IR

The LLVM IR generator codearrow-up-right is common for Yul and EVMLA representations.

LLVM IR instruction documentationarrow-up-right

EraVM does not have a similar instruction.

ADDMOD

Original EVMarrow-up-right instruction.

LLVM IR

The LLVM IR generator codearrow-up-right is common for Yul and EVMLA representations.

EraVM does not have a similar instruction.

MULMOD

Original EVMarrow-up-right instruction.

LLVM IR

The LLVM IR generator codearrow-up-right is common for Yul and EVMLA representations.

EraVM does not have a similar instruction.

EXP

Original EVMarrow-up-right instruction.

LLVM IR

The LLVM IR generator codearrow-up-right is common for Yul and EVMLA representations.

EraVM does not have a similar instruction.

SIGNEXTEND

Original EVMarrow-up-right instruction.

The LLVM IR generator codearrow-up-right is common for Yul and EVMLA representations.

EraVM does not have a similar instruction.

Last updated