Closed Lancern closed 2 days ago
This PR fixes a bug during the CIRGen of fp16 unary operations. Before this patch, for the expression -x where x is a fp16 value, CIRGen emits the code like the following:
-x
x
%0 = cir.cast float_to_float %x : !cir.f16 -> !cir.float %1 = cir.cast float_to_float %0 : !cir.float -> !cir.f16 %2 = cir.unary minus %1 : !cir.fp16
The expected CIRGen should instead be:
%0 = cir.cast float_to_float %x : !cir.f16 -> !cir.float %1 = cir.unary minus %0 : !cir.float %2 = cir.cast float_to_float %1 : !cir.float -> !cir.f16
This PR fixes this issue.
This PR fixes a bug during the CIRGen of fp16 unary operations. Before this patch, for the expression
-x
wherex
is a fp16 value, CIRGen emits the code like the following:The expected CIRGen should instead be:
This PR fixes this issue.