Search found 1188 matches

by jj2007
Aug 15, 2017 22:17
Forum: General
Topic: How to reduce the filesize of a compiled file?
Replies: 65
Views: 4403

Re: How to reduce the filesize of a compiled file?

the manual higher level optimizations (algorithms, ...) are far more important than manual lower level optimizations, as the latter can be done by compilers. So if you (find and) use some O(n*log(n)) algorithm instead of some O(n²) one that would be far better than any optimizations in assembly lan...
by jj2007
Aug 15, 2017 20:56
Forum: General
Topic: How to reduce the filesize of a compiled file?
Replies: 65
Views: 4403

Re: How to reduce the filesize of a compiled file?

Truth is that dense assembler code beats C any time (there is a small code cache, for example). Beats it at what metric? A well-written C routine can easily best a naive assembler implementation, however dense. A well-written assembler routine would be approximately equal to a well-written C routin...
by jj2007
Aug 15, 2017 20:12
Forum: General
Topic: How to reduce the filesize of a compiled file?
Replies: 65
Views: 4403

Re: How to reduce the filesize of a compiled file?

I love benchmarking! Can you produce an example where Java is faster than C, or, even worse, assembly? e.g. see http://blog.cfelde.com/2010/06/c-vs-java-performance/ or https://www.ibm.com/developerworks/java/library/j-jtp09275/index.html for some examples. Good read, thanks. Repeating those benchm...
by jj2007
Aug 15, 2017 18:21
Forum: General
Topic: How to reduce the filesize of a compiled file?
Replies: 65
Views: 4403

Re: How to reduce the filesize of a compiled file?

While that may be true at a very small scale it often is not at a larger scale. For example even dynamically compiled languages like C# or Java are faster than C sometimes due to optimizations at runtime (like partial evaluation), which is not really possible in C or, even worse, assembly. I love b...
by jj2007
Aug 15, 2017 13:00
Forum: General
Topic: How to reduce the filesize of a compiled file?
Replies: 65
Views: 4403

Re: How to reduce the filesize of a compiled file?

IMHO everything < 1MB is fine nowadays and no bloat for a simple "Hello world" program. Anyway, FreeBasic should be a programming language that is easy to use and fast. You probably won't get that when optimizing for executable size. That is hearsay. Truth is that dense assembler code bea...
by jj2007
Aug 14, 2017 12:11
Forum: General
Topic: How to reduce the filesize of a compiled file?
Replies: 65
Views: 4403

Re: How to reduce the filesize of a compiled file?

44032 with VC 29696 with Pelles C (but I am sure there is a trick to reduce it) 27930 with GCC32 26112 with MasmBasic 3072 with C# (exe) 1536 with Masm32 170 with C# (.cs) ... There is a tradeoff between size and a minimum functionality. If the overhead exceeds, say, 32k or so, you know that coders ...
by jj2007
Aug 13, 2017 22:40
Forum: General
Topic: How to reduce the filesize of a compiled file?
Replies: 65
Views: 4403

Re: How to reduce the filesize of a compiled file?

Rumours say a standalone "hello world" in QT is around 10MB. Why are you worried about 20k?
If a language has many features, there is always a certain overhead. The more interesting question is the size of a big source, say: 10,000 lines.
by jj2007
Aug 10, 2017 8:23
Forum: General
Topic: using gcc quadmath
Replies: 48
Views: 2735

Re: using gcc quadmath

Thanks, I will keep trying... Just discovered this - did you ever make any comparisons between QuadMath and SoftFloat, re speed, completeness etc? QuadMath quadruple precision math library by srvaldez The package includes the following files: - softfloat.bi : header file for the softfloat library - ...
by jj2007
Aug 09, 2017 8:07
Forum: General
Topic: using gcc quadmath
Replies: 48
Views: 2735

Re: using gcc quadmath

just in case anyone is interested, I made wrapper of QuadMath , it's the only way it will work reliably with FB Looks interesting, but it throws an error: \AllBasics\FreeBasic\fbc.exe -s console "C:\Masm32\MasmBasic\LibQuad\Quadmth\tmp\quad-math-test3.bas" C:\AllBasics\FreeBasic\bin\win32...
by jj2007
Aug 07, 2017 13:25
Forum: General
Topic: using gcc quadmath
Replies: 48
Views: 2735

Re: using gcc quadmath

srvaldez wrote:I am having no luck with frexpq however.


Works with me - have a look at this post. I inserted an int 3 into one of the executables, so that you can launch the debugger and see the args. I took the PI example from here.
by jj2007
Aug 06, 2017 20:30
Forum: General
Topic: using gcc quadmath
Replies: 48
Views: 2735

Re: using gcc quadmath

Congrats!

> 'since the values of the arguments may not be 16-byte aligned we copy one dword at a time

You have movups for unaligned data.
by jj2007
Aug 05, 2017 0:27
Forum: General
Topic: using gcc quadmath
Replies: 48
Views: 2735

Re: using gcc quadmath

The stack itself must be aligned:

Code: Select all

  sub esp, 3*OWORD   ; xmm0 ... xmm2
  and esp, -16
by jj2007
Aug 04, 2017 17:20
Forum: General
Topic: using gcc quadmath
Replies: 48
Views: 2735

Re: using gcc quadmath

The result is where you want it! The pointer to the destination is usually [esp+00h]. Make sure the destination is aligned. Normally, I reserve 16 bytes on the stack before calling the qm function, and a mov [esp], esp or similar does the job. Then on return, movaps xmm0, [esp] retrieves the result.
by jj2007
Aug 04, 2017 17:01
Forum: General
Topic: using gcc quadmath
Replies: 48
Views: 2735

Re: using gcc quadmath

OK, so you could implement it that way. All you have to do is - make sure the stack is aligned 16 (there is SSE2 in these functions) - args are in [esp+16*n] - call TheQuadFunction (and make sure FB doesn't push anything before that step) In the meantime, I've posted an example of float128 arrays . ...
by jj2007
Aug 03, 2017 11:54
Forum: General
Topic: using gcc quadmath
Replies: 48
Views: 2735

Re: using gcc quadmath

you said that you passed the arguments in xmm registers but the 32-bit asm code from https://godbolt.org seems to pass them on the stack, can you clarify? The QuadMath functions expect their arguments on the stack at positions [esp+00h] [esp+10h] [esp+20h] [esp+30h] How exactly you put them in this...

Go to advanced search