Cpu Optimisation

Everything else that doesn't fall into one of the other PB categories.
User_Russian
Addict
Addict
Posts: 1518
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

Cpu Optimisation

Post 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?
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: Cpu Optimisation

Post by ts-soft »

This is for Libs/UserLibs that support this!
I think, in the moment are no libs available :mrgreen:
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
User_Russian
Addict
Addict
Posts: 1518
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

Re: Cpu Optimisation

Post 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.
User avatar
kryptonn
User
User
Posts: 47
Joined: Wed Apr 18, 2007 7:23 pm

Re: Cpu Optimisation

Post 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.
User_Russian
Addict
Addict
Posts: 1518
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

Re: Cpu Optimisation

Post by User_Russian »

kryptonn wrote:but this useful for others, for me exactly.
Tell us how you use this option?
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: Cpu Optimisation

Post 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)
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
User_Russian
Addict
Addict
Posts: 1518
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

Re: Cpu Optimisation

Post 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.
User avatar
kryptonn
User
User
Posts: 47
Joined: Wed Apr 18, 2007 7:23 pm

Re: Cpu Optimisation

Post 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.
User_Russian
Addict
Addict
Posts: 1518
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

Re: Cpu Optimisation

Post by User_Russian »

kryptonn, do not write nonsense!
User avatar
Lunasole
Addict
Addict
Posts: 1091
Joined: Mon Oct 26, 2015 2:55 am
Location: UA
Contact:

Re: Cpu Optimisation

Post 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" :) ?
"W̷i̷s̷h̷i̷n̷g o̷n a s̷t̷a̷r"
sys64802
Enthusiast
Enthusiast
Posts: 105
Joined: Sat Sep 12, 2015 6:55 pm

Re: Cpu Optimisation

Post 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.
User avatar
Lunasole
Addict
Addict
Posts: 1091
Joined: Mon Oct 26, 2015 2:55 am
Location: UA
Contact:

Re: Cpu Optimisation

Post 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".
"W̷i̷s̷h̷i̷n̷g o̷n a s̷t̷a̷r"
sys64802
Enthusiast
Enthusiast
Posts: 105
Joined: Sat Sep 12, 2015 6:55 pm

Re: Cpu Optimisation

Post 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.
User avatar
idle
Always Here
Always Here
Posts: 5836
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: Cpu Optimisation

Post by idle »

This can be used to select appropriate runtime routines
http://www.purebasic.fr/english/viewtop ... 12&t=61060
Windows 11, Manjaro, Raspberry Pi OS
Image
Post Reply