diff mbox series

[5/7] opcode: add helpers opcode_negate() & opcode_swap()

Message ID 20201122152731.10994-6-luc.vanoostenryck@gmail.com (mailing list archive)
State Mainlined, archived
Headers show
Series simplify logical negation | expand

Commit Message

Luc Van Oostenryck Nov. 22, 2020, 3:27 p.m. UTC
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 opcode.h | 10 ++++++++++
 1 file changed, 10 insertions(+)
diff mbox series

Patch

diff --git a/opcode.h b/opcode.h
index 1524272f0320..b74ba02d94bd 100644
--- a/opcode.h
+++ b/opcode.h
@@ -32,6 +32,16 @@  extern const struct opcode_table {
 } opcode_table[];
 
 
+static inline int opcode_negate(int opcode)
+{
+	return opcode_table[opcode].negate;
+}
+
+static inline int opcode_swap(int opcode)
+{
+	return opcode_table[opcode].swap;
+}
+
 static inline int opcode_float(int opcode, struct symbol *type)
 {
 	if (!type || !is_float_type(type))