[Mlir-commits] [mlir] [MLIR][NVVM] Add nvvm.fadd and nvvm.fsub Ops (PR #179162)
Srinivasa Ravi
llvmlistbot at llvm.org
Tue Feb 3 04:25:07 PST 2026
================
@@ -0,0 +1,107 @@
+// RUN: mlir-translate --mlir-to-llvmir --split-input-file --verify-diagnostics %s
+
+// -----
+
+llvm.func @fadd_invalid_sat_mode(%a : f16, %b : f16) -> f32 {
+ // expected-error at +1 {{SATFINITE saturation mode is not supported for floating point addition operation}}
+ %f1 = nvvm.fadd %a, %b {sat = #nvvm.sat_mode<satfinite>} : f16, f16 -> f32
+ llvm.return %f1 : f32
+}
+
+// -----
+
+llvm.func @fadd_invalid_vector_scalar_mix(%a : vector<2xf16>, %b : f16) -> f32 {
+ // expected-error at +1 {{cannot mix vector and scalar types for floating point addition operation}}
+ %f1 = nvvm.fadd %a, %b : vector<2xf16>, f16 -> f32
+ llvm.return %f1 : f32
+}
+
+// -----
+
+llvm.func @fadd_invalid_vector_element_types_mix(%a : vector<2xf16>, %b : vector<2xbf16>) -> vector<2xbf16> {
+ // expected-error at +1 {{cannot mix different element types for vector floating point addition operation}}
----------------
Wolfram70 wrote:
Added vector support in the latest revision, so currently we do this by performing two additions. We can update it to use one intrinsic (instruction) instead when that is added.
https://github.com/llvm/llvm-project/pull/179162
More information about the Mlir-commits
mailing list