Re: [fpc-pascal] LLVM Backend Support

2016-08-31 Thread Sven Barth
Am 01.09.2016 00:15 schrieb "African Wild Dog" :
> And about GCC? It supports a wide variety of processors and OS.

Why would we want to depend on the behemoth that is GCC as a dependency
when FPC currently only needs an assembler and a linker and on some systems
not even that? That thought can also be applied to LLVM by the way...

Regards,
Sven
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] LLVM Backend Support

2016-08-31 Thread Dmitry Boyarintsev
On Wed, Aug 31, 2016 at 6:15 PM, African Wild Dog 
wrote:

> Again,thanks for the detailed explanation. As this is a recurrent
> topic,maybe it would be a good ideia to create a wiki page with all these
> points.
>

http://wiki.freepascal.org/LLVM

thanks,
Dmitry
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] LLVM Backend Support

2016-08-31 Thread Karoly Balogh (Charlie/SGR)
Hi,

On Wed, 31 Aug 2016, African Wild Dog wrote:

> > The code optimizers, yes. The rest, not so much.
> >
> >> Will the FPC team, somewhere in the future, adopt the LLVM as the
> >> backend on all platforms ?
> >
> > No, for various reasons:
>
> Again,thanks for the detailed explanation. As this is a recurrent
> topic,maybe it would be a good ideia to create a wiki page with all
> these points.
>
> And about GCC? It supports a wide variety of processors and OS.

90% of the same as for the LLVM backend applies. Also, it doesn't support
all the systems we do, not in mainline, or in current versions anyway.
Granted, these are usually smaller, less significant, or legacy systems,
but still...

I know these are the days of going Easy instead of staying Simple, but for
a lot of us the fact that FPC doesn't depend on any kind of other
monster-framework and backend of a competing product and language is
pretty much *the* killer feature...

But anyway, if someone wants to see a GCC-backend in FPC, he is welcomed
to work on it. But as a team-policy to migrate to it - no thanks.

Charlie
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] LLVM Backend Support

2016-08-31 Thread Karoly Balogh (Charlie/SGR)
Hi,

On Wed, 31 Aug 2016, Anthony Walter wrote:

> I'm not too familiar with LLVM so I'll ask, is it at all likely that an
> LLVM compiler would produce significantly better/faster optimizations
> than FPC as it stand currently? What range would be talking about 100%
> faster? Less? More?

We just had a C vs. Rust vs. FPC showdown with a colleague at work. He
wrote a small tight loop example with float maths, we ported it to three
languages, and we looked at the results.

C (clang/llvm) came first, Rust was closely behind, FPC was about 2x as
slow as Rust (which is llvm based as well). But it turned out, that if I
did some hand optimization by moving unchanging parts of some expressions
outside the innermost loop, plus enabled SSE42 for floating pointinstead
of x87, the speed matched the Rust implementation (which is again, LLVM
based). And no, no inline assembly was involved.

The big tricks in compilers are still Common Subexpression Elimination and
Single Static Assignment. Especially the later. Only if we could have a
good one of that...

But again, as Jonas said, this was an artificial benchmark of an abusive,
badly written tight loop, and with thousands of iterations, we're talking
about the ms range for results, on modern CPUs.

Charlie
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] LLVM Backend Support

2016-08-31 Thread African Wild Dog
Em quarta-feira, 31 de agosto de 2016, Jonas Maebe <
jonas.ma...@elis.ugent.be> escreveu:
> On 31/08/16 05:11, African Wild Dog wrote:
>>

> The code optimizers, yes. The rest, not so much.
>
>> Will the FPC team, somewhere in the future, adopt the LLVM as the
>> backend on all platforms ?
>
> No, for various reasons:

Again,thanks for the detailed explanation. As this is a recurrent
topic,maybe it would be a good ideia to create a wiki page with all these
points.

And about GCC? It supports a wide variety of processors and OS.

Regards
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] LLVM Backend Support

2016-08-31 Thread Jonas Maebe

On 31/08/16 21:47, Anthony Walter wrote:

I'm not too familiar with LLVM so I'll ask, is it at all likely that an
LLVM compiler would produce significantly better/faster optimizations
than FPC as it stand currently? What range would be talking about 100%
faster? Less? More?


It depends on the kind of code. The more pure maths (floating point or 
integer, especially in tight loops), the more likely it will be faster. 
Artificial benchmarks will also be much faster.


For a typical database program, I don't expect much change.

I can't give any figures.


Jonas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] LLVM Backend Support

2016-08-31 Thread Anthony Walter
I'm not too familiar with LLVM so I'll ask, is it at all likely that an
LLVM compiler would produce significantly better/faster optimizations than
FPC as it stand currently? What range would be talking about 100% faster?
Less? More?
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Libraries-search-path of /usr/bin/ld ?

2016-08-31 Thread fredvs
> From the 'fpc -h' output.
> -XdDo not search default library path (sometimes required for
> cross-compiling when not using -XR)

Excellent, sure, it is the solution. ;-)
I do not have my pc here, will try tonight.

Write you later.

Fre;D





-
Many thanks ;-)
--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/Libraries-search-path-of-usr-bin-ld-tp5726191p5726195.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Libraries-search-path of /usr/bin/ld ?

2016-08-31 Thread Graeme Geldenhuys
On 2016-08-31 16:59, fredvs wrote:
> Or, maybe *-Xd * is the solution.
> ... What is -Xd ?

>From the 'fpc -h' output.


-XdDo not search default library path (sometimes required for
cross-compiling when not using -XR)



Regards,
  Graeme

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Libraries-search-path of /usr/bin/ld ?

2016-08-31 Thread fredvs
Hello Graeme.

> Take a look in your ~/.fpc.cfg file. If the following doesn't exist, add
> it, and specify the correct paths to the 32-bit libraries as found on your
> system. 

Huh, of course it is the first thing that I did.
But, afaik, -Fl/something, has no impact on the search path of ld.

It seems that *ld* only want to search in /usr/lib.

> -Xd 

Or, maybe *-Xd * is the solution.
... What is -Xd ?

Many thanks.

Fre;D

PS: Do you have a idea how to link when using fpc-linux on a FreeBSD system
with Linux emulation enabled ?





-
Many thanks ;-)
--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/Libraries-search-path-of-usr-bin-ld-tp5726191p5726193.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Libraries-search-path of /usr/bin/ld ?

2016-08-31 Thread Graeme Geldenhuys
On 2016-08-31 16:25, fredvs wrote:
> Of course because /usr/lib/crti.o is 64 bit.
> 
> The 32 bit libraries are in /usr/lib32/ and in /usr/local/lib32.
> 
> How to tell to *ld* to search in /usr/lib32 + /usr/local/lib32 while
> linking?


Take a look in your ~/.fpc.cfg file. If the following doesn't exist, add
it, and specify the correct paths to the 32-bit libraries as found on
your system.

# cross-compiling to i386 support - special library path
#IFDEF cpui386
  -Fl/usr/local/lib32
  -Fl/usr/lib32
  -Xd
#ENDIF




Regards,
  Graeme

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] Libraries-search-path of /usr/bin/ld ?

2016-08-31 Thread fredvs
Hello.

How to define the search path of libraries while linking ?

In a FreeBSD 64 multiarch system, fpc32 compiles without problems but at
linking there is that message:

> /usr/bin/ld: skipping incompatible /usr/lib/crti.o when searching for
> /usr/lib/crti.o

Of course because /usr/lib/crti.o is 64 bit.

The 32 bit libraries are in /usr/lib32/ and in /usr/local/lib32.

How to tell to *ld* to search in /usr/lib32 + /usr/local/lib32 while
linking?

Similar problem on FreeBSD with Linux emulation enabled.
fpc-linux (with Linux-units installed) can compile on FreeBSD but at linking
there is a "ELF not recognized" message given by *ld*.

Can that be fixed too ?

PS: Absolutely no problem to compile and link using fpc.exe (via wine and
with Windows-units installed) on a FreeBSD 64 system.

Thanks.

Fre;D



-
Many thanks ;-)
--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/Libraries-search-path-of-usr-bin-ld-tp5726191.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal