PureBasic 6.00 released !
- netmaestro
- PureBasic Bullfrog
- Posts: 8433
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Re: PureBasic 6.00 Alpha 5 released !
Under Compiler Options->Compiler it reports "PureBasic Alpha 5 (x86) and there isn't an option for asm output so I assume I'm using the C backend. Anyways, running Windows 11, Debug RGB(164,0,0) reports 164 with no errors. Unless I'm missing something and not getting the C backend but I don't know how that could be.
BERESHEIT
- netmaestro
- PureBasic Bullfrog
- Posts: 8433
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Re: PureBasic 6.00 Alpha 5 released !
Aha, Fred already fixed this one for the next version. I couldn't reproduce it from the ide but I could running the compiler from the command line.
BERESHEIT
Re: PureBasic 6.00 Alpha 5 released !
You have to add the C-Backend compiler for x86 yourself in the IDE under settings/compiler.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Re: PureBasic 6.00 Alpha 5 released !
I don't know if DeanH wrote about this problem, but I can't compile anything in the latest alpha(5) for x86. Even if my code consists of: Debug 1
I receive the following message: unknown error (resource error) on my windows 7 sp-1 x86.
I receive the following message: unknown error (resource error) on my windows 7 sp-1 x86.
- DeanH
- Enthusiast
- Posts: 229
- Joined: Wed May 07, 2008 4:57 am
- Location: Adelaide, South Australia
- Contact:
Re: PureBasic 6.00 Alpha 5 released !
I added the C backend compiler for 32-bit in Preferences so I have both the x86 asm and C-backend options set up correctly. I have tried both. If I set the 32-bit Alpha 5 to the x86asm compiler and just run the single line Debug RGB(164,0,0), no error. I then switch to the C-backend (Windows x86) and run again the polink error occurs. If I open the x64 Alpha 5 editor and do this with the 64-bit (x64) compilers, both asm and c, no error. It looks as if it is only the 32-bit c-compiler that produces the error. But then someone said the fix will be in Alpha 6.
I am waiting for the fix as I would like to do a big compile to see if the c-backend compiled code generates false positives. Coretex is used by schools here in South Australia. It makes a false positive for a 32-bit compiled PB programs using PB 5.73 and PB 6.00 using the asm compiler. No false positive when compiled as 64-bit asm using the exact same source code. On my work and home PCs I have excluded the development folder from being scanned by Coretex so I can and compile updates for users. It would be easier for users if there was only one system. I estimate about 15% of my users still have 32-bit Windows systems, mostly Win 7 although a few have 32-bit Win 8 and even 10, so I am not quite at the point of going only 64-bit.
I am waiting for the fix as I would like to do a big compile to see if the c-backend compiled code generates false positives. Coretex is used by schools here in South Australia. It makes a false positive for a 32-bit compiled PB programs using PB 5.73 and PB 6.00 using the asm compiler. No false positive when compiled as 64-bit asm using the exact same source code. On my work and home PCs I have excluded the development folder from being scanned by Coretex so I can and compile updates for users. It would be easier for users if there was only one system. I estimate about 15% of my users still have 32-bit Windows systems, mostly Win 7 although a few have 32-bit Win 8 and even 10, so I am not quite at the point of going only 64-bit.
Re: PureBasic 6.00 Alpha 5 released !
Any idea when label addresses in datasection will be available?
Re: PureBasic 6.00 Alpha 5 released !
Does the "Optimize generated code" option do anything for the ASM backend?
-
- Enthusiast
- Posts: 557
- Joined: Wed Sep 25, 2019 10:18 am
Re: PureBasic 6.00 Alpha 5 released !
@Rinzwind Optimize calls the -O2 option only with the C compiler GCC.
/gcc/Optimize-Options.html
/gcc/Optimize-Options.html
- marcoagpinto
- Addict
- Posts: 947
- Joined: Sun Mar 10, 2013 3:01 pm
- Location: Portugal
- Contact:
Re: PureBasic 6.00 Alpha 5 released !
Can't Fred allow to custom the optimising settings in the source-code of our apps?
One could add there the GCC settings "o2" or "o3".
Code: Select all
; IDE Options = PureBasic 6.00 Alpha 5 (Windows - x64)
; CursorPosition = 2777
; FirstLine = 2756
; Folding = -------
; Optimizer
; EnableXP
; DPIAware
; UseIcon = /media/icon_256x256_20180627.ico
; Executable = ProofingToolGUI_V0195_x64_beta.exe
; DisableDebugger
; CompileSourceDirectory
; Compiler = PureBasic 6.00 Alpha 5 - C Backend (Windows - x64)
; EnableUnicode
Re: PureBasic 6.00 Alpha 5 released !
He could, but I think the initial focus is on getting it fully functional without making any changes.marcoagpinto wrote: ↑Wed Nov 03, 2021 12:06 pm Can't Fred allow to custom the optimising settings in the source-code of our apps?
One could add there the GCC settings "o2" or "o3".Code: Select all
; IDE Options = PureBasic 6.00 Alpha 5 (Windows - x64) ; CursorPosition = 2777 ; FirstLine = 2756 ; Folding = ------- ; Optimizer ; EnableXP ; DPIAware ; UseIcon = /media/icon_256x256_20180627.ico ; Executable = ProofingToolGUI_V0195_x64_beta.exe ; DisableDebugger ; CompileSourceDirectory ; Compiler = PureBasic 6.00 Alpha 5 - C Backend (Windows - x64) ; EnableUnicode
Re: PureBasic 6.00 Alpha 5 released !
Does anyone know and can explain what is the impact of -o3 compared to -o2 on performance.
Without knowing, I agree that it would be good to have the choice with a preference in source : Optimizer = 0 or 2, 3, s (level) s
In Debug, Compile/Run, it also uses -o0 or -o2, would probably be good with -og
-Og: Optimize, but do not interfere with debugging. This enables non-embarrassing performance for debug builds and is intended to replace -O0 for debug builds.
I don't know if it has any interest, temp files and folders are deleted, but here is the process chain:
Without knowing, I agree that it would be good to have the choice with a preference in source : Optimizer = 0 or 2, 3, s (level) s
In Debug, Compile/Run, it also uses -o0 or -o2, would probably be good with -og
-Og: Optimize, but do not interfere with debugging. This enables non-embarrassing performance for debug builds and is intended to replace -O0 for debug builds.
I don't know if it has any interest, temp files and folders are deleted, but here is the process chain:
Code: Select all
pbcompilerc.exe
|- gcc.exe -O0 -Wno-incompatible-pointer-types -Wno-overflow -Wno-int-conversion -c -o PureBasic.obj "purebasic.c" (-O2 with Optimizer)
| |- cc1.exe -quiet -iprefix E:/PureBasic_Windows_alpha_5_X64_6_00/Compilers/../lib/gcc/x86_64-w64-mingw32/8.1.0/ -D_REENTRANT purebasic.c -quiet -dumpbase purebasic.c -mtune=core2 -march=nocona -auxbase-strip PureBasic.obj -O0 -Wno-incompatible-pointer-types -Wno-overflow -Wno-int-conversion -o C:\Users\ChrisR\AppData\Local\Temp\ccEMvSMq.s
| |- as.exe -o PureBasic.obj C:\Users\ChrisR\AppData\Local\Temp\ccEMvSMq.s
|- porc.exe" "C:\Users\ChrisR\AppData\Local\Temp\PureBasic392376671\PureBasic.rc" /Fo"C:\Users\ChrisR\AppData\Local\Temp\PureBasic392376671\PureBasic.res"
|- polink.exe" /FORCE:MULTIPLE /OUT:"E:\Temp\test.exe" /SUBSYSTEM:Windows,5.0 /NODEFAULTLIB /LIBPATH:"E:\PureBasic_Windows_alpha_5_X64_6_00\Compilers" /LIBPATH:"E:\PureBasic_Windows_alpha_5_X64_6_00\PureLibraries\Windows\Libraries" PureBasic.obj SystemBase.lib StringUtility.lib UnicodeFunctions.lib MSVCRT.lib KERNEL32.lib USER32.lib GDI32.lib COMDLG32.lib ADVAPI32.lib COMCTL32.lib OLEAUT32.lib "E:\PureBasic_Windows_alpha_5_X64_6_00\Compilers\_chkstk_ms.obj" Gadget.lib System.lib Window.lib Event.lib Map.lib Desktop.lib Date.lib AlphaImage.lib Image.lib LinkedList.lib ImagePluginBMP.lib ImagePlugin.lib VectorDrawing.lib String.lib Memory.lib Font.lib "E:\PureBasic_Windows_alpha_5_X64_6_00\compilers/objectmanager.lib" SimpleList.lib 2DDrawing.lib "E:\PureBasic_Windows_alpha_5_X64_6_00\compilers/stringmanagerc.lib" OLEAUT32.LIB ADVAPI32.LIB OLE32.LIB SHELL32.LIB COMCTL32.LIB UUID.LIB SHELL32.LIB WINMM.LIB PSAPI.LIB MSVCRT.LIB GdiPlus.LIB kernel32.lib PureBasic.res
Re: PureBasic 6.00 Alpha 5 released !
Take a look at the manual. You can find everything that interests you in there. In short, -O3 will give you a better optimized but slightly larger binary by turning on some extra flags...ChrisR wrote: ↑Wed Nov 03, 2021 2:27 pm Does anyone know and can explain what is the impact of -o3 compared to -o2 on performance.
Without knowing, I agree that it would be good to have the choice with a preference in source : Optimizer = 0 or 2, 3, s (level) s
In Debug, Compile/Run, it also uses -o0 or -o2, would probably be good with -og
-Og: Optimize, but do not interfere with debugging. This enables non-embarrassing performance for debug builds and is intended to replace -O0 for debug builds.
Code: Select all
-O2
Optimize even more. GCC performs nearly all supported optimizations that do
not involve a space-speed tradeoff. As compared to ‘-O’, this option increases
both compilation time and the performance of the generated code.
‘-O2’ turns on all optimization flags specified by ‘-O’.
It also turns on the
following optimization flags:
-fthread-jumps
-falign-functions -falign-jumps
-falign-loops -falign-labels
-fcaller-saves
-fcrossjumping
-fcse-follow-jumps -fcse-skip-blocks
-fdelete-null-pointer-checks
-fdevirtualize -fdevirtualize-speculatively
-fexpensive-optimizations
-fgcse -fgcse-lm
-fhoist-adjacent-loads
-finline-small-functions
-findirect-inlining
-fipa-cp
-fipa-bit-cp
-fipa-vrp
-fipa-sra
-fipa-icf
-fisolate-erroneous-paths-dereference
-flra-remat
-foptimize-sibling-calls
-foptimize-strlen
-fpartial-inlining
-fpeephole2
-freorder-blocks-algorithm=stc
-freorder-blocks-and-partition -freorder-functions
-frerun-cse-after-loop
-fsched-interblock -fsched-spec
-fschedule-insns -fschedule-insns2
-fstore-merging
-fstrict-aliasing
-ftree-builtin-call-dce
-ftree-switch-conversion -ftree-tail-merge
-fcode-hoisting
-ftree-pre
-ftree-vrp
-fipa-ra
Please note the warning under ‘-fgcse’ about invoking ‘-O2’ on programs that
use computed gotos.
-O3
Optimize yet more. ‘-O3’ turns on all optimizations specified by ‘-O2’ and also
turns on the following optimization flags:
-finline-functions
-funswitch-loops
-fpredictive-commoning
-fgcse-after-reload
-ftree-loop-vectorize
-ftree-loop-distribution
-ftree-loop-distribute-patterns
-floop-interchange
-floop-unroll-and-jam
-fsplit-paths
-ftree-slp-vectorize
-fvect-cost-model
-ftree-partial-pre
-fpeel-loops
-fipa-cp-clone
Et cetera is my worst enemy
Re: PureBasic 6.00 Alpha 5 released !
Thanks chi
With your Array.pb example in the Benchmark page , we see well the optimization with also the bigger size.
With your Array.pb example in the Benchmark page , we see well the optimization with also the bigger size.
- RichAlgeni
- Addict
- Posts: 914
- Joined: Wed Sep 22, 2010 1:50 am
- Location: Bradenton, FL
Re: PureBasic 6.00 Alpha 5 released !
The fact that PureBasic 6 could conceivably run on your Android phone, just blows me away!!!
-
- Addict
- Posts: 1443
- Joined: Wed Nov 12, 2008 5:01 pm
- Location: Russia
Re: PureBasic 6.00 Alpha 5 released !
Can also add compiler options for the processor type.
https://gcc.gnu.org/onlinedocs/gcc/x86- ... 86-Options
https://gcc.gnu.org/onlinedocs/gcc/x86- ... 86-Options
Code: Select all
-mmmx
-msse
-msse2
-msse3
-mssse3
-msse4
-msse4a
-msse4.1
-msse4.2