Skip to content

Commit

Permalink
Update recent changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Reini Urban committed Oct 4, 2012
1 parent 3fc61aa commit 18c5758
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 3 deletions.
5 changes: 4 additions & 1 deletion Changes
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@
Fixed Null COP storage for 5.16 and 5.17
amagic_generation was removed with 5.17
Fixed $$ ($PID) to be dynamic, issue 108. Thanks to flexvault for reporting this.
* CC (1.13): added check_entersub, check_bless - bless and new caching
Fixed double precision to 16 digits. The nbody shootout test passes now
* CC (1.13): added check_entersub, check_bless - bless and new caching.
Use the B::C integer and double precision logic (ivx, nvx).
Fixed double precision to 16 digits. The nbody shootout is now 2x faster than perl
* Bytecode (1.14): fixed require and op_first, issue 97
Fixed regex_pad offset in threaded perls >= 5.11, issue 68
* t/perldoc.t: perlcc fails with 5.8 because Cwd disturbs the
Expand Down
4 changes: 2 additions & 2 deletions Todo
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,14 @@ allocation of XPV[INAHC]V structures needs fixing: Perl tries to free
list the same as X[IPR]V structures.
ref counts
perl_parse replacement
NV overflow initialisation analog to ivx (ExtUtils::CBuilder)
CvOUTSIDE for ordinary subs

* Features

Detect ExtUtils::Constant autoloaded "Your vendor has not defined"
functions stubs. E.g. "WARNING: &Socket::AF_DATAKIT not found"
optimize static or typed method calls. How-perl-compiles-subs-and-methods.md
detect typed objects (my Class $obj = new Class;)
detect typed objects (my Class $obj = new Class;) (partially done)
modularize (-m) for faster link times
BEGIN goto optim: skip code after BEGIN goto
usually Carp including B in some AUTOLOAD block, issue 61
Expand Down Expand Up @@ -52,3 +51,4 @@ demand-loaded bytecode (leader of each basic block replaced by an op
which loads in bytecode for its block)
fast sub calls for CC backend
tailcall optimization (entersub -> leavesub => goto)
inline functions and methods
37 changes: 37 additions & 0 deletions ramblings/blogs-optimizing-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -465,3 +465,40 @@ optimized.
for (1..$n){
advance(0.01);
}

Increasing precision
--------------------

The casual reader might have noticed that the compiler result would
not pass the shootout precision tests as it produced an invalid
result.

Wanted: +-1e-8 with arg 1000

-0.169075164
-0.169087605

Have: with arg 1000

-0.169075214
-0.169087656

That's not even close, it's a 6 digit precision. The perl afficionado
might remember the Config settings `nvgformat` to print out NV, and
`d_longdbl` to define if `long double` is defined.

`long double` is however not used as NV, and worst `%g` is used as
printf format for NV, not `%.16g` as it should be done to keep double
precision. `%g` is just a pretty result to the casual reader, but not
suitable to keep precision, e.g. for Data::Dumper, YAML, JSON,
or the B::C or perlito compilers.

So I changed the NV format to %.16g with commit [3fc61aa](https://github.com/rurban/perl-compiler/commit/3fc61aa69af24d438a2983a15996362207443f43)
and the precision went up, passing the nbody shootout test with argument 1000.

New result with arg 1000

-0.169075164
-0.169087605

Exactly the same.

0 comments on commit 18c5758

Please sign in to comment.