On 12/17/24 14:03, Pierrick Bouvier wrote:
+__attribute__((unused))
+static bool fold_masks_zs(OptContext *ctx, TCGOp *op,
+ uint64_t z_mask, uint64_t s_mask)
+{
+ return fold_masks_zsa(ctx, op, z_mask, s_mask, -1);
+}
+
+__attribute__((unused))
+static bool fold_masks_z(OptContext *ctx, TCGOp *op, uint64_t z_mask)
+{
+ return fold_masks_zsa(ctx, op, z_mask, smask_from_zmask(z_mask), -1);
+}
+
+static bool fold_masks(OptContext *ctx, TCGOp *op)
+{
+ return fold_masks_zsa(ctx, op, ctx->z_mask, ctx->s_mask, ctx->a_mask);
+}
+
/*
* Convert @op to NOT, if NOT is supported by the host.
* Return true f the conversion is successful, which will still
I see the direction, but why not simply use a structure for this?
If I understand correctly, we'll only pass the masks to callees, so it's easy to pass the
pointer down (without any heap allocation needed), and we can have associated builder
functions to create the struct only with a limited set of masks, or directly from an
existing "ctx".
Why would we want to use a structure? I'm confused by the question.
r~