@@ -19,47 +19,15 @@ Require Import String Coqlib.
1919Require Import AST Integers Floats Values.
2020Require Import Builtins0.
2121
22- Inductive platform_builtin : Type :=
23- | BI_fmin
24- | BI_fmax.
22+ Inductive platform_builtin : Type := .
2523
2624Local Open Scope string_scope.
2725
2826Definition platform_builtin_table : list (string * platform_builtin) :=
29- ("__builtin_fmin", BI_fmin)
30- :: ("__builtin_fmax", BI_fmax)
31- :: nil.
27+ nil.
3228
3329Definition 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
5132Definition 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