[libclc] libclc: Update remquo (PR #187998)

Wenju He via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 23 02:45:52 PDT 2026


================
@@ -6,266 +6,173 @@
 //
 //===----------------------------------------------------------------------===//
 
-_CLC_DEF _CLC_OVERLOAD float __clc_remquo(float x, float y,
-                                          __CLC_ADDRESS_SPACE int *quo) {
-  x = __clc_flush_if_daz(x);
-  y = __clc_flush_if_daz(y);
-  int ux = __clc_as_int(x);
-  int ax = ux & EXSIGNBIT_SP32;
-  float xa = __clc_as_float(ax);
-  int sx = ux ^ ax;
-  int ex = ax >> EXPSHIFTBITS_SP32;
-
-  int uy = __clc_as_int(y);
-  int ay = uy & EXSIGNBIT_SP32;
-  float ya = __clc_as_float(ay);
-  int sy = uy ^ ay;
-  int ey = ay >> EXPSHIFTBITS_SP32;
-
-  float xr = __clc_as_float(0x3f800000 | (ax & 0x007fffff));
-  float yr = __clc_as_float(0x3f800000 | (ay & 0x007fffff));
-  int c;
-  int k = ex - ey;
-
-  uint q = 0;
-
-  while (k > 0) {
-    c = xr >= yr;
-    q = (q << 1) | c;
-    xr -= c ? yr : 0.0f;
-    xr += xr;
-    --k;
-  }
+#ifdef __CLC_SCALAR
+
+#if __CLC_FPSIZE == 32
+#define __CLC_REMQUO_EVAL_TYPE __CLC_FLOATN
----------------
wenju-he wrote:

__CLC_REMQUO_EVAL_TYPE is the same as __CLC_GENTYPE?

https://github.com/llvm/llvm-project/pull/187998


More information about the cfe-commits mailing list