dotnet/runtime

Support recognizing `Blend` as commutative

Open

#82.365 aberto em 19 de fev. de 2023

Ver no GitHub
 (5 comments) (2 reactions) (2 assignees)C# (5.445 forks)batch import
area-CodeGen-coreclrhelp wanted

Métricas do repositório

Stars
 (17.886 stars)
Métricas de merge de PR
 (Mesclagem média 12d 11h) (661 fundiu PRs em 30d)

Description

We don't currently track Blend as commutative and so we miss an opportunity to ensure that "memory operands" always appear on the RHS: https://github.com/SixLabors/ImageSharp/pull/2359#discussion_r1111147888

Support should be added to treat this as commutative which really just entails inverting the constant (e.g. Blend(x, y, 0b0111_0111) is equivalent to Blend(y, x, 0b1000_1000)).

There are actually a few operations this applies to that involve two inputs + control mask. Not all of them are as trivially as inverting the constant, however.

Guia do colaborador