-
Notifications
You must be signed in to change notification settings - Fork 298
Description
Given the definition from the spec:
Radians
Converts degrees to radians, i.e., degrees * π / 180.
The operand degrees must be a scalar or vector whose component type is 16-bit or 32-bit floating-point.
Result Type and the type of degrees must be the same type. Results are computed per component.
Degrees
Converts radians to degrees, i.e., radians * 180 / π.
The operand radians must be a scalar or vector whose component type is 16-bit or 32-bit floating-point.
Result Type and the type of radians must be the same type. Results are computed per component.
Both of these instruction are simply short hand for a OpFMul or OpVectorTimesScalar, with the extra caveat of being limited to only 16bit or 32bit floats.
This certainly doesn't seem like something that needs its own instruction?
Additionally any use of it would currently not get folded by spirv-opt, (although a rule could be added to convert it so things like reassociation can happen later).
Many thanks,
Alister