CBMC
x86_assembler.c
Go to the documentation of this file.
1 
2 /* FUNCTION: __asm_fnstcw */
3 
4 extern int __CPROVER_rounding_mode;
5 
6 void __asm_fnstcw(void *dest)
7 {
8  // the rounding mode is bits 10 and 11 in the control word
9  *(unsigned short *)dest = __CPROVER_rounding_mode << 10;
10 }
11 
12 /* FUNCTION: __asm_fstcw */
13 
15 
16 void __asm_fstcw(void *dest)
17 {
18  // the rounding mode is bits 10 and 11 in the control word
19  *(unsigned short *)dest = __CPROVER_rounding_mode << 10;
20 }
21 
22 /* FUNCTION: __asm_fldcw */
23 
24 extern int __CPROVER_rounding_mode;
25 
26 void __asm_fldcw(void *src)
27 {
28  // the rounding mode is bits 10 and 11 in the control word
29  __CPROVER_rounding_mode = ((*(const unsigned short *)src) >> 10) & 3;
30 }
31 
32 /* FUNCTION: __asm_mfence */
33 
34 void __asm_mfence(void)
35 {
36  __CPROVER_fence("WWfence", "RRfence", "RWfence", "WRfence");
37 }
38 
39 /* FUNCTION: __asm_sfence */
40 
41 void __asm_sfence(void)
42 {
43  __CPROVER_fence("WWfence", "RRfence", "RWfence", "WRfence");
44 }
45 
46 /* FUNCTION: __asm_lfence */
47 
48 void __asm_lfence(void)
49 {
50  __CPROVER_fence("WWfence", "RRfence", "RWfence", "WRfence");
51 }
void __CPROVER_fence(const char *kind,...)
void __asm_fldcw(void *src)
Definition: x86_assembler.c:26
void __asm_fnstcw(void *dest)
Definition: x86_assembler.c:6
void __asm_mfence(void)
Definition: x86_assembler.c:34
void __asm_lfence(void)
Definition: x86_assembler.c:48
int __CPROVER_rounding_mode
Definition: x86_assembler.c:14
void __asm_sfence(void)
Definition: x86_assembler.c:41
void __asm_fstcw(void *dest)
Definition: x86_assembler.c:16