Build a binary operation out of two constituent rvalues.
The parameter result_type
must be a numeric type.
The available binary operations are:
Binary Operation | C equivalent |
---|---|
GCC_JIT_BINARY_OP_PLUS | x + y |
GCC_JIT_BINARY_OP_MINUS | x - y |
GCC_JIT_BINARY_OP_MULT | x * y |
GCC_JIT_BINARY_OP_DIVIDE | x / y |
GCC_JIT_BINARY_OP_MODULO | x % y |
GCC_JIT_BINARY_OP_BITWISE_AND | x & y |
GCC_JIT_BINARY_OP_BITWISE_XOR | x ^ y |
GCC_JIT_BINARY_OP_BITWISE_OR | x | y |
GCC_JIT_BINARY_OP_LOGICAL_AND | x && y |
GCC_JIT_BINARY_OP_LOGICAL_OR | x || y |
GCC_JIT_BINARY_OP_LSHIFT | x << y |
GCC_JIT_BINARY_OP_RSHIFT | x >> y |
Addition of arithmetic values; analogous to:
(EXPR_A) + (EXPR_B)
in C.
For pointer addition, use gcc_jit_context_new_array_access().
Subtraction of arithmetic values; analogous to:
(EXPR_A) - (EXPR_B)
in C.
Multiplication of a pair of arithmetic values; analogous to:
(EXPR_A) * (EXPR_B)
in C.
Quotient of division of arithmetic values; analogous to:
(EXPR_A) / (EXPR_B)
in C.
The result type affects the kind of division: if the result type is integer-based, then the result is truncated towards zero, whereas a floating-point result type indicates floating-point division.
Remainder of division of arithmetic values; analogous to:
(EXPR_A) % (EXPR_B)
in C.
Bitwise AND; analogous to:
(EXPR_A) & (EXPR_B)
in C.
Bitwise exclusive OR; analogous to:
(EXPR_A) ^ (EXPR_B)
in C.
Bitwise inclusive OR; analogous to:
(EXPR_A) | (EXPR_B)
in C.
Logical AND; analogous to:
(EXPR_A) && (EXPR_B)
in C.
Logical OR; analogous to:
(EXPR_A) || (EXPR_B)
in C.
Left shift; analogous to:
(EXPR_A) << (EXPR_B)
in C.
Right shift; analogous to:
(EXPR_A) >> (EXPR_B)
in C.