NO

Recent Posts

Pages: 1 [2] 3 4 ... 10
11
Windows questions / Re: Computing number of Pages to alloc usin VirtualAlloc
« Last post by HellOfMice on November 17, 2024, 09:49:23 AM »
Hello Timo.

What I use is your formula, the other one was just for the fun.
Here is a link that could interest you https://github.com/WojciechMula/toys
Now my program works well for its first part but I would like to improve avg, mean and stddev so I am searching SSE instruction to speed it up.

Thank you for your message.

Philippe
12
Windows questions / Re: Computing number of Pages to alloc usin VirtualAlloc
« Last post by HellOfMice on November 17, 2024, 09:47:46 AM »
Hello Timo.


What I use is your formula, the other one was just for the fun.


Here is a link that could interest you [size=78%]https://github.com/WojciechMula/toys[/size]


Now my program works well for its first part but I would like to improve avg, mean and stddev so I am searching SSE instruction to speed it up.


Thank you for your message.


Philippe
13
Windows questions / Re: MessageBow never disappears
« Last post by HellOfMice on November 17, 2024, 09:44:17 AM »
Thank you Marco,


My short story
-First, I created windows simulting modless dialogboxes, too long to create all the controls. So I stopped
-Second, I created a main window with modless dialogboxes. too many problems, I stopped too
-Third, I created a main dialog box with modless dialog boxes but I forgot to remove to DefWindowProc in the main dialogbox!
So I could not click on buttons or the window into where they were not disappear. Example an error box.
Now all that seems ok. Many bugs are to find again.
I am working on program speed. I treat 35 000 images images in 2 hours and 30 minutes.
I tested the program on 66 000 files and it works well too
I am searching the SSE...SSE4 to compute average, mean and stddev.
Even if i know the assembler I don't know these instructions.
I translate them but the result often is bad or often is fun but nothing to see with the instructions to translate!


I thank you for the interest you have for that post.


Philippe
14
Windows questions / Re: Computing number of Pages to alloc usin VirtualAlloc
« Last post by TimoVJL on November 17, 2024, 09:44:04 AM »
I like to be an original
unique  ;)
just to avoid imul from code, but your example confuse normal coder, as in code speed actually wasn't real reason ?
Code: [Select]
unsigned long dwSize2 = ((dwSize + 4095) / 4096) * 4096;
15
Windows questions / Re: MessageBow never disappears
« Last post by Marco on November 17, 2024, 09:32:52 AM »
Ciao Philippe,

Here is a possible cause of the problem

https://stackoverflow.com/questions/29359365/i-have-a-messagebox-in-my-visual-c-win32-that-cannot-be-closed-what-is-going

To make a long story short, a mix of window procedure and dialog procedure is preventing the window dialog box from closing. I don't know if this will work for you, but it was worth a try.

Marco
16
Windows questions / Re: Computing number of Pages to alloc usin VirtualAlloc
« Last post by HellOfMice on November 16, 2024, 10:51:47 AM »
I like to be an original
17
Windows questions / Re: Computing number of Pages to alloc usin VirtualAlloc
« Last post by John Z on November 16, 2024, 10:49:23 AM »
you add another page if the user wants to alloc 4096 byte you give him 8192 bytes
Change with dwSize + 4095

dwSize = ((((dwSize + 4095)*10000) >> 12) << 12)/10000 ; // = 7551
oops you are right


V1 = (dwSize + 4095)  ;
V2 = V1 << 10 ;
V3 = V1 << 4 ;
V4 = V1 << 3 ;
V5 = V3 + V4 ;
V6 = V2 - V5 ; ==> (V1 * 1024) - (V1 * 24)

dwSize  = ((V6 >> 12) << 12) / 1000 ;[/size][/font]

or

dwSize = (((V1 << 10) - (V1 << 4) - (V1 << 3)) >> 12) << 12) / 1000 ;


Very innovative!

John Z
18
Windows questions / Re: Computing number of Pages to alloc usin VirtualAlloc
« Last post by HellOfMice on November 15, 2024, 12:59:56 PM »
Ok John but it is slow that is the reason I use shifts
With
Quote
dwSize = ((((dwSize + 4096)*10000) >> 12) << 12)/10000 ; // = 7551but if need *10000 and then /1000 one might as well use float... unlessno float lib available

you add another page if the user wants to alloc 4096 byte you give him 8192 bytes
Change with dwSize + 4095

dwSize = ((((dwSize + 4095)*10000) >> 12) << 12)/10000 ; // = 7551

V1 = (dwSize + 4095)  ;
V2 = V1 << 10 ;
V3 = V1 << 4 ;
V4 = V1 << 3 ;
V5 = V3 + V4 ;
V6 = V2 - V5 ; ==> (V1 * 1024) - (V1 * 24)

dwSize  = ((V6 >> 12) << 12) / 1000 ;


or

dwSize = (((V1 << 10) - (V1 << 4) - (V1 << 3)) >> 12) << 12) / 1000 ;

:P
 
19
Windows questions / Re: Computing number of Pages to alloc usin VirtualAlloc
« Last post by John Z on November 15, 2024, 12:53:57 PM »
Hi,

Integer math != 'real' math except in limited circumstances
Integer math
dwSize = ((dwSize + 4095) >> 12) << 12 ;

can't be equivalent to the look alike 'real' math

'Real' math
fSize = ((fSize + 4095.0) / 4096) *4096;

To get close you need to preserve at least a few of the decimals from >>12

so
dwSize = ((((dwSize + 4096)*10000) >> 12) << 12)/10000 ; // = 7551
but if need *10000 and then /10000 one might as well use float... unless
no float lib available.

John Z
20
Windows questions / Re: Computing number of Pages to alloc usin VirtualAlloc
« Last post by HellOfMice on November 14, 2024, 03:27:33 PM »
Thank you Timo. I was afraid.



Pages: 1 [2] 3 4 ... 10