Re: [PATCH v2 05/50] tcg: Expose tcg_gen_ussub_sat()
Richard Henderson <[email protected]>
| Newsgroups | gmane.comp.emulators.qemu |
|---|---|
| Message-ID | <[email protected]> |
On 7/29/26 20:09, Anton Johansson via qemu development wrote:
> @@ -2399,14 +2399,14 @@ void tcg_gen_gvec_usadd(unsigned vece, uint32_t dofs, uint32_t aofs,
> tcg_gen_gvec_3(dofs, aofs, bofs, oprsz, maxsz, &g[vece]);
> }
>
> -static void tcg_gen_ussub_i32(TCGv_i32 d, TCGv_i32 a, TCGv_i32 b)
> +void tcg_gen_ussub_i32(TCGv_i32 d, TCGv_i32 a, TCGv_i32 b)
> {
> TCGv_i32 min = tcg_constant_i32(0);
> tcg_gen_sub_i32(d, a, b);
> tcg_gen_movcond_i32(TCG_COND_LTU, d, a, b, min, d);
> }
These aren't quite general purpose. The existing formulation "knows" that d does not
overlap a or b -- which is true under the limited invocation here. If you want to expose
these for wider use, you need to fix that by allocating a new temporary around this operation.
r~