Home » U++ Library support » U++ Core » Writing Bits object to disk
Re: Writing Bits object to disk [message #48096 is a reply to message #48094] |
Tue, 16 May 2017 10:39   |
 |
mirek
Messages: 14257 Registered: November 2005
|
Ultimate Member |
|
|
crydev wrote on Tue, 16 May 2017 09:12Hi Mirek,
How do you feel about adding a Bits::Set function that allows the user to put in packed bools? I was thinking about a function such as the following:
void Bits::VectorSet(int i, const dword bits32)
{
ASSERT(i >= 0 && alloc >= 0);
int q = i >> 5;
if(q >= alloc)
Expand(q);
i &= 31;
// Just place the input DWORD in position q in the Bits data buffer.
bp[q] = bits32;
}
Maybe with some checks, this is just an idea. I mean, this function works in my testcase because I only work with multiples of 32. Even though, this could be used as an assumption to make it fast. It accepts a bitset dword and directly sets it. This allows efficient use of the Bits structure while preparing the actual packed bools structure with SSE2 instructions like _mm_movemask_epi8. 
Thanks!
crydev
I feel good about it, but I definitely think that it should be able to handle boundaries correctly...
I mean, this only works if i % 32 == 0. Should work in all other cases too, with variable number of bits.
[Updated on: Tue, 16 May 2017 10:42] Report message to a moderator
|
|
|
 |
|
Writing Bits object to disk
By: crydev on Wed, 11 January 2017 17:07
|
 |
|
Re: Writing Bits object to disk
By: mr_ped on Thu, 12 January 2017 01:20
|
 |
|
Re: Writing Bits object to disk
By: crydev on Thu, 12 January 2017 09:03
|
 |
|
Re: Writing Bits object to disk
By: mirek on Fri, 13 January 2017 08:39
|
 |
|
Re: Writing Bits object to disk
By: crydev on Wed, 18 January 2017 08:51
|
 |
|
Re: Writing Bits object to disk
By: crydev on Mon, 24 April 2017 19:19
|
 |
|
Re: Writing Bits object to disk
By: mirek on Mon, 24 April 2017 21:08
|
 |
|
Re: Writing Bits object to disk
By: crydev on Tue, 25 April 2017 09:36
|
 |
|
Re: Writing Bits object to disk
|
 |
|
Re: Writing Bits object to disk
By: mirek on Tue, 25 April 2017 10:31
|
 |
|
Re: Writing Bits object to disk
By: mirek on Tue, 25 April 2017 10:34
|
 |
|
Re: Writing Bits object to disk
By: crydev on Tue, 25 April 2017 11:37
|
 |
|
Re: Writing Bits object to disk
By: mirek on Tue, 25 April 2017 11:59
|
 |
|
Re: Writing Bits object to disk
By: mirek on Tue, 25 April 2017 12:38
|
 |
|
Re: Writing Bits object to disk
By: crydev on Tue, 25 April 2017 13:35
|
 |
|
Re: Writing Bits object to disk
By: mirek on Tue, 25 April 2017 13:39
|
 |
|
Re: Writing Bits object to disk
By: crydev on Tue, 25 April 2017 14:03
|
 |
|
Re: Writing Bits object to disk
By: mirek on Tue, 25 April 2017 16:40
|
 |
|
Re: Writing Bits object to disk
By: crydev on Wed, 26 April 2017 08:27
|
 |
|
Re: Writing Bits object to disk
By: crydev on Wed, 26 April 2017 08:50
|
 |
|
Re: Writing Bits object to disk
By: mirek on Wed, 26 April 2017 13:38
|
 |
|
Re: Writing Bits object to disk
By: crydev on Thu, 27 April 2017 10:31
|
 |
|
Re: Writing Bits object to disk
By: mirek on Thu, 27 April 2017 23:50
|
 |
|
Re: Writing Bits object to disk
By: crydev on Fri, 28 April 2017 19:04
|
 |
|
Re: Writing Bits object to disk
By: mirek on Sat, 29 April 2017 09:05
|
 |
|
Re: Writing Bits object to disk
By: omari on Fri, 28 April 2017 19:31
|
 |
|
Re: Writing Bits object to disk
By: mirek on Sat, 29 April 2017 09:53
|
 |
|
Re: Writing Bits object to disk
By: crydev on Tue, 02 May 2017 22:54
|
 |
|
Re: Writing Bits object to disk
By: mirek on Tue, 02 May 2017 23:55
|
 |
|
Re: Writing Bits object to disk
By: crydev on Wed, 03 May 2017 09:00
|
 |
|
Re: Writing Bits object to disk
By: mirek on Wed, 03 May 2017 09:53
|
 |
|
Re: Writing Bits object to disk
By: crydev on Wed, 03 May 2017 11:12
|
 |
|
Re: Writing Bits object to disk
By: mirek on Wed, 03 May 2017 11:27
|
 |
|
Re: Writing Bits object to disk
By: crydev on Wed, 03 May 2017 12:24
|
 |
|
Re: Writing Bits object to disk
By: mirek on Wed, 03 May 2017 12:37
|
 |
|
Re: Writing Bits object to disk
By: crydev on Wed, 03 May 2017 18:33
|
 |
|
Re: Writing Bits object to disk
By: crydev on Sat, 06 May 2017 10:28
|
 |
|
Re: Writing Bits object to disk
By: crydev on Tue, 16 May 2017 09:12
|
 |
|
Re: Writing Bits object to disk
By: mirek on Tue, 16 May 2017 10:39
|
 |
|
Re: Writing Bits object to disk
By: mirek on Tue, 16 May 2017 13:12
|
 |
|
Re: Writing Bits object to disk
By: crydev on Tue, 16 May 2017 20:17
|
Goto Forum:
Current Time: Sat May 10 07:12:59 CEST 2025
Total time taken to generate the page: 0.01115 seconds
|