#define RFLCT_MC(m) rflct_ms_ ## m
typedef enum {
- RFLCT_MC(None) = 0,
- RFLCT_MC(Mem) = 2,
- RFLCT_MC(Bool) = 4,
- RFLCT_MC(IntS) = 8,
- RFLCT_MC(IntU) = 16,
+ RFLCT_MC(None) = 0,
+ RFLCT_MC(Mem) = 2,
+ RFLCT_MC(Bool) = 4,
+ RFLCT_MC(IntS) = 8,
+ RFLCT_MC(IntU) = 16,
RFLCT_MC(Float) = 32,
- RFLCT_MC(Ref) = 64,
- RFLCT_MC(Char) = 128,
- RFLCT_MC(X) = 256,
- RFLCT_MC(BB) = 512,
- RFLCT_MC(Cf) = RFLCT_MC(X) | RFLCT_MC(BB),
+ RFLCT_MC(Ref) = 64,
+ RFLCT_MC(Char) = 128,
+ RFLCT_MC(X) = 256,
+ RFLCT_MC(BB) = 512,
+ RFLCT_MC(Cf) = RFLCT_MC(X) | RFLCT_MC(BB),
RFLCT_MC(Int) = RFLCT_MC(IntS) | RFLCT_MC(IntU),
RFLCT_MC(Intb) = RFLCT_MC(Int) | RFLCT_MC(Bool),
must be the same. If false, they can differ. */
} rflct_arg_t;
-typedef unsigned int rflct_mode_set_t;
-
-#define rflct_modeset_contains(mode_set,modecode) \
- (((mode_set) & (1 << modecode)) != 0)
-
-#define rflct_modeset_issubset(s1,s2) \
- (((s1) & (s2)) == (s1))
-
-#define rflct_modeset_union(s1,s2) \
- ((s1) | (s2))
-
-#define rflct_modeset_intersect(s1,s2) \
- ((s1) & (s2))
-
-#define rflct_modeset_diff(s1,s2) \
- ((s1) & ~(s2))
-
+#define RFLCT_ARG_IS_A(arg,modes) (((arg)->accepted_modes & modes) != 0)
#define RFLCT_ARG_VALID(arg) ((arg)->name != NULL)
+#define RFLCT_SIG_VALID(sig) ((sig) != INT_MAX)
/**
* Get the mode class for an IR mode.
*/
const rflct_arg_t *rflct_get_out_args(opcode opc, int sig);
+/**
+ * Make a string representation of a signature of an opcode.
+ * @param buf The buffer to put the string to.
+ * @param n The size of buf.
+ * @param opc The opcode.
+ * @param sig The signature.
+ * @return buf.
+ */
char *rflct_to_string(char *buf, int n, opcode opc, int sig);
+/**
+ * Get a string representation of a mode class.
+ * @param str The buffer to put the string to.
+ * @param n The size of the buffer.
+ * @param mc The mode class.
+ * @return str.
+ */
char *rflct_mode_class_name(char *str, int n, rflct_mode_class_t mc);
#endif