Search found 3647 matches

by wilbert
Mon Feb 19, 2024 4:23 pm
Forum: Feature Requests and Wishlists
Topic: FormatNumber should respect the locale settings, and what about FormatCurrency?
Replies: 6
Views: 294

Re: FormatNumber should respect the locale settings, and what about FormatCurrency?

Why should I create my own mapping from country/language to decimal point and thousand separator if it already exists within the operating system? I'm not saying you should and I'm not against local support but your request was to change the behavior of the current FormatNumber procedure to use the...
by wilbert
Mon Feb 19, 2024 2:36 pm
Forum: Feature Requests and Wishlists
Topic: FormatNumber should respect the locale settings, and what about FormatCurrency?
Replies: 6
Views: 294

Re: FormatNumber should respect the locale settings, and what about FormatCurrency?

The function `FormatNumber` uses static default values for the 1000s separator and the decimal point. Instead it would make way more sense to respect the locale settings. FormatNumber does allow you to specify what to use FormatNumber(Number.d [, NbDecimals [, DecimalPoint$ [, ThousandSeparator$]]]...
by wilbert
Wed Feb 14, 2024 7:23 am
Forum: Tricks 'n' Tips
Topic: ASM and C-backend bswap16/32/64
Replies: 13
Views: 3069

Re: ASM and C-backend bswap16/32/64

idle wrote: Wed Feb 14, 2024 1:38 am changed asm to use movbe
I'm curious about the reason behind the choice.

movbe is a nice instruction but only supported since about 2013.
At the moment my desktop computer from 2012 is still good enough for my needs.
I imagine I'm not the only one still using such an old computer.
by wilbert
Thu Feb 08, 2024 2:52 pm
Forum: Bugs - Windows
Topic: Infinity minus infinity bug
Replies: 5
Views: 756

Re: Infinity minus infinity bug

The C compiler uses FUCOMIP instead of FCOMP for x86 and UCOMISD for x64. Both FUCOMIP and UCOMISD set the zero, parity and carry flags so you don't have to store the status word in this case. The parity flag is evaluated first. If it is set, the compared values are not equal. If parity is not set, ...
by wilbert
Tue Feb 06, 2024 8:09 am
Forum: Tricks 'n' Tips
Topic: Fast String Functions using MMX
Replies: 9
Views: 837

Re: Fast String Functions using MMX

The help says only xmm0..xmm3 are volatile! Is the help wrong here? I don't know why the help says that. :? The calling conventions say something different. Windows uses the "x64 calling convention" for 64 bit applications. Linux and macOS use the "AMD System V ABI" . Here's a q...
by wilbert
Mon Feb 05, 2024 7:25 am
Forum: Tricks 'n' Tips
Topic: Fast String Functions using MMX
Replies: 9
Views: 837

Re: Fast String Functions using MMX

Until now my opinion was MM0 is the lo-part of XMM0. But that's not the case! XMM-Registers are seperate Registers. So I have to add EMMS instruction! Thank's very much! Using XMM-Register would be better! But this is not so easy because as I know, there is no direct MOV between 64-Bit-CPU-Register...
by wilbert
Sun Feb 04, 2024 9:01 am
Forum: Tricks 'n' Tips
Topic: Fast String Functions using MMX
Replies: 9
Views: 837

Re: Fast String Functions using MMX

SMaag wrote: Sat Feb 03, 2024 12:31 pmI used only standard MMX commands existing since the late '90s.
As far as I understand you have to use the EMMS instruction at the end of your procedure if you use MMX registers.
That's one of the reasons I prefer the XMM registers from the SSE standard.
by wilbert
Sat Jan 13, 2024 6:38 pm
Forum: Coding Questions
Topic: Unicode question
Replies: 25
Views: 1624

Re: Unicode question

My goal is to know if I can do that without a loop (For...Next, While...Wend) and read the string from memory as PeekS() can do it. Maybe a windows API ? or else... Why are you looking for something without a loop ? A function like PeekS or WideCharToMultiByte also uses a loop internally. The diffe...
by wilbert
Thu Jan 04, 2024 10:16 am
Forum: Coding Questions
Topic: Strange behavior of Abs()! @PureBasicTeam
Replies: 25
Views: 1893

Re: Strange behavior of Abs()! @PureBasicTeam

With the c backend you could also use llabs

Code: Select all

int64.q = -100000000000000005
!v_int64 = llabs(v_int64);
Debug int64
by wilbert
Fri Dec 15, 2023 1:48 pm
Forum: Windows
Topic: Very fast split string to array function
Replies: 29
Views: 12220

Re: Very fast split string to array function

I know it's a pretty old one :? but I can't get your zip. I guess there should be some code updates since 2004... You can still down;oad it https://w73.nl/pb/split.zip but it's not a code source but a user library. I don't even know if I still have the original source code and if it still works it ...
by wilbert
Tue Dec 05, 2023 1:27 pm
Forum: Coding Questions
Topic: Which one is faster
Replies: 24
Views: 1670

Re: Which one is faster

some modifications (again) so that the calculations are done with the backendc + optimization (X3 for me !) If you take a look at the generated asm code, you will see that that still isn't enough. :wink: The C compiler is so good at optimizing that 1. The procedure isn't called like the asm backend...
by wilbert
Tue Dec 05, 2023 8:50 am
Forum: Coding Questions
Topic: Which one is faster
Replies: 24
Views: 1670

Re: Which one is faster

Code: Select all

Procedure Limit(x.l)
  ; limit between 0 and 255
  !movd xmm0, [p.v_x]
  !packssdw xmm0, xmm0
  !packuswb xmm0, xmm0
  !movd eax, xmm0
  ProcedureReturn
EndProcedure

Debug Limit(-10)
Debug Limit(1000)
Debug Limit(100)
by wilbert
Sun Dec 03, 2023 2:24 pm
Forum: Tricks 'n' Tips
Topic: BigInt module (SSE2)
Replies: 44
Views: 19791

Re: BigInt module (SSE2)

AZJIO wrote: Sun Dec 03, 2023 8:39 am Can you adapt to version 6.03?
*vn -> vn3 ?
Try moving the *vn declaration inside the divmod_private procedure to the line above like this.

Code: Select all

    Protected.BigInt un, vn, *vn
    Protected.i qhat, rhat, *un.Quad
by wilbert
Sun Nov 05, 2023 7:19 pm
Forum: Coding Questions
Topic: Reconstructing original frames from interpolated movie
Replies: 28
Views: 2531

Re: Reconstructing original frames from interpolated movie

acreis wrote: Sat Nov 04, 2023 10:42 am Any chance to see any picture?
Here is a crop of two consecutive frames from the 25fps clip
Image Image

And a crop of two consecutive frames from the 18fps clip
Image Image