On 2/17/22 13:17, David Miller wrote:
+#define F_PRO    asm ( \
+    "lg %%r2, %[a]\n"  \
+    "lg %%r3, %[b]\n"  \
+    "lg %%r0, %[c]\n"  \
+    "ltgr %%r0, %%r0"  \
+    : : [a] "m" (a),   \
+        [b] "m" (b),   \
+        [c] "m" (c)    \
+    : "r0", "r2", "r3", "r4")
+
+
+
+#define Fi3(S, ASM) uint64_t S(uint64_t a, uint64_t b, uint64_t c) \
+{ uint64_t res = 0; F_PRO ; ASM ; return res; }
+
+
+Fi3 (_selre,     asm("selre    %%r0, %%r3, %%r2\n" F_EPI))
+Fi3 (_selgrz,    asm("selgrz   %%r0, %%r3, %%r2\n" F_EPI))
+Fi3 (_selfhrnz,  asm("selfhrnz %%r0, %%r3, %%r2\n" F_EPI))

You can't split these two asm, lest the ltgr and sel not be adjacent, and the flags not having the correct value when we arrive at the sel.

No test for popcnt, seeing as there's a bug in m3?


r~

Reply via email to