Skip to content

Commit aa95f89

Browse files
committed
Revert "Added semantics for fmin/fmax for RISC-V"
This reverts commit c7daf17. This is not the actual behavior of the fmin/fmax RISC-V instructions. (-0.0 is to be treated as less than +0.0.)
1 parent 5080933 commit aa95f89

File tree

1 file changed

+4
-36
lines changed

1 file changed

+4
-36
lines changed

riscV/Builtins1.v

+4-36
Original file line numberDiff line numberDiff line change
@@ -19,47 +19,15 @@ Require Import String Coqlib.
1919
Require Import AST Integers Floats Values.
2020
Require Import Builtins0.
2121

22-
Inductive platform_builtin : Type :=
23-
| BI_fmin
24-
| BI_fmax.
22+
Inductive platform_builtin : Type := .
2523

2624
Local Open Scope string_scope.
2725

2826
Definition platform_builtin_table : list (string * platform_builtin) :=
29-
("__builtin_fmin", BI_fmin)
30-
:: ("__builtin_fmax", BI_fmax)
31-
:: nil.
27+
nil.
3228

3329
Definition platform_builtin_sig (b: platform_builtin) : signature :=
34-
match b with
35-
| BI_fmin | BI_fmax =>
36-
mksignature (Tfloat :: Tfloat :: nil) Tfloat cc_default
37-
end.
38-
39-
(* Canonical NaN as defined in the RISC-V ISA, all expontent bits one, sign bit
40-
zero and quiet bit one. *)
41-
Definition canonical_nan := Float.of_bits (Int64.repr 9221120237041090560).
42-
43-
(* NaN handling as described for fmin/fmax by the RISC-V Isa. If one of the
44-
parameters is NaN, the other one is returned. Otherwise the canonical NaN
45-
value is returned. *)
46-
Definition nan_handling (f1 f2: float) : float :=
47-
if negb (Binary.is_nan _ _ f1) then f1
48-
else if negb (Binary.is_nan _ _ f2) then f2
49-
else canonical_nan.
30+
match b with end.
5031

5132
Definition platform_builtin_sem (b: platform_builtin) : builtin_sem (sig_res (platform_builtin_sig b)) :=
52-
match b with
53-
| BI_fmin =>
54-
mkbuiltin_n2t Tfloat Tfloat Tfloat
55-
(fun f1 f2 => match Float.compare f1 f2 with
56-
| Some Eq | Some Lt => f1
57-
| Some Gt | None => nan_handling f1 f2
58-
end)
59-
| BI_fmax =>
60-
mkbuiltin_n2t Tfloat Tfloat Tfloat
61-
(fun f1 f2 => match Float.compare f1 f2 with
62-
| Some Eq | Some Gt => f1
63-
| Some Lt | None => nan_handling f1 f2
64-
end)
65-
end.
33+
match b with end.

0 commit comments

Comments
 (0)