aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/opcode.h
blob: eda4c3a74c9d355927f7c1f553babd96e0b6b67a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#ifndef OPCODE_H
#define OPCODE_H

#include "symbol.h"

extern const struct opcode_table {
	int	negate:8;
	int	swap:8;
	int	to_float:8;
} opcode_table[];


static inline int opcode_float(int opcode, struct symbol *type)
{
	if (!type || !is_float_type(type))
		return opcode;
	return opcode_table[opcode].to_float;
}

#endif