File: fast_signed.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 (30 lines) | stat: -rw-r--r-- 807 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
default Order dec

$include <prelude.sail>

function main((): unit) -> unit = {
  let x = signed(0xFF);
  let y = signed(0xFFFF);
  let z = signed(0xFFFFFFFF_FFFFFFFF);
  let w = signed(0xFFFFFFFF_FFFFFFFF_FFFFFFFF_FFFFFFFF);
  print_int("x = ", x);
  print_int("y = ", y);
  print_int("z = ", z);
  print_int("w = ", w);
  let x = signed(0x80);
  let y = signed(0x8000);
  let z = signed(0x80000000_00000000);
  let w = signed(0x80000000_00000000_00000000_00000000);
  print_int("x = ", x);
  print_int("y = ", y);
  print_int("z = ", z);
  print_int("w = ", w);
  let x = signed(0x7F);
  let y = signed(0x7FFF);
  let z = signed(0x7FFFFFFF_FFFFFFFF);
  let w = signed(0x7FFFFFFF_FFFFFFFF_FFFFFFFF_FFFFFFFF);
  print_int("x = ", x);
  print_int("y = ", y);
  print_int("z = ", z);
  print_int("w = ", w);
}