Skip to content
Snippets Groups Projects
Commit 93ce65d5 authored by Virgile Prevosto's avatar Virgile Prevosto
Browse files

[libc] more precise postconditions for atomic gcc builtins

parent 7507c9f0
No related branches found
No related tags found
No related merge requests found
...@@ -263,48 +263,56 @@ int __builtin_popcountll (unsigned long long x); ...@@ -263,48 +263,56 @@ int __builtin_popcountll (unsigned long long x);
/*@ /*@
requires validity: \valid_read(mem); requires validity: \valid_read(mem);
assigns \result \from *mem, indirect:model; assigns \result \from *mem, indirect:model;
ensures load_value: \result == *mem;
*/ */
__UINT8_T __atomic_load_1(__UINT8_T* mem, int model); __UINT8_T __atomic_load_1(__UINT8_T* mem, int model);
/*@ /*@
requires validity: \valid_read(mem); requires validity: \valid_read(mem);
assigns \result \from *mem, indirect: model; assigns \result \from *mem, indirect: model;
ensures load_value: \result == *mem;
*/ */
__UINT16_T __atomic_load_2(__UINT16_T* mem, int model); __UINT16_T __atomic_load_2(__UINT16_T* mem, int model);
/*@ /*@
requires validity: \valid_read(mem); requires validity: \valid_read(mem);
assigns \result \from *mem, indirect:model; assigns \result \from *mem, indirect:model;
ensures load_value: \result == *mem;
*/ */
__UINT32_T __atomic_load_4(__UINT32_T* mem, int model); __UINT32_T __atomic_load_4(__UINT32_T* mem, int model);
/*@ /*@
requires validity: \valid_read(mem); requires validity: \valid_read(mem);
assigns \result \from *mem, indirect:model; assigns \result \from *mem, indirect:model;
ensures load_value: \result == *mem;
*/ */
__UINT64_T __atomic_load_8(__UINT64_T* mem, int model); __UINT64_T __atomic_load_8(__UINT64_T* mem, int model);
/*@ /*@
requires validity: \valid(mem); requires validity: \valid(mem);
assigns *mem \from val, indirect: model; assigns *mem \from val, indirect: model;
ensures store_value: *mem == val;
*/ */
void __atomic_store_1(__UINT8_T* mem, __UINT8_T val, int model); void __atomic_store_1(__UINT8_T* mem, __UINT8_T val, int model);
/*@ /*@
requires validity: \valid(mem); requires validity: \valid(mem);
assigns *mem \from val, indirect: model; assigns *mem \from val, indirect: model;
ensures store_value: *mem == val;
*/ */
void __atomic_store_2(__UINT16_T* mem, __UINT16_T val, int model); void __atomic_store_2(__UINT16_T* mem, __UINT16_T val, int model);
/*@ /*@
requires validity: \valid(mem); requires validity: \valid(mem);
assigns *mem \from val, indirect: model; assigns *mem \from val, indirect: model;
ensures store_value: *mem == val;
*/ */
void __atomic_store_4(__UINT32_T* mem, __UINT32_T val, int model); void __atomic_store_4(__UINT32_T* mem, __UINT32_T val, int model);
/*@ /*@
requires validity: \valid(mem); requires validity: \valid(mem);
assigns *mem \from val, indirect: model; assigns *mem \from val, indirect: model;
ensures store_value: *mem == val;
*/ */
void __atomic_store_8(__UINT64_T* mem, __UINT64_T val, int model); void __atomic_store_8(__UINT64_T* mem, __UINT64_T val, int model);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment