ChanServ changed the topic of #picolisp to: PicoLisp language | Channel Log: https://irclog.whitequark.org/picolisp/ | Check also http://www.picolisp.com for more information
freemint has quit [Ping timeout: 264 seconds]
xkapastel has joined #picolisp
andyjpb has quit [Ping timeout: 268 seconds]
freemint has joined #picolisp
freeemint has joined #picolisp
freemint has quit [Read error: Connection reset by peer]
karswell has quit [Remote host closed the connection]
xkapastel has quit [Quit: Connection closed for inactivity]
DKordic has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
aw- has quit [Ping timeout: 265 seconds]
aw- has joined #picolisp
freeemint has quit [Ping timeout: 264 seconds]
jibanes has quit [Ping timeout: 268 seconds]
jibanes has joined #picolisp
orivej has joined #picolisp
orivej has quit [Ping timeout: 246 seconds]
orivej has joined #picolisp
<Regenaxer> tankf33der here?
<tankf33der> o/
<Regenaxer> Can you find out what ssize_t is on 32 bit systems
<Regenaxer> ?
<tankf33der> yea
<Regenaxer> eg. from man 2 read, we have:
<Regenaxer> ssize_t read(int fd, void *buf, size_t count);
<Regenaxer> I think it should be 64 bit everywhere
<Regenaxer> ah, size_t I mean
<Regenaxer> ssize_t too
<Regenaxer> Sorry for the confusion ;)
<tankf33der> i see 4 on 32bit and 8 on 64bit.
<tankf33der> both size_t and ssize_t.
<Regenaxer> oh, I see. Thanks!
<Regenaxer> (I still have portability in mind ;)
<Regenaxer> So ok, no problem
<Regenaxer> I'm making glue functions in C for all such system-dependent parts
<tankf33der> yea.
<Regenaxer> My plan is still to have main.bc system-independent (despite the LLVM people always say that LLVM-IR code is not portable)
<Regenaxer> I put all such code into src/lib.c and src/pico.h
orivej has quit [Ping timeout: 240 seconds]
freeemint has joined #picolisp
<Regenaxer> tankf33der, once more with our SymTab problem
<Regenaxer> The C code corresponding to the ll code we used is:
<Regenaxer> int64_t SymTab[] = {
<Regenaxer> (int64_t)(SymTab + 2),
<Regenaxer> 22,
<Regenaxer> 79992034,
<Regenaxer> 0
<Regenaxer> };
<Regenaxer> If I compile this on 64 bits, we get what we communicated:
<Regenaxer> Could you compile this on 32 bits and see what LL gets generated?
<Regenaxer> on 64 bits we got, as you know,
<Regenaxer> i64 ptrtoint (
<Regenaxer> i8* getelementptr (i8, i8* bitcast ([4 x i64]* @SymTab to i8*), i32 8)
<Regenaxer> to i64 ),
<tankf33der> today.
<Regenaxer> :)
<Regenaxer> no hurry
<tankf33der> i dont understand what to compile ?
<Regenaxer> Just the int64_t SymTab[] code into a .c file
<Regenaxer> then save the output of:
<Regenaxer> clang -O3 -emit-llvm xxx.c -c -o - |llvm-dis
<Regenaxer> if xxx.c is the file
<Regenaxer> s/save/pastebin
<tankf33der> sym2.c:1:1: error: unknown type name 'int64_t'
<tankf33der> ^
<tankf33der> (int64_t)(SymTab + 2),
<tankf33der> int64_t SymTab[] = {
<tankf33der> sym2.c:2:2: error: use of undeclared identifier 'int64_t'
<tankf33der> ^
<tankf33der> 2 errors generated.
<tankf33der> llvm-dis: error: Invalid bitcode signature
<Regenaxer> the second is a follow-up
<Regenaxer> you need the types include
<Regenaxer> I think this is enough:
<Regenaxer> #include <stdlib.h>
<tankf33der> this is 64bit.
<Regenaxer> ok, exactly what I have too
<Regenaxer> (and what we posted)
<Regenaxer> So now 32 bits will be interesting :)
<tankf33der> alpi386:~# clang -O3 -emit-llvm sym2.c -c -o - |llvm-dis
<tankf33der> sym2.c:3:22: error: initializer element is not a compile-time constant
<tankf33der> 1 error generated.
<tankf33der> ^~~~~~~~~~~~~~~~~~~~~
<tankf33der> int64_t SymTab[] = { (int64_t)(SymTab + 2), 79992034, 22, 0 };
<tankf33der> llvm-dis: error: file too small to contain bitcode header
<Regenaxer> uh
<Regenaxer> strange
<Regenaxer> It is a compile-time constant on 64 too ;)
<tankf33der> trying older version
<Regenaxer> Not necessary I think
<Regenaxer> Let me think of another syntax
<Regenaxer> In 'emu' I do something like that
<Regenaxer> but not with a cast (int64_t)(SymTab + 2),
<Regenaxer> but with a union
<Regenaxer> Need to investigate
<Regenaxer> Thanks for now! Again we know clang is stupid
<tankf33der> llvm 3.4.2 the same error
<Regenaxer> yeah, will not change
<Regenaxer> Perhaps future versions if they make clang more clever
<Regenaxer> (what I doubt)
freeemint has quit [Ping timeout: 264 seconds]
freeemint has joined #picolisp
freeemint has quit [Ping timeout: 250 seconds]
freeemint has joined #picolisp
orivej has joined #picolisp
andyjpb has joined #picolisp
orivej has quit [Ping timeout: 268 seconds]
orivej has joined #picolisp
jibanes has quit [Ping timeout: 276 seconds]
orivej has quit [Ping timeout: 246 seconds]
jibanes has joined #picolisp
xkapastel has joined #picolisp
orivej has joined #picolisp
orivej has quit [Ping timeout: 240 seconds]
<Regenaxer> tankf33der?
<Regenaxer> I think this *may* work also on 32 bit: http://ix.io/20NB
<Regenaxer> But the output is sooo ugly, I don't like it
<Regenaxer> If SymTab gets larger, it puts "%union.op, %union.op, %union.op ..." on every line, with so many %union.op's as there a lines
<Regenaxer> So the size explodes with the square of the table length :(
<tankf33der> i will try today.
<Regenaxer> ok
<Regenaxer> But this can't be really something usable :(
xkapastel has quit [Quit: Connection closed for inactivity]
freeemint has quit [Remote host closed the connection]
freeemint has joined #picolisp
freeemint has quit [Ping timeout: 245 seconds]
freeemint has joined #picolisp
orivej has joined #picolisp
f8l has quit [Remote host closed the connection]
f8l has joined #picolisp
freeemint has quit [Ping timeout: 250 seconds]
sarna has quit [Quit: bye]
freeemint has joined #picolisp
sarna has joined #picolisp
freeemint has quit [Ping timeout: 245 seconds]