diff options
author | johnvg | 2004-04-06 14:07:08 +0000 |
---|---|---|
committer | johnvg | 2004-04-06 14:07:08 +0000 |
commit | f6d4f5b3e5a8ca73ea7ff826534245e47af00779 (patch) | |
tree | 906ecc66d7fccd6d9d000887e371d3eafd49f782 /frontend/containers.icl | |
parent | implement foreign export with stdcall (diff) |
fix possible compiler crash if a type synonym has a . on the rhs (added case
for TA_RootVar in substitute), prevent exponential use of time in function
build_inequalities
git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@1484 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d
Diffstat (limited to 'frontend/containers.icl')
-rw-r--r-- | frontend/containers.icl | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/frontend/containers.icl b/frontend/containers.icl index eaaa08c..4d0282b 100644 --- a/frontend/containers.icl +++ b/frontend/containers.icl @@ -135,6 +135,14 @@ bitvectSelect :: !Int !LargeBitvect -> Bool bitvectSelect index a = a.[BITINDEX index] bitand (1 << BITNUMBER index) <> 0 +bitvectTestAndSet :: !Int !*LargeBitvect -> (!Bool,!.LargeBitvect) +bitvectTestAndSet index a + # bit_index = BITINDEX index + #! a_bit_index = a.[bit_index] + # mask = 1 << BITNUMBER index + # new_a_bit_index = a_bit_index bitor mask + = (new_a_bit_index==a_bit_index,{ a & [bit_index] = new_a_bit_index}) + bitvectSet :: !Int !*LargeBitvect -> .LargeBitvect bitvectSet index a #! bit_index = BITINDEX index @@ -161,8 +169,7 @@ bitvectSetFirstN n_bits a bitvectResetAll :: !*LargeBitvect -> .LargeBitvect bitvectResetAll arr - #! size - = size arr + #! size = size arr = { arr & [i] = 0 \\ i<-[0..size-1] } // list should be optimized away bitvectOr :: !u:LargeBitvect !*LargeBitvect -> (!Bool, !u:LargeBitvect, !*LargeBitvect) |