[clang] [CIR] Add cir.signbit to tablegen (PR #184091)

Yeongu Choe via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 5 06:01:02 PST 2026


https://github.com/YeonguChoe updated https://github.com/llvm/llvm-project/pull/184091

>From cd8c9d4cf9493a312aba47d30a07cfda5f2abc07 Mon Sep 17 00:00:00 2001
From: Yeongu Choe <yeongu.choe at icloud.com>
Date: Mon, 2 Mar 2026 05:17:33 -0500
Subject: [PATCH] Update CIROps.td

---
 clang/include/clang/CIR/Dialect/IR/CIROps.td | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/clang/include/clang/CIR/Dialect/IR/CIROps.td b/clang/include/clang/CIR/Dialect/IR/CIROps.td
index a5a5197cd3ea6..ae32bc995a043 100644
--- a/clang/include/clang/CIR/Dialect/IR/CIROps.td
+++ b/clang/include/clang/CIR/Dialect/IR/CIROps.td
@@ -5847,6 +5847,16 @@ def CIR_AbsOp : CIR_Op<"abs", [Pure, SameOperandsAndResultType]> {
   let assemblyFormat = "$src ( `min_is_poison` $min_is_poison^ )? `:` type($src) attr-dict";
 }
 
+def CIR_SignBitOp : CIR_Op<"signbit", [Pure, AlwaysSpeculatableImplTrait]> {
+  let summary = "Return true if operand is negative. Otherwise, return false.";
+  let description = [{
+    `cir.signbit` checks the sign of a floating-point number.
+  }];
+  let arguments = (ins CIR_FloatType:$input);
+  let results = (outs CIR_BoolType:$res);
+  let assemblyFormat = "$input attr-dict `:` type($input) `->` type($res)";
+}
+
 def CIR_FloorOp : CIR_UnaryFPToFPBuiltinOp<"floor", "FloorOp"> {
   let summary = "Computes the floating-point floor value";
   let description = [{



More information about the cfe-commits mailing list