diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2017-04-02 11:09:47 +0200 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-01-08 14:04:43 +0100 |
| commit | 030473b77d72bd6edcf9fb37e1fe8c12f96deab7 (patch) | |
| tree | be8cafa3e8305465959db2241244774586bc3632 /validation/optim | |
| parent | 1277d44553d34510a333632add6e75c759bd6dbd (diff) | |
| download | sparse-dev-030473b77d72bd6edcf9fb37e1fe8c12f96deab7.tar.gz | |
add OP_SETFVAL
OP_SETVAL is used to create floating-point and string
as well as labels-as-values. This multi-purpose aspect
sometimes make things a bit more complicated.
Change this by using a new instruction for the direct
creation of floating-point literals without needing
to have an intermediate EXPR_FVALUE.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation/optim')
| -rw-r--r-- | validation/optim/bool-context-fp.c | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/validation/optim/bool-context-fp.c b/validation/optim/bool-context-fp.c new file mode 100644 index 00000000..ad075c56 --- /dev/null +++ b/validation/optim/bool-context-fp.c @@ -0,0 +1,47 @@ +#define bool _Bool + +bool bfimp(float a) { return a; } +bool bfexp(float a) { return (bool)a; } + +bool bfnot(float a) { return !a; } +int ifnot(float a) { return !a; } + +/* + * check-name: bool context fp + * check-command: test-linearize -Wno-decl $file + * + * check-output-start +bfimp: +.L0: + <entry-point> + setfval.32 %r2 <- 0.000000 + fcmpune.1 %r3 <- %arg1, %r2 + ret.1 %r3 + + +bfexp: +.L2: + <entry-point> + setfval.32 %r6 <- 0.000000 + fcmpune.1 %r7 <- %arg1, %r6 + ret.1 %r7 + + +bfnot: +.L4: + <entry-point> + setfval.32 %r10 <- 0.000000 + fcmpoeq.1 %r12 <- %arg1, %r10 + ret.1 %r12 + + +ifnot: +.L6: + <entry-point> + setfval.32 %r15 <- 0.000000 + fcmpoeq.32 %r16 <- %arg1, %r15 + ret.32 %r16 + + + * check-output-end + */ |
