Re: Quick try at building 64-bit on OSX 10.8.3

2013-05-25 Thread Alexander Burger
HI Jorge,

 Well, x64 sucks, no surprise here, but not as much as x86. Perhaps a
 good strategy here would be to use one of the C calling registers (%r9
 for instance) as a preloaded NIL. Restoring that value after calling C

Surely %r9 could be freed for general purposes. I don't remember if that
would solve any problem. Why do you think of NIL especially?

In fact, normal assembly already works well for position-independent
code (e.g. the shared 'ht' and 'ext' libraries are always built that
way). IIRC, there were nasty details with some core runtime code, but I
don't want to dig into that again.

♪♫ Alex
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: Quick try at building 64-bit on OSX 10.8.3

2013-05-25 Thread Jorge Acereda Maciá

On May 25, 2013, at 9:22 AM, Alexander Burger a...@software-lab.de wrote:

 HI Jorge,
 
 Well, x64 sucks, no surprise here, but not as much as x86. Perhaps a
 good strategy here would be to use one of the C calling registers (%r9
 for instance) as a preloaded NIL. Restoring that value after calling C
 
 Surely %r9 could be freed for general purposes. I don't remember if that
 would solve any problem. Why do you think of NIL especially?

You're right, upon deeper inspection it seems it doesn't solve any problem, it 
just postpones it.

--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: Quick try at building 64-bit on OSX 10.8.3

2013-05-24 Thread Alexander Burger
Hi Jorge,

 A quick question, what's the status of the *FPic variant on Linux? Is it 
 working?

If you mean the 64-bit version: Sorry, not at all ;-)


 If it works properly, I guess I could get it running on OSX as well when I 
 find some spare time...--

That would be great! I must say that I gave up on that, see e.g.

   http://www.mail-archive.com/picolisp@software-lab.de/msg03816.html

♪♫ Alex
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: Quick try at building 64-bit on OSX 10.8.3

2013-05-24 Thread Jorge Acereda Maciá
Hi Alex,

On May 24, 2013, at 10:49 AM, Alexander Burger a...@software-lab.de wrote:
 
 If it works properly, I guess I could get it running on OSX as well when I 
 find some spare time...--
 
 That would be great! I must say that I gave up on that, see e.g.
 
   http://www.mail-archive.com/picolisp@software-lab.de/msg03816.html

Well, x64 sucks, no surprise here, but not as much as x86. Perhaps a good 
strategy here would be to use one of the C calling registers (%r9 for instance) 
as a preloaded NIL. Restoring that value after calling C shouldn't be much of a 
problem and would probably make code cleaner and faster.
I've done some preliminary experiments with that and it looks promising. What 
do you think of such approach?


--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: Quick try at building 64-bit on OSX 10.8.3

2013-05-23 Thread Alexander Burger
Hi Jorge,

 Ok, if that's the problem this is nicer… Does it compile without
 warnings on your 32-bit system?

Yes. Great! That's better. I didn't know about 'uintptr_t', that's
exactly what we need here. Thanks!

So let's stay with this :)

♪♫ Alex
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: Quick try at building 64-bit on OSX 10.8.3

2013-05-23 Thread Jorge Acereda Maciá
Hi,

A quick question, what's the status of the *FPic variant on Linux? Is it 
working?
If it works properly, I guess I could get it running on OSX as well when I find 
some spare time...--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: Quick try at building 64-bit on OSX 10.8.3

2013-05-22 Thread Alexander Burger
Hi Jon,

 to see if something magical have happened that would make it
 possible for me to build 64-bit PicoLisp, so I did the (cd src64;
 ...
 runtime. As I'm not very convinced that such a Java SE 6 runtime
 would give me the 64-bit PicoLisp, I have not accepted that offer
 yet. Am I wrong? ;-)

If you install Java, you can cross-assemble PicoLisp via ErsatzLisp.
This is usually not necessary, because you might as well download the
pre-assembled '*.s'-files.

BUT: In case of the Mac, both approaches won't work, as the Mac's
a.out-format is still not supported (you know .. ye old problems).

So better don't install Java ;-)

♪♫ Alex
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: Quick try at building 64-bit on OSX 10.8.3

2013-05-22 Thread Jorge Acereda Maciá
I tried to build the emu version on OSX and it failed. Here is the culprit line:



emu.patch
Description: Binary data


Regards,
  Jorge


On May 22, 2013, at 5:24 PM, Alexander Burger a...@software-lab.de wrote:

 Hi Jon,
 
 to see if something magical have happened that would make it
 possible for me to build 64-bit PicoLisp, so I did the (cd src64;
 ...
 runtime. As I'm not very convinced that such a Java SE 6 runtime
 would give me the 64-bit PicoLisp, I have not accepted that offer
 yet. Am I wrong? ;-)
 
 If you install Java, you can cross-assemble PicoLisp via ErsatzLisp.
 This is usually not necessary, because you might as well download the
 pre-assembled '*.s'-files.
 
 BUT: In case of the Mac, both approaches won't work, as the Mac's
 a.out-format is still not supported (you know .. ye old problems).
 
 So better don't install Java ;-)
 
 ♪♫ Alex
 -- 
 UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe



Re: Quick try at building 64-bit on OSX 10.8.3

2013-05-22 Thread Alexander Burger
Hi Jorge,

 I tried to build the emu version on OSX and it failed. Here is the culprit 
 line:

Thanks! Unfortunately, it is not so easy, because then you get a warning
on 32-bit systems:

   cast from pointer to integer of different size [-Wpointer-to-int-cast]


So for 32-bits, we must still first cast to an uint32_t. I'd say we
change it to:

   ...
   (p
  (if *Bits64
 (_genCC A.n = (uint64_t)(uint8_t*)@1(@2);@3)
 (_genCC A.n = (uint64_t)(uint32_t)(uint8_t*)@1(@2);@3) ) )
   ...

Does this work for you? If so, I'll put it into the release.

♪♫ Alex
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: Quick try at building 64-bit on OSX 10.8.3

2013-05-22 Thread Jorge Acereda Maciá

On May 22, 2013, at 8:19 PM, Alexander Burger a...@software-lab.de wrote:

 Hi Jorge,
 
 I tried to build the emu version on OSX and it failed. Here is the culprit 
 line:
 
 Thanks! Unfortunately, it is not so easy, because then you get a warning
 on 32-bit systems:
 
   cast from pointer to integer of different size [-Wpointer-to-int-cast]
 
 
 So for 32-bits, we must still first cast to an uint32_t. I'd say we
 change it to:
 
   ...
   (p
  (if *Bits64
 (_genCC A.n = (uint64_t)(uint8_t*)@1(@2);@3)
 (_genCC A.n = (uint64_t)(uint32_t)(uint8_t*)@1(@2);@3) ) )
   ...
 
 Does this work for you? If so, I'll put it into the release.

Ok, if that's the problem this is nicer… Does it compile without warnings on 
your 32-bit system?




emu2.patch
Description: Binary data