[svn:parrot] r40487 - in branches/auto_attrs: . config/auto/sizes docs/book/draft docs/book/pct docs/dev docs/pdds examples/embed examples/languages/abc examples/languages/squaak examples/pge include/parrot ports/cpan ports/cygwin ports/debian ports/fedora ports/mandriva ports/suse runtime/parrot/include runtime/parrot/languages runtime/parrot/library/Math src/call src/dynoplibs src/gc src/interp src/ops src/runcore t/codingstd t/compilers/tge t/dynoplibs t/oo t/pmc t/src tools/dev tools/util
NotFound at svn.parrot.org
NotFound at svn.parrot.org
Tue Aug 11 08:02:53 UTC 2009
Author: NotFound
Date: Tue Aug 11 08:02:51 2009
New Revision: 40487
URL: https://trac.parrot.org/parrot/changeset/40487
Log:
merge from trunk r40486
Added:
branches/auto_attrs/t/dynoplibs/obscure.t
- copied unchanged from r40486, trunk/t/dynoplibs/obscure.t
Modified:
branches/auto_attrs/ (props changed)
branches/auto_attrs/MANIFEST
branches/auto_attrs/config/auto/sizes/intval_maxmin_c.in (props changed)
branches/auto_attrs/docs/book/draft/README (props changed)
branches/auto_attrs/docs/book/draft/appa_glossary.pod (props changed)
branches/auto_attrs/docs/book/draft/appb_patch_submission.pod (props changed)
branches/auto_attrs/docs/book/draft/appc_command_line_options.pod (props changed)
branches/auto_attrs/docs/book/draft/appd_build_options.pod (props changed)
branches/auto_attrs/docs/book/draft/appe_source_code.pod (props changed)
branches/auto_attrs/docs/book/draft/ch01_introduction.pod (props changed)
branches/auto_attrs/docs/book/draft/ch02_getting_started.pod (props changed)
branches/auto_attrs/docs/book/draft/ch07_dynpmcs.pod (props changed)
branches/auto_attrs/docs/book/draft/ch08_dynops.pod (props changed)
branches/auto_attrs/docs/book/draft/ch10_opcode_reference.pod (props changed)
branches/auto_attrs/docs/book/draft/ch11_directive_reference.pod (props changed)
branches/auto_attrs/docs/book/draft/ch12_operator_reference.pod (props changed)
branches/auto_attrs/docs/book/draft/chXX_hlls.pod (props changed)
branches/auto_attrs/docs/book/draft/chXX_library.pod (props changed)
branches/auto_attrs/docs/book/draft/chXX_testing_and_debugging.pod (props changed)
branches/auto_attrs/docs/book/pct/ch01_introduction.pod (props changed)
branches/auto_attrs/docs/book/pct/ch02_getting_started.pod (props changed)
branches/auto_attrs/docs/book/pct/ch03_compiler_tools.pod (props changed)
branches/auto_attrs/docs/book/pct/ch04_pge.pod (props changed)
branches/auto_attrs/docs/book/pct/ch05_nqp.pod (props changed)
branches/auto_attrs/docs/dev/c_functions.pod (props changed)
branches/auto_attrs/docs/pdds/pdd30_install.pod (props changed)
branches/auto_attrs/examples/embed/cotorra.c (props changed)
branches/auto_attrs/examples/languages/abc/ (props changed)
branches/auto_attrs/examples/languages/squaak/ (props changed)
branches/auto_attrs/examples/pge/demo.pir (props changed)
branches/auto_attrs/include/parrot/call.h (props changed)
branches/auto_attrs/include/parrot/gc_api.h (props changed)
branches/auto_attrs/include/parrot/runcore_api.h (props changed)
branches/auto_attrs/include/parrot/runcore_trace.h (props changed)
branches/auto_attrs/ports/cpan/pause_guide.pod (props changed)
branches/auto_attrs/ports/cygwin/parrot-1.0.0-1.cygport (props changed)
branches/auto_attrs/ports/debian/libparrot-dev.install.in (props changed)
branches/auto_attrs/ports/debian/libparrot.install.in (props changed)
branches/auto_attrs/ports/debian/parrot-doc.install.in (props changed)
branches/auto_attrs/ports/debian/parrot.install.in (props changed)
branches/auto_attrs/ports/fedora/parrot.spec.fedora (props changed)
branches/auto_attrs/ports/mandriva/parrot.spec.mandriva (props changed)
branches/auto_attrs/ports/suse/parrot.spec.suse (props changed)
branches/auto_attrs/runtime/parrot/include/fp_equality.pasm
branches/auto_attrs/runtime/parrot/languages/ (props changed)
branches/auto_attrs/runtime/parrot/library/Math/Rand.pir (props changed)
branches/auto_attrs/src/call/ops.c (props changed)
branches/auto_attrs/src/call/pcc.c (props changed)
branches/auto_attrs/src/dynoplibs/obscure.ops
branches/auto_attrs/src/gc/alloc_memory.c (props changed)
branches/auto_attrs/src/gc/alloc_register.c (props changed)
branches/auto_attrs/src/gc/alloc_resources.c (props changed)
branches/auto_attrs/src/gc/api.c (props changed)
branches/auto_attrs/src/gc/generational_ms.c (props changed)
branches/auto_attrs/src/gc/incremental_ms.c (props changed)
branches/auto_attrs/src/gc/malloc.c (props changed)
branches/auto_attrs/src/gc/malloc_trace.c (props changed)
branches/auto_attrs/src/gc/mark_sweep.c (props changed)
branches/auto_attrs/src/gc/system.c (props changed)
branches/auto_attrs/src/interp/inter_cb.c (props changed)
branches/auto_attrs/src/interp/inter_create.c (props changed)
branches/auto_attrs/src/interp/inter_misc.c (props changed)
branches/auto_attrs/src/ops/core.ops
branches/auto_attrs/src/runcore/cores.c (props changed)
branches/auto_attrs/src/runcore/main.c (props changed)
branches/auto_attrs/src/runcore/trace.c (props changed)
branches/auto_attrs/t/codingstd/test_file_coverage.t
branches/auto_attrs/t/compilers/tge/NoneGrammar.tg (props changed)
branches/auto_attrs/t/oo/root_new.t (props changed)
branches/auto_attrs/t/pmc/complex.t
branches/auto_attrs/t/pmc/string.t
branches/auto_attrs/t/src/embed.t (props changed)
branches/auto_attrs/tools/dev/fetch_languages.pl (props changed)
branches/auto_attrs/tools/dev/mk_gitignore.pl (props changed)
branches/auto_attrs/tools/util/perlcritic-cage.conf (props changed)
Modified: branches/auto_attrs/MANIFEST
==============================================================================
--- branches/auto_attrs/MANIFEST Tue Aug 11 07:56:32 2009 (r40486)
+++ branches/auto_attrs/MANIFEST Tue Aug 11 08:02:51 2009 (r40487)
@@ -1672,6 +1672,7 @@
t/distro/file_metadata.t [test]
t/distro/manifest.t [test]
t/distro/meta_yml.t [test]
+t/dynoplibs/obscure.t [test]
t/dynpmc/dynlexpad.t [test]
t/dynpmc/foo.t [test]
t/dynpmc/foo2.t [test]
Modified: branches/auto_attrs/runtime/parrot/include/fp_equality.pasm
==============================================================================
--- branches/auto_attrs/runtime/parrot/include/fp_equality.pasm Tue Aug 11 07:56:32 2009 (r40486)
+++ branches/auto_attrs/runtime/parrot/include/fp_equality.pasm Tue Aug 11 08:02:51 2009 (r40487)
@@ -7,7 +7,7 @@
=head1 DESCRIPTION
-This file provides two PIR macros to determine if a pair of floating point numbers are equivalent.
+This file provides PIR macros to determine if a pair of floating point numbers are equivalent.
The same macros are also provided for PASM.
=cut
@@ -23,6 +23,18 @@
.label $FPEQNOK:
.endm
+.macro fp_eq_ok ( J, K, L )
+ set $N10, .J
+ set $N11, .K
+ sub $N12, $N11, $N10
+ abs $N12, $N12
+
+ set $I0, 0
+ gt $N12, 0.000001, .$FPEQNOK
+ set $I0, 1
+.label $FPEQNOK:
+ ok( $I0, .L )
+.endm
.macro fp_ne ( J, K, L )
set $N10, .J
Modified: branches/auto_attrs/src/dynoplibs/obscure.ops
==============================================================================
--- branches/auto_attrs/src/dynoplibs/obscure.ops Tue Aug 11 07:56:32 2009 (r40486)
+++ branches/auto_attrs/src/dynoplibs/obscure.ops Tue Aug 11 08:02:51 2009 (r40487)
@@ -11,13 +11,14 @@
=head1 NAME
-obscure.ops - Obscure Mathmatical Opcodes
+obscure.ops - Obscure Mathematical Opcodes
=cut
=head1 DESCRIPTION
-Parrot's library of obscure ops.
+Parrot's library of obscure mathematical ops. These turn common
+trig expressions into a single op.
To use this library of ops, add this directive to your PIR:
@@ -103,7 +104,7 @@
=head1 COPYRIGHT
-Copyright (C) 2001-2008, Parrot Foundation.
+Copyright (C) 2001-2009, Parrot Foundation.
=head1 LICENSE
Modified: branches/auto_attrs/src/ops/core.ops
==============================================================================
--- branches/auto_attrs/src/ops/core.ops Tue Aug 11 07:56:32 2009 (r40486)
+++ branches/auto_attrs/src/ops/core.ops Tue Aug 11 08:02:51 2009 (r40487)
@@ -800,7 +800,9 @@
opcode_t *const ret = expr NEXT();
PMC *resume = new_ret_continuation_pmc(interp, ret);
if (PMC_IS_NULL(except) || except->vtable->base_type != enum_class_Exception)
- except = Parrot_ex_build_exception(interp, EXCEPT_fatal, 1, NULL);
+ except = Parrot_ex_build_exception(interp, EXCEPT_fatal,
+ EXCEPTION_UNIMPLEMENTED,
+ Parrot_str_new_constant(interp, "Not a throwable object"));
/*
* We might return here after handling the exception, so mark the
* current context appropriately.
@@ -815,7 +817,9 @@
opcode_t * dest;
PMC * except = $1;
if (PMC_IS_NULL(except) || except->vtable->base_type != enum_class_Exception)
- except = Parrot_ex_build_exception(interp, EXCEPT_fatal, 1, NULL);
+ except = Parrot_ex_build_exception(interp, EXCEPT_fatal,
+ EXCEPTION_UNIMPLEMENTED,
+ Parrot_str_new_constant(interp, "Not a throwable object"));
dest = Parrot_ex_throw_from_op(interp, $1,
VTABLE_get_pointer(interp, $2));
goto ADDRESS(dest);
@@ -825,7 +829,9 @@
opcode_t * dest;
if (PMC_IS_NULL($1) || $1->vtable->base_type != enum_class_Exception) {
opcode_t * const ret = expr NEXT();
- PMC * except = Parrot_ex_build_exception(interp, EXCEPT_fatal, 1, NULL);
+ PMC * except = Parrot_ex_build_exception(interp, EXCEPT_fatal,
+ EXCEPTION_UNIMPLEMENTED,
+ Parrot_str_new_constant(interp, "Not a throwable object"));
dest = Parrot_ex_throw_from_op(interp, except, ret);
goto ADDRESS(dest);
}
Modified: branches/auto_attrs/t/codingstd/test_file_coverage.t
==============================================================================
--- branches/auto_attrs/t/codingstd/test_file_coverage.t Tue Aug 11 07:56:32 2009 (r40486)
+++ branches/auto_attrs/t/codingstd/test_file_coverage.t Tue Aug 11 08:02:51 2009 (r40487)
@@ -63,7 +63,6 @@
# Tests in src/dynoplibs
{
- local $TODO = "obscure.ops needs tests. (TT #819)";
ok( !@$test_dynoplibs_miss, "there are test files in $test_dynoplibs_dir for all OPS files" )
or diag "files in $dynoplibs_dir but not in test dir:\n\t@$test_dynoplibs_miss";
}
Copied: branches/auto_attrs/t/dynoplibs/obscure.t (from r40486, trunk/t/dynoplibs/obscure.t)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/auto_attrs/t/dynoplibs/obscure.t Tue Aug 11 08:02:51 2009 (r40487, copy of r40486, trunk/t/dynoplibs/obscure.t)
@@ -0,0 +1,106 @@
+#! parrot
+# Copyright (C) 2009, Parrot Foundation.
+# $Id$
+
+=head1 NAME
+
+t/dynoplibs/obscure.t - Tests for obscure mathematical functions
+
+=head1 SYNOPSIS
+
+ % prove t/dynoblibs/obscure.t
+
+=head1 DESCRIPTION
+
+Tests obscure.ops
+
+=cut
+
+.loadlib 'obscure_ops'
+.sub main :main
+ .include 'fp_equality.pasm'
+ .include 'test_more.pir'
+ plan(17)
+ ok(1,"load obscure_ops")
+
+ test_covers()
+ test_vers()
+ test_hav()
+ test_exsec()
+.end
+
+.sub test_covers
+ .local num x, pi, halfpi, y
+ y = atan 1.0, 1.0
+ halfpi = y
+ halfpi *= 2
+ pi = halfpi
+ pi *= 2
+ covers x, 0
+ .fp_eq_ok(x, 1, "covers of 0")
+ covers x, halfpi
+ .fp_eq_ok(x, 0, 'covers of pi/2')
+ covers x, pi
+ .fp_eq_ok(x, 1, 'covers of pi')
+ covers x, y
+ .fp_eq_ok(x, 0.292893218813453, 'covers of pi/4')
+.end
+
+.sub test_vers
+ .local num x, pi, halfpi, y
+ y = atan 1.0, 1.0
+ halfpi = y
+ halfpi *= 2
+ pi = halfpi
+ pi *= 2
+ vers x, 0
+ .fp_eq_ok(x, 0, "vers of 0")
+ vers x, halfpi
+ .fp_eq_ok(x, 1, 'vers of pi/2')
+ vers x, pi
+ .fp_eq_ok(x, 2, 'vers of pi')
+ vers x, y
+ .fp_eq_ok(x, 0.292893218813453, 'covers of pi/4')
+.end
+
+.sub test_hav
+ .local num x, pi, halfpi, y
+ y = atan 1.0, 1.0
+ halfpi = y
+ halfpi *= 2
+ pi = halfpi
+ pi *= 2
+ hav x, 0
+ .fp_eq_ok(x, 0, "hav of 0")
+ hav x, halfpi
+ .fp_eq_ok(x, 0.5, 'hav of pi/2')
+ hav x, pi
+ .fp_eq_ok(x, 1, 'hav of pi')
+ hav x, y
+ .fp_eq_ok(x, 0.146446609406726, 'hav of pi/4')
+.end
+
+.sub test_exsec
+ .local num x, pi, halfpi, y
+ y = atan 1.0, 1.0
+ halfpi = y
+ halfpi *= 2
+ pi = halfpi
+ pi *= 2
+ hav x, 0
+ .fp_eq_ok(x, 0, "exsec of 0")
+ exsec x, halfpi
+ .fp_eq_ok(x, 'nan', 'exsec of pi/2')
+ exsec x, pi
+ .fp_eq_ok(x, -2, 'exsec of pi')
+ exsec x, y
+ .fp_eq_ok(x, 0.414213562373095, 'exsec of pi/4')
+.end
+
+
+# Local Variables:
+# mode: cperl
+# cperl-indent-level: 4
+# fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 filetype=pir:
Modified: branches/auto_attrs/t/pmc/complex.t
==============================================================================
--- branches/auto_attrs/t/pmc/complex.t Tue Aug 11 07:56:32 2009 (r40486)
+++ branches/auto_attrs/t/pmc/complex.t Tue Aug 11 08:02:51 2009 (r40487)
@@ -91,19 +91,6 @@
is( message, .M, .M )
.endm
-.macro fp_eq_ok( J, K, L )
- set $N10, .J
- set $N11, .K
- sub $N12, $N11, $N10
- abs $N12, $N12
-
- set $I0, 0
- gt $N12, 0.000001, .$FPEQNOK
- set $I0, 1
-.label $FPEQNOK:
- ok( $I0, .L )
-.endm
-
.sub string_parsing
$P0 = new ['Complex']
$P1 = new ['String']
Modified: branches/auto_attrs/t/pmc/string.t
==============================================================================
--- branches/auto_attrs/t/pmc/string.t Tue Aug 11 07:56:32 2009 (r40486)
+++ branches/auto_attrs/t/pmc/string.t Tue Aug 11 08:02:51 2009 (r40487)
@@ -131,21 +131,6 @@
is( $I0, 0, 'string "foo" -> int' )
.end
-# Macro to ease testing of floating point comparisons
-# borrowed from fp_eq in fp_equality.pasm
-.macro fp_eq_ok ( J, K, L )
- set $N10, .J
- set $N11, .K
- sub $N12, $N11, $N10
- abs $N12, $N12
-
- set $I0, 0
- gt $N12, 0.000001, .$FPEQNOK
- set $I0, 1
-.label $FPEQNOK:
- ok( $I0, .L )
-.endm
-
.sub setting_numbers
.include 'fp_equality.pasm'
new $P0, ['String']
More information about the parrot-commits
mailing list