File: 19_remove_unneeded_round_to_integer_helpers.patch

package info (click to toggle)
firefox 147.0.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 4,683,320 kB
  • sloc: cpp: 7,607,359; javascript: 6,533,295; ansic: 3,775,223; python: 1,415,500; xml: 634,561; asm: 438,949; java: 186,241; sh: 62,752; makefile: 18,079; objc: 13,092; perl: 12,808; yacc: 4,583; cs: 3,846; pascal: 3,448; lex: 1,720; ruby: 1,003; php: 436; lisp: 258; awk: 247; sql: 66; sed: 54; csh: 10; exp: 6
file content (50 lines) | stat: -rw-r--r-- 1,807 bytes parent folder | download | duplicates (20)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
diff --git a/math_private.h b/math_private.h
--- a/math_private.h
+++ b/math_private.h
@@ -612,46 +612,16 @@ rnint(__double_t x)
 	 * magic number would need to be variable.  Assuming that the
 	 * rounding precision is always the default is too fragile.  This
 	 * and many other complications will move when the default is
 	 * changed to FP_PE.
 	 */
 	return ((double)(x + 0x1.8p52) - 0x1.8p52);
 }
 
-static inline float
-rnintf(__float_t x)
-{
-	/*
-	 * As for rnint(), except we could just call that to handle the
-	 * extra precision case, usually without losing efficiency.
-	 */
-	return ((float)(x + 0x1.8p23F) - 0x1.8p23F);
-}
-
-#ifdef LDBL_MANT_DIG
-/*
- * The complications for extra precision are smaller for rnintl() since it
- * can safely assume that the rounding precision has been increased from
- * its default to FP_PE on x86.  We don't exploit that here to get small
- * optimizations from limiting the rangle to double.  We just need it for
- * the magic number to work with long doubles.  ld128 callers should use
- * rnint() instead of this if possible.  ld80 callers should prefer
- * rnintl() since for amd64 this avoids swapping the register set, while
- * for i386 it makes no difference (assuming FP_PE), and for other arches
- * it makes little difference.
- */
-static inline long double
-rnintl(long double x)
-{
-	return (x + __CONCAT(0x1.8p, LDBL_MANT_DIG) / 2 -
-	    __CONCAT(0x1.8p, LDBL_MANT_DIG) / 2);
-}
-#endif /* LDBL_MANT_DIG */
-
 /*
  * irint() and i64rint() give the same result as casting to their integer
  * return type provided their arg is a floating point integer.  They can
  * sometimes be more efficient because no rounding is required.
  */
 #if defined(amd64) || defined(__i386__)
 #define	irint(x)						\
     (sizeof(x) == sizeof(float) &&				\