Hi Richard,

On 9/22/21 22:54, Richard Henderson wrote:
On 9/21/21 1:18 PM, WANG Xuerui wrote:
+    case INDEX_op_bswap32_i32:
+        /* All 32-bit values are computed sign-extended in the register.  */
+        a2 = TCG_BSWAP_OS;
+        /* fallthrough */
+    case INDEX_op_bswap32_i64:
+        tcg_out_opc_revb_2w(s, a0, a1);
+        if (a2 & TCG_BSWAP_OS) {
+            tcg_out_ext32s(s, a0, a0);
+        } else if ((a2 & (TCG_BSWAP_IZ | TCG_BSWAP_OZ)) == TCG_BSWAP_OZ) {
+            tcg_out_ext32u(s, a0, a0);
+        }
+        break;

Looks good so far, so:
Reviewed-by: Richard Henderson <richard.hender...@linaro.org>

We'll also want INDEX_op_bswap16_{i32,i64}.  This should look just like bswap32_i64, except with revb_2h and ext16{s,u}.
Thanks for the suggestion; I'll add these in v3, since they're relatively light-weight to implement.


r~

Reply via email to