File: opmath.hpp

package info (click to toggle)
rgbds 1.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 20,164 kB
  • sloc: cpp: 19,048; asm: 6,208; yacc: 2,405; sh: 1,784; makefile: 213; ansic: 14
file content (24 lines) | stat: -rw-r--r-- 637 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// SPDX-License-Identifier: MIT

#ifndef RGBDS_OP_MATH_HPP
#define RGBDS_OP_MATH_HPP

#include <stdint.h>

int32_t op_divide(int32_t dividend, int32_t divisor);
int32_t op_modulo(int32_t dividend, int32_t divisor);
int32_t op_exponent(int32_t base, uint32_t power);

int32_t op_shift_left(int32_t value, int32_t amount);
int32_t op_shift_right(int32_t value, int32_t amount);
int32_t op_shift_right_unsigned(int32_t value, int32_t amount);

int32_t op_neg(int32_t value);

int32_t op_high(int32_t value);
int32_t op_low(int32_t value);

int32_t op_bitwidth(int32_t value);
int32_t op_tzcount(int32_t value);

#endif // RGBDS_OP_MATH_HPP