When using JIT on FreeBSD 6.0, there are multiple failures in
t/op/trans.t. Most are geometric, sinh, tanh, and atan2, so these
might be covered by a previous report. But in particular are bugs in
pow. I've tried to track it down more specifically but I don't seen to
be succeeding, and only getting more confused.
Of test 18(pow) of t/op/trans.t, tests 1, 2, 3, 4, 5, 6, 11, and 15
fail. Generally either 0.0 is returned or nan. In trying to track it
down, I ran into something more confusing. Here's a program to
demonstrate it and it's return.
-------
.sub main :main
$N1 = 3.0
$N2 = 5.0
$N3 = pow $N1, $N2
print $N3
print "\n"
$N3 = pow $N1, $N2
print $N3
print "\n"
.end
-------
0.000000
243.000000
-------
I've also noticed that pow_n_nc_nc optimizes away to just set, and
trying -O0 doesn't disable optimization. With -O1 -j, it persists...
With -O2 -j, it disappears.
Running `./parrot -O2 -j t/op/trans_18.pasm`, only tests 2, 3, 4, 6,
11, and 15 fail, meaning 1 and 5 succeed with the optimization enabled.
Many of the tests in t/op/trans.t fail entirely with -O2, opcodes not
found, mainly because of using integer registers.
> When using JIT on FreeBSD 6.0, there are multiple failures in
> t/op/trans.t. Most are geometric, sinh, tanh, and atan2, so these
> might be covered by a previous report. But in particular are bugs in
> pow. I've tried to track it down more specifically but I don't seen to
> be succeeding, and only getting more confused.
Please have a look at docs/jit.pod and docs/debug.pod. Both have
sections how to debug JIT code with gdb/ddd.
> I've also noticed that pow_n_nc_nc optimizes away to just set, and
> trying -O0 doesn't disable optimization. With -O1 -j, it persists...
There are no opcodes with all constant integer or number arguments.
Therefore, during compilation, registers are set to the constants and an
opcode with equivalent registers is used to calculate the result. E.g.
the PASM 'opcode':
pow N3, 2.0, -4
is converted to
set N1, 2.0
set N2, -4
pow N0, N1, N2
and evaluated at compiletime. The result is then used and replaces the
original opcode:
set N3, 0.0625
> With -O2 -j, it disappears.
That's just a bug with -O2. Just ignore -O2 for now please.
leo
Thank you very much.
kid51
freebsd7, recent parrot svn (r29922)
passes the t/op/trans.t tests
Determining JIT capability.............................................yes
It even works with freebsd's make, not only gmake.
Summary of my parrot 0.6.4 (r0) configuration:
configdate='Sat Aug 2 13:08:54 2008 GMT'
Platform:
osname=freebsd, archname=i386-freebsd-64int
jitcapable=1, jitarchname=i386-freebsd,
jitosname=FREEBSD, jitcpuarch=i386
execcapable=1
perl=perl
Compiler:
cc='cc', ccflags='-DAPPLLIB_EXP="/usr/local/lib/perl5/5.8.8/BSDPAN"
-DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -pipe
-Wdeclaration-after-statement -I/usr/local/include -DHASATTRIBUTE_CONST
-DHASATTRIBUTE_DEPRECATED -DHASATTRIBUTE_MALLOC
-DHASATTRIBUTE_NONNULL -DHASATTRIBUTE_NORETURN -DHASATTRIBUTE_PURE
-DHASATTRIBUTE_UNUSED -DHASATTRIBUTE_WARN_UNUSED_RESULT
-falign-functions=16 -fvisibility=hidden -maccumulate-outgoing-args -W
-Wall -Waggregate-return -Wcast-align -Wcast-qual -Wchar-subscripts
-Wcomment -Wdisabled-optimization -Wendif-labels -Wextra -Wformat
-Wformat-extra-args -Wformat-nonliteral -Wformat-security -Wformat-y2k
-Wimplicit -Wimport -Winit-self -Winline -Winvalid-pch -Wmissing-braces
-Wmissing-field-initializers -Wno-missing-format-attribute
-Wmissing-include-dirs -Wpacked -Wparentheses -Wpointer-arith
-Wreturn-type -Wsequence-point -Wno-shadow -Wsign-compare
-Wstrict-aliasing -Wstrict-aliasing=2 -Wswitch -Wswitch-default
-Wtrigraphs -Wundef -Wunknown-pragmas -Wno-unused -Wvariadic-macros
-Wwrite-strings -Wbad-function-cast -Wc++-compat
-Wdeclaration-after-statement -Wimplicit-function-declaration
-Wimplicit-int -Wmain -Wmissing-declarations -Wmissing-prototypes
-Wnested-externs -Wnonnull -DHAS_GETTEXT',
Linker and Libraries:
ld='cc', ldflags=' -Wl,-E -L/usr/lib -L/usr/local/lib',
cc_ldflags='',
libs='-lm -lcrypt -lutil -pthread -lgmp -lreadline -lpcre -lcrypto
-lintl'
Dynamic Linking:
share_ext='.so', ld_share_flags='-shared -L/usr/lib -L/usr/local/lib',
load_ext='.so', ld_load_flags='-shared -L/usr/lib -L/usr/local/lib'
Types:
iv=long, intvalsize=4, intsize=4, opcode_t=long, opcode_t_size=4,
ptrsize=4, ptr_alignment=1 byteorder=1234,
nv=double, numvalsize=8, doublesize=8
--
Reini Urban
Thanks for looking into this, Reini. Now, would these failures have
cleared up because you're working on FreeBSD 7 as distinct from the
FreeBSD 6 on which the problems were reported?
I have no idea of the difference of freebsd6 to 7.
I assume there's nothing important, and that recent parrot fixes fixed that.
perl is still 5.8.8, gcc is now higher: 4.2.1
--
Reini Urban
http://phpwiki.org/ http://murbreak.at/