[fpc-pascal] fast integer multiplication

2005-07-21 Thread Vincent Snijders

Hi,

Suppose I have the following code:

var
  a,b: dword;
  c: qword;

begin
  a := 1000;
  b := 2000;
  c := a * b;
  writeln(c);
end.

Now, although c is large enough to contain the result only the lower 
dword is filled. I can force correct results by using c := qword(a) * b, 
but the slow fpc_mul_qword is used.


The code generated for the above sample is:
# [16] c:=a*b;
movlU_P$PROJECT1_A,%edx
movlU_P$PROJECT1_B,%eax
mull%edx
movl$0,%edx
movl%eax,U_P$PROJECT1_C
movl%edx,U_P$PROJECT1_C+4

What I want is the above code, but without the "movl $0,%edx" 
instruction. Is there a way to do this (wihtout using fpc_mul_qword).


Regards,
Vincent.

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


[fpc-pascal] Translating scientific libraries

2005-07-21 Thread Agustin Barto
I'd like to use some scientific/math librearies like LAPACK and
GNU/GSL with fpc. I already know about h2pas and external subroutines
and variables, but I wanted to know if these methods will be able to
deal with libraries as complex as LAPACK (clapack obviously) and GSL.

I'm porting my graduate thesis project to fpc. It was developed
entirely on Delphi 7, but fpc compiles it with just a few warnings.
Awesome.

This program uses my own algebraic library based on the Jedi_Math work
(which was too slow for my purposes) and I want to replace it with
something faster.

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


Re: [fpc-pascal] Translating scientific libraries

2005-07-21 Thread Michael Van Canneyt


On Thu, 21 Jul 2005, Agustin Barto wrote:

> I'd like to use some scientific/math librearies like LAPACK and
> GNU/GSL with fpc. I already know about h2pas and external subroutines
> and variables, but I wanted to know if these methods will be able to
> deal with libraries as complex as LAPACK (clapack obviously) and GSL.

Yes, it should work. 

>From what I remember (c)LAPACK is quite a simple library in terms 
of headers.  If you need help with translating, I'm quite willing 
to help, and I'd definitely consider distributing the translated 
headers with FPC.

I don't know about GSL, so I can't help you there.

> I'm porting my graduate thesis project to fpc. It was developed
> entirely on Delphi 7, but fpc compiles it with just a few warnings.
> Awesome.

We like to think so too ;-)

> 
> This program uses my own algebraic library based on the Jedi_Math work
> (which was too slow for my purposes) and I want to replace it with
> something faster.

If you need help, let me know.

Michael.

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


[fpc-pascal] Sharp Zaurus ARM port stability?

2005-07-21 Thread Matt Emson
Just laid my hands on a used Zaurus SL5500. I was wondering how stable the
Zaurus cross compiler and QT wrapper were? I realise this is slightly off
topic, but I remember the developer working on the bindings posted to this
list a while back.

Any info?

TTFN,

Matt


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


Re: [fpc-pascal] Sharp Zaurus ARM port stability?

2005-07-21 Thread Florian Klaempfl
Matt Emson wrote:

> Just laid my hands on a used Zaurus SL5500. I was wondering how stable the
> Zaurus cross compiler and QT wrapper were? 

Should be very usable.

> I realise this is slightly off
> topic, but I remember the developer working on the bindings posted to this
> list a while back.
> 
> Any info?

http://users.pandora.be/Jan.Van.hijfte/qtforfpc/qtedemo.html


> 
> TTFN,
> 
> Matt
> 
> 
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal


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


[fpc-pascal] Mac OS X Pascal Interfaces

2005-07-21 Thread Adriaan van Os
The latest version of the Mac OS X Pascal Interfaces 
 can be downloaded from 
. Detailed release notes are included 
with the package, a summary is given below.


Most important news is that compatible interfaces for FPC have been 
added.


I have to thank Peter N. Lewis and Gale Paeper for the effort they put 
in this new release and Olle Raab for his help in creating the FPC 
interfaces.


Regards,

Adriaan van Os


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


Re: [fpc-pascal] Sharp Zaurus ARM port stability?

2005-07-21 Thread Den Jean
On Thursday 21 July 2005 04:22 pm, Florian Klaempfl wrote:
> > I realise this is slightly off
> > topic, but I remember the developer working on the bindings posted to this
> > list a while back.
> > 

The fpc qte binding demo program shows that it is usable.
If however you have problems and think it is binding or fpc
related, I am always willing to investigate this.
I just did so for someone who had a problem with QLCDNumber,
it probably is a small fpc bug concerning passing a double parameter.

If you use something else than Mandrake, it would be nice if 
you could adapt my installation instructions to match your
experience on your distro. I will add then update my webpage and
the fpc wiki (they need an update anyhow)

http://users.pandora.be/Jan.Van.hijfte/qtforfpc/qtedemo.html
http://www.freepascal.org/wiki/index.php/Setup_Cross_Compile_For_ARM

 kind regards,

Den Jean

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


Re: [fpc-pascal] Sharp Zaurus ARM port stability?

2005-07-21 Thread Marc Perkel

How do I get off this list? I'd like to turn it off for now.


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


Re: [fpc-pascal] Sharp Zaurus ARM port stability?

2005-07-21 Thread Marc Perkel

Never mind - i figured it out - duh I'm such and idiot!

Marc Perkel wrote:


How do I get off this list? I'd like to turn it off for now.


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



--
Marc Perkel - [EMAIL PROTECTED]

Spam Filter: http://www.junkemailfilter.com
   My Blog: http://marc.perkel.com


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


Re: [fpc-pascal] Sharp Zaurus ARM port stability?

2005-07-21 Thread Vincent Snijders

Marc Perkel wrote:

How do I get off this list? I'd like to turn it off for now.


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


Take a look at the URL posted at the bottom of this mail.

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


Re: [fpc-pascal] Sharp Zaurus ARM port stability?

2005-07-21 Thread Jonas Maebe


On 21 Jul 2005, at 16:57, Marc Perkel wrote:


How do I get off this list? I'd like to turn it off for now.

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


Go to the above url, enter your email address in the field at the  
bottom of the page and click "Unsubscribe or edit options".



Jonas

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


Re: [fpc-pascal] Sharp Zaurus ARM port stability?

2005-07-21 Thread Matt Emson
> The fpc qte binding demo program shows that it is usable.
> If however you have problems and think it is binding or fpc
> related, I am always willing to investigate this.
> I just did so for someone who had a problem with QLCDNumber,
> it probably is a small fpc bug concerning passing a double parameter.
>
> If you use something else than Mandrake, it would be nice if
> you could adapt my installation instructions to match your
> experience on your distro. I will add then update my webpage and
> the fpc wiki (they need an update anyhow)
>
> http://users.pandora.be/Jan.Van.hijfte/qtforfpc/qtedemo.html
> http://www.freepascal.org/wiki/index.php/Setup_Cross_Compile_For_ARM

Excellent. I do have a Mandrake 8.1 and Mandrake 9.0 install CD hanging
about. Are either of those preferable? I would also like to get it going
under Windows.. just because I know I'll be in Windows for more frequently.
Was there a specific reason for using LINUX, bar the obvious QTE runs on
Zaurus, Zaurus uses LINUX thing?

Matt


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


Re: [fpc-pascal] Sharp Zaurus ARM port stability?

2005-07-21 Thread Den Jean
On Thursday 21 July 2005 05:21 pm, Matt Emson wrote:

> Excellent. I do have a Mandrake 8.1 and Mandrake 9.0 install CD hanging
> about. Are either of those preferable? I would also like to get it going
> under Windows.. just because I know I'll be in Windows for more frequently.
> Was there a specific reason for using LINUX, bar the obvious QTE runs on
> Zaurus, Zaurus uses LINUX thing?
> 

I do not program in windows anymore, so I did not try 
to have a windows version of the qt embedded binding.
It was already enough work in itself.  You are ofcourse free
to make one :-)

The binding is made in C/C++, one of the makefiles is 2730 lines. 
So it helped me remember why I prefer to code in pascal. 
Compiling the binding was a nightmare, because of the incompatibilities
between the c-compilers. You need the exact same compiler
as the one the qt/embedded library was created with. And it is impossible
to just take the source of that compiler and compile it
with a recent compiler, the compiler source is not compatible
anymore. So you need to cycle back several times.

Mandrake: You can always download a fresher iso. It is worth it.
Kylix works fine till and including version 10.1 (so not 2005 or 10.2, but that 
is off list)

kind regards,

Den Jean

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


Re: [fpc-pascal] Sharp Zaurus ARM port stability?

2005-07-21 Thread Alain Vitry

Den,
Could you point me to some reading/starting point on how to make those 
bindings ?

Swig doesn't support pascal yet.
I have  a fresh QT4 bindings for pascal in mind.
Thanks

Le 21 juil. 05, à 18:46, Den Jean a écrit :



The binding is made in C/C++, one of the makefiles is 2730 lines.
So it helped me remember why I prefer to code in pascal.
Compiling the binding was a nightmare, because of the incompatibilities
between the c-compilers. 


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


Re: [fpc-pascal] Translating scientific libraries

2005-07-21 Thread C Western

Michael Van Canneyt wrote:


On Thu, 21 Jul 2005, Agustin Barto wrote:

 


I'd like to use some scientific/math librearies like LAPACK and
GNU/GSL with fpc. I already know about h2pas and external subroutines
and variables, but I wanted to know if these methods will be able to
deal with libraries as complex as LAPACK (clapack obviously) and GSL.
   



Yes, it should work. 
 

I have used (parts of) lapack without problems. You just need lots of 
declarations like:


function dsytrd_(var uplo: Char; var n: Integer; var a: Double; var lda: 
Integer; var d__: Double; var e: Double; var tau: Double; var work: 
Double; var lwork: Integer; var info: Integer; uplo_len: Integer): 
Integer; cdecl; external;

(It is possible to generate these semi-automatically with f2c)

and a {$LINKLIB lapack}

It may also be appropriate to override a few support routines, like the 
error reporting routine.


Colin



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


Re: [fpc-pascal] Sharp Zaurus ARM port stability?

2005-07-21 Thread Den Jean
On Thursday 21 July 2005 06:53 pm, Alain Vitry wrote:
> Den,
> Could you point me to some reading/starting point on how to make those 
> bindings ?
> Swig doesn't support pascal yet.
> I have  a fresh QT4 bindings for pascal in mind.
> Thanks

There are several ways:

kalyptus: see cvs/fpc/utils/kalyptus 
google on kde bindings / qt bindings
Florian started from the c-kalyptus one.

http://www.lazarus.freepascal.org/list_archives/lazarus/08-17-02_01-02-04/msg04138.html

smoke: more for scripting languages

smoke/refract: c++ headers to xml using the gcc parsing capability.
C++ may look to be the perfect parser for c++,  

but qt is not c++ but an enhanced delphi like 
language (hence why the moc)
so distance to qt language is big.
http://wiki.dotgnu.info/Smoke/Refract

freeclx: based on moc parsing. Moc converts qt language to c++. 
 So Moc is close to the qt language and it gives you a very 
able parser.
 With some modifications to the lex/yacc you can let moc 
produce a pascal qt binding. 
 
 But each time trolltech adds to the qt language, they 
renew the moc, 
 then you need to port your adaptations to the moc lex/yacc 
again.

 We adapted the qt part of freeclx from qt 2.2.4 to qt 
2.3.2 and qt/embedded
 The result is on 
http://cvs.sourceforge.net/viewcvs.py/qtforfpc/qt2/FreeClx/
  
qtc binding:  as pascal can easily use c-libraries, the qtc binding 
seems a good base 
but difficult to maintain at each update of the qtc 
binding.
Andreas Hausladen is very productive in this 
matter. (allready qt3 binding),
I guess qt4 is in the make. Perhaps you can join 
forces with him.
http://andy.jgknet.de/oss/qt/qt3forFPC/

http://andy.jgknet.de/oss/kylix/wiki/index.php/Qt3_for_Kylix


kind regards,

Den Jean 

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


[fpc-pascal] How to know if an objects implements an interface

2005-07-21 Thread Agustin Barto
I have a class that has a TObject field. In some of the instances of
this class the field will contain an objetct from a class that
implements certain interface. What can I do to check if the referenced
object implements the interface?

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