[PATCH vkd3d] vkd3d-shader/hlsl: Handle constant value operations on a different file.

Giovanni Mascellani gmascellani at codeweavers.com
Wed Jan 5 02:38:52 CST 2022


Hi,

On 04/01/22 17:59, Francisco Casas wrote:
> Noted. The only problem with (+), (*), and (-), I can think of is
> signed integer overflow.

I think so. Notice that for these three operations (and unary negation)
you can just treat signed numbers as unsigned and everything will be
fine, at least on the platforms we target.

For floating point operations the result can unfortunately depend on the
currently set floating point environment (so in theory we'd have to
check what native compiler does and set the environment accordingly),
but I guess we can ignore this problem for the moment. I don't think
those operations should cause floating point exceptions, with the
possible exception of signaling NaNs, which I don't really know how they
work in practice. This is something that can be deferred to later too, I
think.

> I am not sure yet if implicit castings in C may result in undefined
> behaviors, I must check.

I don't think so. Implicit casting is not different from explicit
casting in what it does, only in when it is allowed, I think.

Giovanni.



More information about the wine-devel mailing list