Search found 3060 matches

by marcov
Apr 02, 2021 21:20
Forum: Community Discussion
Topic: Where is the magic?
Replies: 16
Views: 919

Re: Where is the magic?

llvm-ld also has horrible errorhandling. It generates an invalid binary without any warnings.
by marcov
Apr 02, 2021 21:16
Forum: Beginners
Topic: Execution speed of nested loops
Replies: 24
Views: 505

Re: Execution speed of nested loops

What MrSwiss says. probably the inner loop 0..31 can hold the dword to be mutated in a register value, only storing it after the loop.

That's a lot of load/store operations eliminated, and if dwnumlongs is high, less cache polution
by marcov
Apr 02, 2021 10:33
Forum: Documentation
Topic: Executables and Compiling
Replies: 19
Views: 1211

Re: Executables and Compiling

A picture perhaps? For the wiki docs I mean?

Image

Extensions are unix convention vs windows (ld does .lib too nowadays). In the case of shared libs, the name for Mac deviates (.dylib)
by marcov
Mar 27, 2021 22:00
Forum: Community Discussion
Topic: Where is the magic?
Replies: 16
Views: 919

Re: Where is the magic?

Yes. FreeBSD uses the ELF ident info to link the starting binary to alternate library paths. Linux to linuxator libs, and older FreeBSD version to their libraries under /compat/
by marcov
Mar 27, 2021 20:44
Forum: Beginners
Topic: Embedded function calls
Replies: 22
Views: 821

Re: Embedded function calls

I have also tested this with files written in c and made into dlls, with and without optimisations, again no speed difference when using them with fb. I have also tested with fb static libs, again no speed difference. Any ideas? If the fb source is all in one module then gcc can optimize functions ...
by marcov
Mar 24, 2021 21:13
Forum: General
Topic: Duffs Device & similar
Replies: 23
Views: 537

Re: Duffs Device & similar

Here is the original wanted, with C (loosly similar to switch) type code, cascading through the cases, visiting each one in turn Except the control flow graph of your program is completely different. The cmp3() function now gets executed every time an alternate loop is selected. What if the functio...
by marcov
Mar 24, 2021 16:00
Forum: General
Topic: Duffs Device & similar
Replies: 23
Views: 537

Re: Duffs Device & similar

caseih: Well a good compiler could optimize firstcase1: dosomething; goto secondcase goto endcase secondcase: dosomething; goto defaultcase goto endcase default: dosomething; goto endcase endcase: ; by first eliminating dead/unreachable code (the goto endcase statements), and then peepholing the got...
by marcov
Mar 24, 2021 10:49
Forum: General
Topic: Duffs Device & similar
Replies: 23
Views: 537

Re: Duffs Device & similar

Oh I'm aware of the original purpose, and that modern compilers will unroll loops for you. I'm going to have to disagree with your argument for "design failure" though. Noted. (You aren't one of those "GOTO is harmful" coders are you?) Since I don't know how narrow you define th...
by marcov
Mar 24, 2021 9:26
Forum: General
Topic: Duffs Device & similar
Replies: 23
Views: 537

Re: Duffs Device & similar

Because fallthrough case is simply a design failure and generations of programmers have suffered the consequences. That there is one or maybe a few cases that exploit it, like Duff's device doesn't change that. Note that Duff's device was originally intended for loop unrolling, and with the C backen...
by marcov
Mar 20, 2021 21:23
Forum: Windows
Topic: How can a FreeBasic program set a variable in windows batch file ?
Replies: 18
Views: 437

Re: How can a FreeBasic program set a variable in windows batch file ?

The crucial line in the code below is the for /f line that captures the result of the dumptime call. The EnableDelayedExpansion might also be necessary, and this is a .cmd not a .bat, dunno if that matters. dumptime is a simple program that works as a stopwatch. SET <xx> stores a timestamp in file <...
by marcov
Mar 17, 2021 22:10
Forum: Beginners
Topic: Need help with ASM
Replies: 30
Views: 607

Re: Need help with ASM

Then you are memory bound. Which is not so strange with only one instruction (OR), the rest load/store and loop skeleton.

But it might depend on system.
by marcov
Mar 17, 2021 8:40
Forum: Beginners
Topic: Need help with ASM
Replies: 30
Views: 607

Re: Need help with ASM

Please excuse my ignorance, but how would I "map a file into memory"? Google "windows" + some terms (like "memory map file" and you usually get MSDN links. Sometimes you need to try a few times to find the right terms. https://docs.microsoft.com/en-us/windows/win32/mem...
by marcov
Mar 16, 2021 21:06
Forum: Beginners
Topic: Need help with ASM
Replies: 30
Views: 607

Re: Need help with ASM

As I see it, there are two components to disc reading. One is the actual data transfer rate which is independent of the chunk size (how does caching affect this?), and the other is the access time, ie the time taken to arrive at the target sector. The access time consists of seek time (the time to ...
by marcov
Mar 15, 2021 21:10
Forum: Beginners
Topic: Need help with ASM
Replies: 30
Views: 607

Re: Need help with ASM

Then you want AVX2 .
by marcov
Mar 15, 2021 14:51
Forum: Beginners
Topic: Need help with ASM
Replies: 30
Views: 607

Re: Need help with ASM

mov ebx, [edi]

Go to advanced search