This patch extends the Math-to-EmitC conversion to cover `math.roundeven` and `math.sqrt` for scalar f32/f64 values. `math.roundeven` and `math.sqrt` are lowered to `emitc.call_opaque` using the appropriate target-specific names: C: `roundevenf` / `roundeven`, `sqrtf` / `sqrt` C++: `std::roundeven`, `std::sqrt` The patch also adds coverage for `math.rsqrt`. There is no direct EmitC lowering for `math.rsqrt`; instead, the new tests verify the existing expansion path through `-math-expand-ops=ops=rsqrt`, followed by `-convert-math-to-emitc` and `-convert-arith-to-emitc`. This ensures the cross-dialect lowering sequence produces the expected `emitc.constant`, `emitc.call_opaque`, and `emitc.div` operations for f32/f64. Unsupported cases remain unchanged. In particular, the new test documents that f16 math.rsqrt is not lowered because math.sqrt is only converted for f32/f64.
4.2 KiB
4.2 KiB