![]() | Fun 0.41.5 The programming language that makes You have fun |
Implements the OP_UCLAMP opcode for unsigned N-bit wrapping. More...
Go to the source code of this file.
Functions | |
| if (bits<=0) | |
| else | if (bits >=64) |
| push_value (vm, make_int((int64_t) wrapped)) | |
| free_value (v) | |
Variables | |
| case | OP_UCLAMP |
| int | bits = inst.operand |
| int64_t | vi = (v.type == VAL_INT) ? v.i : 0 |
| uint64_t | mask |
| else | |
| uint64_t | wrapped = ((uint64_t)vi) & mask |
| break | |
Implements the OP_UCLAMP opcode for unsigned N-bit wrapping.
This VM opcode masks an integer to the lower N bits (N taken from the instruction operand), effectively performing an unsigned wrap-around into the range [0 .. 2^N - 1].
Stack contract:
Definition in file uclamp.c.
| free_value | ( | v | ) |
| else |