Re: [fpc-pascal] return 8 byte of return as function result via register

2014-09-12 Thread leledumbo
> However, the dll requires my functions to return 8 byte of 'struct' via register and the dll author said it is not possible with Delphi. Is that possible with fpc? If you know the register, just assign it via inline assembly. -- View this message in context: http://free-pascal-general.104

Re: [fpc-pascal] detect CPU cores

2014-09-12 Thread Dmitry Boyarintsev
Please disregard my previous statement abour renaming register names. I was completely wrong. The problem most likely was with a wrong asm mode. Try to specify the asm mode explicitly by adding {$ASMMODE INTEL} at the begging of the unit. You might try an alternative version here: http://pastebin.

Re: [fpc-pascal] detect CPU cores

2014-09-12 Thread Xiangrong Fang
2014-09-13 0:28 GMT+08:00 Dmitry Boyarintsev : > You're compiling for x64, You need to replace "eax" and "edx" with "rax" > and "rdx", since e?x are available for i386 only. > > My situation is, I program and test on Ubuntu x64 on a i3-M390. Then compile it to Windows 32bit on a VirtualBox on this

[fpc-pascal] return 8 byte of return as function result via register

2014-09-12 Thread Dennis Poon
I am trying to use an external C++ dll and also privide call back functions to this dll to call back. However, the dll requires my functions to return 8 byte of 'struct' via register and the dll author said it is not possible with Delphi. Is that possible with fpc? Dennis __

Re: [fpc-pascal] detect CPU cores

2014-09-12 Thread Sven Barth
On 12.09.2014 22:13, Marco van de Voort wrote: In our previous episode, Sven Barth said: Considering that the implementation is currently "Result := 1" for any target that is no surprise ;) I've now implemented GetCPUCount for all Windows targets. .. updating... For the BSD's I'd use sys

Re: [fpc-pascal] detect CPU cores

2014-09-12 Thread Marco van de Voort
In our previous episode, Sven Barth said: > > Considering that the implementation is currently "Result := 1" for any > > target that is no surprise ;) > > I've now implemented GetCPUCount for all Windows targets. .. updating... > For the BSD's > I'd use sysctl, which would mean that I'd need t

Re: [fpc-pascal] detect CPU cores

2014-09-12 Thread Sven Barth
On 12.09.2014 20:20, Sven Barth wrote: Am 12.09.2014 17:31 schrieb "Marco van de Voort" mailto:mar...@stack.nl>>: > > In our previous episode, Sven Barth said: > > FPC 2.7.1 has TThread.ProcessorCount (it's a class property, so no instance > > needed) or System.CpuCount (ProcessorCount uses t

Re: [fpc-pascal] detect CPU cores

2014-09-12 Thread Sven Barth
Am 12.09.2014 17:31 schrieb "Marco van de Voort" : > > In our previous episode, Sven Barth said: > > FPC 2.7.1 has TThread.ProcessorCount (it's a class property, so no instance > > needed) or System.CpuCount (ProcessorCount uses this). It's not yet > > implemented though for any system :/ > > I ran

Re: [fpc-pascal] detect CPU cores

2014-09-12 Thread Dmitry Boyarintsev
You're compiling for x64, You need to replace "eax" and "edx" with "rax" and "rdx", since e?x are available for i386 only. thanks, Dmitry On Fri, Sep 12, 2014 at 11:15 AM, Xiangrong Fang wrote: > I found this code on the net: > > > http://code.google.com/p/fpos/source/browse/kernel/cpuid.pas?

Re: [fpc-pascal] detect CPU cores

2014-09-12 Thread Marco van de Voort
In our previous episode, Sven Barth said: > FPC 2.7.1 has TThread.ProcessorCount (it's a class property, so no instance > needed) or System.CpuCount (ProcessorCount uses this). It's not yet > implemented though for any system :/ I ran it to test if it made a difference between cores and hyperthrea

Re: [fpc-pascal] detect CPU cores

2014-09-12 Thread Tomas Hajny
On Fri, September 12, 2014 17:15, Xiangrong Fang wrote: > I found this code on the net: > > http://code.google.com/p/fpos/source/browse/kernel/cpuid.pas?r=c387b381d7a05f9328693cdcf59b0b4f633294e4 > > It's part of the "FreePascal Operationg System" project. I suppose it is > compatible with FreePasc

Re: [fpc-pascal] detect CPU cores

2014-09-12 Thread Sven Barth
Am 12.09.2014 16:08 schrieb "Xiangrong Fang" : > > Hi All, > > Is there a platform independent (specifically Windows and Linux) way to detect cores and hyper-threads of the CPU? I am writing a calculation intensive app and would like to fully utilize SMP capability of the CPU. FPC 2.7.1 has TThrea

Re: [fpc-pascal] detect CPU cores

2014-09-12 Thread Xiangrong Fang
I found this code on the net: http://code.google.com/p/fpos/source/browse/kernel/cpuid.pas?r=c387b381d7a05f9328693cdcf59b0b4f633294e4 It's part of the "FreePascal Operationg System" project. I suppose it is compatible with FreePascal of course. But while compiled, I got lots of errors, such as:

Re: [fpc-pascal] detect CPU cores

2014-09-12 Thread Dmitry Boyarintsev
If you're talking bout x88_64, i386 platforms, you should be able to do it using CPUID instruction http://en.wikipedia.org/wiki/CPUID thanks, Dmitry On Fri, Sep 12, 2014 at 10:07 AM, Xiangrong Fang wrote: > Hi All, > > Is there a platform independent (specifically Windows and Linux) way to > d

[fpc-pascal] detect CPU cores

2014-09-12 Thread Xiangrong Fang
Hi All, Is there a platform independent (specifically Windows and Linux) way to detect cores and hyper-threads of the CPU? I am writing a calculation intensive app and would like to fully utilize SMP capability of the CPU. Thanks! Xiangrong ___ fpc-pasc

Re: [fpc-pascal] Fastest way of drawing 2D graphs

2014-09-12 Thread Hunter1972
> ...SDL... > -Michael > . > MSEgui txychartedit > Another option is Lazarus TChart. > . > Martin I will check what these libraries can do and how fast. > > I assume your polylines are basically an array of X,Y coordinates in single > precision + color information? If you supply examples

Re: [fpc-pascal] Fastest way of drawing 2D graphs

2014-09-12 Thread Marco van de Voort
In our previous episode, Hunter1972 said: > I am new in FPC and want to understand the correct(fastest) methods when > drawing 2D graphics. > The task is simple but extensive: to draw about 200 polylines with > 5-20 points in each. > I have made a test code in OnPaint event: OpenGL is an

Re: [fpc-pascal] Fastest way of drawing 2D graphs

2014-09-12 Thread Michael Schnell
On 09/12/2014 01:36 AM, Hunter1972 wrote: Then I'd like to add some actions to the graphics: 1)Scaling around some point (by mouse wheel), actually magnifying 2)Moving this scaled point quickly to another part of graphics( using scroll bars?) I once did "zooming and panning" of pixel graphics u

Re: [fpc-pascal] Fastest way of drawing 2D graphs

2014-09-12 Thread Martin Schreiber
On Friday 12 September 2014 01:36:56 Hunter1972 wrote: > Hello, > I am new in FPC and want to understand the correct(fastest) methods when > drawing 2D graphics. The task is simple but extensive: to draw about 200 > polylines with 5-20 points in each. MSEgui txychartedit supports it. An ex