File: tuple_equality.sail

package info (click to toggle)
sail-ocaml 0.19.1%2Bdfsg5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 18,008 kB
  • sloc: ml: 75,941; ansic: 8,848; python: 1,342; exp: 560; sh: 474; makefile: 218; cpp: 36
file content (33 lines) | stat: -rw-r--r-- 1,351 bytes parent folder | download
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
/*==========================================================================*/
/*     Sail                                                                 */
/*                                                                          */
/* Copyright 2024 Intel Corporation                                         */
/*   Pan Li - pan2.li@intel.com                                             */
/*                                                                          */
/*  SPDX-License-Identifier: BSD-2-Clause                                   */
/*==========================================================================*/

$ifndef _FLOAT_TUPLE_EQUALITY
$define _FLOAT_TUPLE_EQUALITY

$include <float/common.sail>

/* Floating point related tuple implementations for test */
val      bool_and_flags_eq : (fp_bool_and_flags, fp_bool_and_flags) -> bool
function bool_and_flags_eq ((bool_0, flags_0), (bool_1, flags_1)) = {
  let is_eq = (bool_0 == bool_1) & (flags_0 == flags_1);

  is_eq;
}

val      fp_bits_and_flags_eq : forall 'n, 'n in { 16, 32, 64, 128 }.
  ((bits('n), fp_exception_flags), (bits('n), fp_exception_flags)) -> bool
function fp_bits_and_flags_eq ((fp_0, flags_0), (fp_1, flags_1)) = {
  let is_eq = fp_0 == fp_1 & (flags_0 == flags_1);

  is_eq;
}

overload operator == = {bool_and_flags_eq, fp_bits_and_flags_eq}

$endif