Page 1 of 1

Cpu Optimisation

Posted: Wed Jan 21, 2015 6:49 pm
by User_Russian
In "compiler options" there is an item "Cpu Optimisation". http://www.purebasic.com/documentation/ ... piler.html
Cpu Optimisation (next to Executable format)
This setting allows to include Cpu optimised PB functions in your executable:
All CPU : The generic functions are included that run on all CPUs.
Dynamic CPU : The generic functions as well as any available CPU specific function are included. The function to execute is decided at runtime. This creates a bigger executable, but it will run as fast as possible on all CPUs.
All other options : Include only the functions for a specific CPU. The executable will not run on any Cpu that does not support this feature.
But it does not work! :shock: :shock:
What sense in of this option?

Re: Cpu Optimisation

Posted: Wed Jan 21, 2015 6:58 pm
by ts-soft
This is for Libs/UserLibs that support this!
I think, in the moment are no libs available :mrgreen:

Re: Cpu Optimisation

Posted: Wed Jan 21, 2015 7:04 pm
by User_Russian
Here I am about the same. At the moment it is a useless option.
But PB-library written in C ++ and can be compiled with these optimizations. Then the option will work.

Re: Cpu Optimisation

Posted: Wed Jan 21, 2015 7:38 pm
by kryptonn
User_Russian wrote:At the moment it is a useless option.
For you this uselessly, but this useful for others, for me exactly.

Re: Cpu Optimisation

Posted: Wed Jan 21, 2015 7:42 pm
by User_Russian
kryptonn wrote:but this useful for others, for me exactly.
Tell us how you use this option?

Re: Cpu Optimisation

Posted: Wed Jan 21, 2015 9:08 pm
by ts-soft
You have to export your functionnames with different names, like

ProcedureDLL MyFunction()
ProcedureDLL MyFunction_Unicode()
ProcedureDLL MyFunction_SSE2()
ProcedureDLL MyFunction_Unicode_SSE2()
...
(example Names for TailBite)

Re: Cpu Optimisation

Posted: Wed Jan 21, 2015 10:22 pm
by User_Russian
ts-soft wrote:You have to export your functionnames with different names, like
PB-libraries this is not do. :?
UserLibrary, are also typically such that do not do (me such libraries not known).

I would like to fully support these options in the PB-libraries. This would allow to create fast, work programs are activated, for example the technology SSE2.

Re: Cpu Optimisation

Posted: Thu Jan 22, 2015 7:35 am
by kryptonn
What your program need for optimisation If you write viruses, only ?
"Bring to your attention, one way, to protect the process of terminate" - by "User_Russian".
Long time on Russian forums you is teacher to writting malware.

Re: Cpu Optimisation

Posted: Thu Jan 22, 2015 9:29 am
by User_Russian
kryptonn, do not write nonsense!

Re: Cpu Optimisation

Posted: Thu Jan 07, 2016 10:42 pm
by Lunasole
I have the same question - how useful those options are and how they work?
I didn't found any SSE/SSE2 instructions within output assembly (at least while testing with some simple examples using doubles, etc).
Are they only to claim "we have SSE/SSE2 support" :) ?

Re: Cpu Optimisation

Posted: Thu Jan 07, 2016 10:56 pm
by sys64802
You have to write those functions (in C or ASM preferably), name them as explained in this thread (I think), put them in a PB library and then enable their usage through those options.

And PB uses at least some SSE instructions on x64, for example Int() is one I remember it does.

Re: Cpu Optimisation

Posted: Thu Jan 07, 2016 11:06 pm
by Lunasole
sys64802 wrote:You have to write those functions (in C or ASM preferably), name them as explained in this thread (I think), put them in a PB library and then enable their usage through those options.

And PB uses at least some SSE instructions on x64, for example Int() is one I remember it does.
Well then those options anyway looking just like a cheating being related to "CPU optimization" setting, cause many users would rather understand them as "compiler will use sse2 instructions where it is possible to optimize calculations" like it is in C/C++ compilers, not like "this will enable Purebasic-specific function selector when dealing with user libs".

Re: Cpu Optimisation

Posted: Thu Jan 07, 2016 11:19 pm
by sys64802
I agree but not if they read the manual as I did the first time I saw them, after initially thinking what you thought.
Note: No PB functions actually support this feature for now (it is ignored for them). However, some User Libraries include such optimisations.
Probably the last part should be "may include" to be on the safe side.
Knowing at the time that sentence was written some unknown user library supported them is not much useful.

But yes, this is in contrast with what happens with most of the compilers out there.

Re: Cpu Optimisation

Posted: Fri Jan 08, 2016 2:01 am
by idle
This can be used to select appropriate runtime routines
http://www.purebasic.fr/english/viewtop ... 12&t=61060