aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/optim
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-06-24 21:44:09 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-07-24 15:03:18 +0200
commit0e733d7e130cfb6a9ef174b1aea3760a8ce670e4 (patch)
tree0f97d9ce88db85007b5d16753a4d3ab644b9c7ac /validation/optim
parent8ed2cd6530fdd9858f32aae31e5a34cf9b6bb6a8 (diff)
downloadsparse-dev-0e733d7e130cfb6a9ef174b1aea3760a8ce670e4.tar.gz
use "%Le" to display floats
Floating-point values are displayed using the printf format "%Lf" but this is the format without exponent (and with default precision of 6 digit). However, by its nature, this format is very imprecise. For example, *all* values smaller than 0.5e-6 are displayed as "0.000000". Improve this by using the "%Le" format which always use an exponent and thus maximize the precision. Note: ultimately, we should display them exactly, for example by using "%La", but this will requires C99. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation/optim')
-rw-r--r--validation/optim/bool-context-fp.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/validation/optim/bool-context-fp.c b/validation/optim/bool-context-fp.c
index 50e96825..3bfc3343 100644
--- a/validation/optim/bool-context-fp.c
+++ b/validation/optim/bool-context-fp.c
@@ -18,7 +18,7 @@ int ifand(float a, float b) { return a && b; }
bfimp:
.L0:
<entry-point>
- setfval.32 %r2 <- 0.000000
+ setfval.32 %r2 <- 0.000000e+00
fcmpune.1 %r3 <- %arg1, %r2
ret.1 %r3
@@ -26,7 +26,7 @@ bfimp:
bfexp:
.L2:
<entry-point>
- setfval.32 %r6 <- 0.000000
+ setfval.32 %r6 <- 0.000000e+00
fcmpune.1 %r7 <- %arg1, %r6
ret.1 %r7
@@ -34,7 +34,7 @@ bfexp:
bfnot:
.L4:
<entry-point>
- setfval.32 %r10 <- 0.000000
+ setfval.32 %r10 <- 0.000000e+00
fcmpoeq.1 %r12 <- %arg1, %r10
ret.1 %r12
@@ -42,7 +42,7 @@ bfnot:
ifnot:
.L6:
<entry-point>
- setfval.32 %r15 <- 0.000000
+ setfval.32 %r15 <- 0.000000e+00
fcmpoeq.32 %r16 <- %arg1, %r15
ret.32 %r16
@@ -50,7 +50,7 @@ ifnot:
bfior:
.L8:
<entry-point>
- setfval.32 %r19 <- 0.000000
+ setfval.32 %r19 <- 0.000000e+00
fcmpune.1 %r20 <- %arg1, %r19
fcmpune.1 %r23 <- %arg2, %r19
or.1 %r24 <- %r20, %r23
@@ -61,7 +61,7 @@ bfior:
ifior:
.L10:
<entry-point>
- setfval.32 %r29 <- 0.000000
+ setfval.32 %r29 <- 0.000000e+00
fcmpune.1 %r30 <- %arg1, %r29
fcmpune.1 %r33 <- %arg2, %r29
or.1 %r34 <- %r30, %r33
@@ -72,7 +72,7 @@ ifior:
bfand:
.L12:
<entry-point>
- setfval.32 %r38 <- 0.000000
+ setfval.32 %r38 <- 0.000000e+00
fcmpune.1 %r39 <- %arg1, %r38
fcmpune.1 %r42 <- %arg2, %r38
and.1 %r43 <- %r39, %r42
@@ -83,7 +83,7 @@ bfand:
ifand:
.L14:
<entry-point>
- setfval.32 %r48 <- 0.000000
+ setfval.32 %r48 <- 0.000000e+00
fcmpune.1 %r49 <- %arg1, %r48
fcmpune.1 %r52 <- %arg2, %r48
and.1 %r53 <- %r49, %r52