+#define emith_mvn_r_r(d, s) { \
+ if (d != s) \
+ emith_move_r_r(d, s); \
+ EMIT_OP_MODRM(0xf7, 3, 2, d); /* NOT d */ \
+}
+
+#define emith_negc_r_r(d, s) { \
+ int tmp_ = rcache_get_tmp(); \
+ emith_move_r_imm(tmp_, 0); \
+ emith_sbc_r_r(tmp_, s); \
+ emith_move_r_r(d, tmp_); \
+ rcache_free_tmp(tmp_); \
+}
+
+#define emith_neg_r_r(d, s) { \
+ if (d != s) \
+ emith_move_r_r(d, s); \
+ EMIT_OP_MODRM(0xf7, 3, 3, d); /* NEG d */ \
+}
+
+// _r_r_r
+#define emith_eor_r_r_r(d, s1, s2) { \
+ if (d == s1) { \
+ emith_eor_r_r(d, s2); \
+ } else if (d == s2) { \
+ emith_eor_r_r(d, s1); \
+ } else { \
+ emith_move_r_r(d, s1); \
+ emith_eor_r_r(d, s2); \
+ } \
+}
+
+// _r_r_shift
+#define emith_or_r_r_lsl(d, s, lslimm) { \
+ int tmp_ = rcache_get_tmp(); \
+ emith_lsl(tmp_, s, lslimm); \
+ emith_or_r_r(d, tmp_); \
+ rcache_free_tmp(tmp_); \
+}
+
+// d != s
+#define emith_eor_r_r_lsr(d, s, lsrimm) { \
+ emith_push(s); \
+ emith_lsr(s, s, lsrimm); \
+ emith_eor_r_r(d, s); \
+ emith_pop(s); \
+}
+