coq-vsu-int63
int63.h
Go to the documentation of this file.
1 /*! @mainpage
2  *
3  * @section sec_intro Introduction
4  *
5  * A <a href="https://github.com/appliedfm/coq-vsu">Verified Software Unit</a> for 63-bit integer arithmetic.
6  *
7  * Implemented in C, modeled in <a href="https://coq.inria.fr">Coq</a>, and proven correct using the
8  * <a href="https://vst.cs.princeton.edu/">Verified Software Toolchain</a>.
9  *
10  * Compatible with <a href="https://compcert.org/">CompCert</a>.
11  *
12  * @section sec_using Using the C library
13  *
14  * To use the library, simply include the header file:
15  * @code
16  * #include <coq-vsu-int63/int63.h>
17  * @endcode
18  *
19  * Alternatively, you can include the entire implementation:
20  * @code
21  * #include <coq-vsu-int63/src/int63.c>
22  * @endcode
23  *
24  * The library is installed to the location given by `vsu -I`. You can bring this location into your compiler's search path by passing ``-I`vsu -I``` to your compiler at build time.
25  *
26  * An API reference is provided in int63.h.
27  *
28  */
29 #ifndef COQ_VSU_INT63__INT63_H
30 #define COQ_VSU_INT63__INT63_H
31 
32 #include <stdint.h>
33 
34 typedef int64_t int63_t; ///< An encoded 63-bit integer.
35 
36 /** @brief Encode an integer.
37  *
38  * @param x The integer to encode.
39  * @return The encoded integer.
40  */
41 int63_t encode_int63(int64_t x);
42 
43 /** @brief Decode an integer.
44  *
45  * @param x The integer to decode.
46  * @return The decoded integer.
47  */
48 int64_t decode_int63(int63_t x);
49 
65 
66 #endif /* COQ_VSU_INT63__INT63_H */
decode_int63
int64_t decode_int63(int63_t x)
Decode an integer.
Definition: int63.c:12
int63_div
int63_t int63_div(int63_t x, int63_t y)
Definition: int63.c:56
int63_neg
int63_t int63_neg(int63_t x)
Definition: int63.c:28
int63_sub
int63_t int63_sub(int63_t x, int63_t y)
Definition: int63.c:43
int63_add
int63_t int63_add(int63_t x, int63_t y)
Definition: int63.c:38
int63_one
int63_t int63_one()
Definition: int63.c:23
int63_zero
int63_t int63_zero()
Definition: int63.c:18
encode_int63
int63_t encode_int63(int64_t x)
Encode an integer.
Definition: int63.c:7
int63_xor
int63_t int63_xor(int63_t x, int63_t y)
Definition: int63.c:98
int63_shiftr
int63_t int63_shiftr(int63_t x, int63_t y)
Definition: int63.c:80
int63_rem
int63_t int63_rem(int63_t x, int63_t y)
Definition: int63.c:64
int63_abs
int63_t int63_abs(int63_t x)
Definition: int63.c:33
int63_not
int63_t int63_not(int63_t x)
Definition: int63.c:103
int63_shiftl
int63_t int63_shiftl(int63_t x, int63_t y)
Definition: int63.c:72
int63_or
int63_t int63_or(int63_t x, int63_t y)
Definition: int63.c:88
int63_and
int63_t int63_and(int63_t x, int63_t y)
Definition: int63.c:93
int63_mul
int63_t int63_mul(int63_t x, int63_t y)
Definition: int63.c:48
int63_t
int64_t int63_t
An encoded 63-bit integer.
Definition: int63.h:34