Ticket #387: tt387-single-float.patch

File tt387-single-float.patch, 110.9 KB (added by rurban, 13 years ago)
  • compilers/imcc/optimizer.c

    [core] experimentally add --floatval=float
    failing Tests (mostly because of wrong tests):
    
    t/steps/auto_jit-01                     (Wstat: 256 Tests: 50 Failed: 1)
      Failed test:  12
      Non-zero exit status: 1
    t/compilers/imcc/imcpasm/opt1           (Wstat: 256 Tests: 78 Failed: 1)
      Failed test:  75
      Non-zero exit status: 1
    t/op/arithmetics                        (Wstat: 1024 Tests: 30 Failed: 4)
      Failed tests:  8-9, 18-19
      Non-zero exit status: 4
    t/op/integer                            (Wstat: 256 Tests: 56 Failed: 1)
      Failed test:  33
      Non-zero exit status: 1
    t/op/number                             (Wstat: 1280 Tests: 56 Failed: 5)
      Failed tests:  1, 27, 32-33, 40
      Non-zero exit status: 5
    t/op/sprintf                            (Wstat: 0 Tests: 308 Failed: 17)
      Failed tests:  11-12, 14-15, 102, 104, 122-123, 162-165
                    167, 178-179, 185-186
    t/op/sysinfo                            (Wstat: 512 Tests: 14 Failed: 2)
      Failed tests:  3-4
      Non-zero exit status: 2
    t/op/time                               (Wstat: 256 Tests: 7 Failed: 1)
      Failed test:  3
      Non-zero exit status: 1
    t/pmc/bigint                            (Wstat: 256 Tests: 44 Failed: 1)
      Failed test:  4
      Non-zero exit status: 1
    t/pmc/complex                           (Wstat: 139 Tests: 0 Failed: 0)
      Parse errors: Bad plan.  You planned 467 tests but ran 0.
    t/pmc/float                             (Wstat: 4864 Tests: 61 Failed: 19)
      Failed tests:  4, 14, 44-53, 55-61
      Non-zero exit status: 19
    t/pmc/nci                               (Wstat: 512 Tests: 69 Failed: 2)
      Failed tests:  5-6
      Non-zero exit status: 2
    t/pmc/string                            (Wstat: 0 Tests: 164 Failed: 1)
      Failed test:  5
    t/pmc/sub                               (Wstat: 256 Tests: 64 Failed: 1)
      Failed test:  40
      Non-zero exit status: 1
    t/pmc/timer                             (Wstat: 512 Tests: 6 Failed: 2)
      Failed tests:  4-5
      Non-zero exit status: 2
    t/native_pbc/number                     (Wstat: 512 Tests: 7 Failed: 2)
      Failed tests:  1-2
      Non-zero exit status: 2
    t/dynoplibs/myops                       (Wstat: 256 Tests: 10 Failed: 1)
      Failed test:  5
      Non-zero exit status: 1
    t/library/dumper                        (Wstat: 256 Tests: 26 Failed: 1)
      Failed test:  17
      Non-zero exit status: 1
    t/library/mt19937ar                     (Wstat: 256 Tests: 10 Failed: 1)
      Failed test:  10
      Non-zero exit status: 1
    t/library/pcre                          (Wstat: 256 Tests: 1 Failed: 1)
      Failed test:  1
      Non-zero exit status: 1
    t/library/yaml_dumper                   (Wstat: 256 Tests: 26 Failed: 1)
      Failed test:  17
      Non-zero exit status: 1
    t/tools/pbc_merge                       (Wstat: 256 Tests: 4 Failed: 1)
      Failed test:  2
      Non-zero exit status: 1
    Files=397, Tests=11203, 1677 wallclock secs ( 7.78 usr  3.80 sys + 499.64 cusr 495.17 csys = 1006.38 CPU)
    Result: FAIL
    make: *** [test] Error 1
    
    old new  
    916916      The value of '16' for NUMVAL_SIZE == 8 was one larger than the 
    917917      default FLOATVAL_FMT of '15' determined by Configure.pl.  The 
    918918      reason for this difference, if there is one, should be documented. 
    919       The values of.18Lg and .31Lg are guesses. 
     919      The values of.18Lg and .31Lg are guesses. .7g is from 
     920      http://www.keil.com/support/docs/2191.htm 
    920921    */ 
    921922#if NUMVAL_SIZE == 8 
    922923    fmt = "%0.16g"; 
     
    924925    fmt = "%0.18Lg"; 
    925926#elif NUMVAL_SIZE == 16 
    926927    fmt = "%0.31Lg"; 
     928#elif NUMVAL_SIZE == 4 
     929    fmt = "%0.7g"; 
    927930#else 
    928931    fmt = FLOATVAL_FMT; 
    929932    /* Since it's not clear why this is needed, it's not clear what to 
  • include/parrot/packfile.h

    old new  
    3030#define FLOATTYPE_12_NAME     "x86 little endian 12 byte long double" 
    3131#define FLOATTYPE_16          2 
    3232#define FLOATTYPE_16_NAME     "IEEE-754 16 byte long double" 
     33#define FLOATTYPE_4           3 
     34#define FLOATTYPE_4_NAME      "IEEE-754 4-byte float" 
    3335/* Supported until here. */ 
    34 #define FLOATTYPE_MAX         2 
     36#define FLOATTYPE_MAX         3 
     37 
    3538/* Non IEEE-754 versions, yet unsupported. */ 
    3639/* NaN difference, but patches welcome */ 
    37 #define FLOATTYPE_16MIPS      3 
     40#define FLOATTYPE_16MIPS      4 
    3841#define FLOATTYPE_16MIPS_NAME "MIPS 16 byte long double" 
    3942/* See http://www.ncsa.uiuc.edu/UserInfo/Resources/Hardware/IBMp690/IBM/usr/share/man/info/en_US/a_doc_lib/aixprggd/genprogc/128bit_long_double_floating-point_datatype.htm */ 
    40 #define FLOATTYPE_16AIX       4 
     43#define FLOATTYPE_16AIX       5 
    4144#define FLOATTYPE_16AIX_NAME  "AIX 16 byte long double" 
    42 /* IEEE-754 old and tiny, yet unsupported */ 
    43 #define FLOATTYPE_4           5 
    44 #define FLOATTYPE_4_NAME      "4-byte float" 
     45#define FLOATTYPE_32          6 
     46#define FLOATTYPE_32_NAME     "32-byte huge double" 
    4547 
    46 #define TRACE_PACKFILE 0 
     48#define TRACE_PACKFILE 2 
    4749 
    4850#if TRACE_PACKFILE 
    4951/* Here we pass multipe args to a macro so the args may not be bracketed here! */ 
     
    10301032        __attribute__nonnull__(1) 
    10311033        __attribute__nonnull__(3); 
    10321034 
     1035PARROT_WARN_UNUSED_RESULT 
     1036int PF_floattype_size(const int floattype); 
     1037 
    10331038PARROT_PURE_FUNCTION 
     1039PARROT_WARN_UNUSED_RESULT 
    10341040size_t PF_size_cstring(ARGIN(const char *s)) 
    10351041        __attribute__nonnull__(1); 
    10361042 
     
    10961102#define ASSERT_ARGS_PF_fetch_string __attribute__unused__ int _ASSERT_ARGS_CHECK = \ 
    10971103       PARROT_ASSERT_ARG(interp) \ 
    10981104    || PARROT_ASSERT_ARG(cursor) 
     1105#define ASSERT_ARGS_PF_floattype_size __attribute__unused__ int _ASSERT_ARGS_CHECK = 0 
    10991106#define ASSERT_ARGS_PF_size_cstring __attribute__unused__ int _ASSERT_ARGS_CHECK = \ 
    11001107       PARROT_ASSERT_ARG(s) 
    11011108#define ASSERT_ARGS_PF_size_integer __attribute__unused__ int _ASSERT_ARGS_CHECK = 0 
     
    11631170        __attribute__nonnull__(2) 
    11641171        FUNC_MODIFIES(*rb); 
    11651172 
     1173void fetch_buf_generic( 
     1174    ARGOUT(unsigned char *rb), 
     1175    ARGIN(const unsigned char *b), 
     1176    const int size, 
     1177    const int byteorder) 
     1178        __attribute__nonnull__(1) 
     1179        __attribute__nonnull__(2) 
     1180        FUNC_MODIFIES(*rb); 
     1181 
    11661182void fetch_buf_le_12( 
    11671183    ARGOUT(unsigned char *rb), 
    11681184    ARGIN(const unsigned char *b)) 
     
    12291245#define ASSERT_ARGS_fetch_buf_be_8 __attribute__unused__ int _ASSERT_ARGS_CHECK = \ 
    12301246       PARROT_ASSERT_ARG(rb) \ 
    12311247    || PARROT_ASSERT_ARG(b) 
     1248#define ASSERT_ARGS_fetch_buf_generic __attribute__unused__ int _ASSERT_ARGS_CHECK = \ 
     1249       PARROT_ASSERT_ARG(rb) \ 
     1250    || PARROT_ASSERT_ARG(b) 
    12321251#define ASSERT_ARGS_fetch_buf_le_12 __attribute__unused__ int _ASSERT_ARGS_CHECK = \ 
    12331252       PARROT_ASSERT_ARG(rb) \ 
    12341253    || PARROT_ASSERT_ARG(b) 
  • config/auto/format.pm

    old new  
    1 # Copyright (C) 2001-2003, Parrot Foundation. 
     1# Copyright (C) 2001-2003, 2009 Parrot Foundation. 
    22# $Id: format.pm 36833 2009-02-17 20:09:26Z allison $ 
    33 
    44=head1 NAME 
     
    4141 
    4242    _set_floatvalmaxmin($conf); 
    4343 
     44    $conf->cc_clean(); 
    4445    return 1; 
    4546} 
    4647 
     
    9798    if ( $@ ) { 
    9899        $ivmin = '0'; 
    99100        $ivmax = '0'; 
     101        $conf->data->set( intvalmin   => $ivmin ); 
     102        $conf->data->set( intvalmax   => $ivmax ); 
    100103    } 
    101  
    102104} 
    103105 
    104106sub _set_floatvalfmt_nvsize { 
     
    124126            die qq{Configure.pl:  Can't find a printf-style format specifier for type '$nv'\n}; 
    125127        } 
    126128    } 
     129    elsif ( $nv eq "float" ) { 
     130        $nvsize   = 4; 
     131        $nvformat = "%.7g"; 
     132    } 
    127133    else { 
    128134        die qq{Configure.pl:  Can't find a printf-style format specifier for type '$nv'\n}; 
    129135    } 
     
    146152        $nvmax = 'DBL_MAX'; 
    147153    } 
    148154    elsif ( $nv eq "long double" ) { 
    149  
    150         # Stay way from long double for now (it may be 64 or 80 bits) 
    151         # die "long double not supported at this time, use double."; 
    152155        $nvmin = 'LDBL_MIN'; 
    153156        $nvmax = 'LDBL_MAX'; 
    154157    } 
     158    elsif ( $nv eq "float" ) { 
     159        $nvmin = 'FLOAT_MIN'; 
     160        $nvmax = 'FLOAT_MAX'; 
     161    } 
    155162    else { 
    156163        die qq{Configure.pl:  Can't find limits for type '$nv'\n}; 
    157164    } 
     
    164171    if ( $@ ) { 
    165172        $nvmin = '0'; 
    166173        $nvmax = '0'; 
     174        $conf->data->set( floatvalmin => $nvmin ); 
     175        $conf->data->set( floatvalmax => $nvmax ); 
    167176    } 
    168177 
    169178} 
  • src/byteorder.c

    old new  
    312312 
    313313=item C<void fetch_buf_le_12> 
    314314 
    315 Converts a 12-byte little-endian buffer C<b> into a big-endian buffer C<b>. 
     315Converts a 12-byte little-endian buffer C<b> into a big-endian buffer C<rb>. 
    316316 
    317317=cut 
    318318 
     
    344344 
    345345=item C<void fetch_buf_be_12> 
    346346 
    347 Converts a 12-byte big-endian buffer C<b> into a little-endian buffer C<b>. 
     347Converts a 12-byte big-endian buffer C<b> into a little-endian buffer C<rb>. 
    348348 
    349349=cut 
    350350 
     
    376376 
    377377=item C<void fetch_buf_le_16> 
    378378 
    379 Converts a 16-byte little-endian buffer C<b> into a big-endian buffer C<b>. 
     379Converts a 16-byte little-endian buffer C<b> into a big-endian buffer C<rb>. 
    380380 
    381381=cut 
    382382 
     
    412412 
    413413=item C<void fetch_buf_be_16> 
    414414 
    415 Converts a 16-byte big-endian buffer C<b> into a little-endian buffer C<b>. 
     415Converts a 16-byte big-endian buffer C<b> into a little-endian buffer C<rb>. 
    416416 
    417417=cut 
    418418 
     
    448448 
    449449=item C<void fetch_buf_le_32> 
    450450 
    451 Converts a 32-byte little-endian buffer C<b> into a big-endian buffer C<b>. 
     451Converts a 32-byte little-endian buffer C<b> into a big-endian buffer C<rb>. 
    452452 
    453453=cut 
    454454 
     
    500500 
    501501=item C<void fetch_buf_be_32> 
    502502 
    503 Converts a 32-byte big-endian buffer C<b> into a little-endian buffer C<b>. 
     503Converts a 32-byte big-endian buffer C<b> into a little-endian buffer C<rb>. 
    504504 
    505505=cut 
    506506 
     
    550550 
    551551/* 
    552552 
     553=item C<void fetch_buf_generic> 
     554 
     555Generic byteorder conversion from C<b> to C<rb>, 
     556with given bytesize and source endian-ness. 
     557 
     558This is used for the numeric converters in F<src/packfile/pf_items.c> 
     559 
     560=cut 
     561 
     562*/ 
     563 
     564void 
     565fetch_buf_generic(ARGOUT(unsigned char *rb), 
     566                  ARGIN(const unsigned char *b), 
     567                  const int size, 
     568                  const int byteorder) 
     569{ 
     570    ASSERT_ARGS(fetch_buf_generic) 
     571 
     572    /* 0==0 or 1==1 */ 
     573    if (byteorder == PARROT_BIGENDIAN) { 
     574        memcpy(rb, b, size); 
     575    } 
     576    else { 
     577        switch (size) { 
     578#if PARROT_BIGENDIAN 
     579          case 4: 
     580            fetch_buf_le_4(rb, b); break; 
     581          case 8: 
     582            fetch_buf_le_8(rb, b); break; 
     583          case 12: 
     584            fetch_buf_le_12(rb, b); break; 
     585          case 16: 
     586            fetch_buf_le_16(rb, b); break; 
     587          case 32: 
     588            fetch_buf_le_32(rb, b); break; 
     589#else 
     590          case 4: 
     591            fetch_buf_be_4(rb, b); break; 
     592          case 8: 
     593            fetch_buf_be_8(rb, b); break; 
     594          case 12: 
     595            fetch_buf_be_12(rb, b); break; 
     596          case 16: 
     597            fetch_buf_be_16(rb, b); break; 
     598          case 32: 
     599            fetch_buf_be_32(rb, b); break; 
     600#endif 
     601        default: 
     602            exit_fatal(1, 
     603              "fetch_buf_generic: unsupported size=%d, byteorder=%d, " 
     604              "PARROT_BIGENDIAN=%d\n", 
     605              size, byteorder, PARROT_BIGENDIAN); 
     606            break; 
     607        } 
     608    } 
     609} 
     610 
     611 
     612/* 
     613 
    553614=back 
    554615 
    555616=head1 HISTORY 
    556617 
    557618Initial version by Melvin on 2002/05/01 
    558619 
     620Extended by Reini Urban 2009 
     621 
    559622=cut 
    560623 
    561624*/ 
  • src/packfile.c

    old new  
    12371237    header->bc_minor    = PARROT_PBC_MINOR; 
    12381238#if NUMVAL_SIZE == 8 
    12391239    header->floattype = FLOATTYPE_8; 
    1240 #else 
    1241 #  if (NUMVAL_SIZE == 12) && !PARROT_BIGENDIAN 
     1240#elif (NUMVAL_SIZE == 12) && !PARROT_BIGENDIAN 
    12421241    header->floattype = FLOATTYPE_12; 
    1243 #  else 
    1244 #    if (NUMVAL_SIZE == 16) 
     1242#elif NUMVAL_SIZE == 16 
    12451243    header->floattype = FLOATTYPE_16; 
    1246 #    else 
     1244#elif NUMVAL_SIZE == 4 
     1245    header->floattype = FLOATTYPE_4; 
     1246#else 
    12471247    exit_fatal(1, "PackFile_set_header: Unsupported floattype NUMVAL_SIZE=%d," 
    12481248               " PARROT_BIGENDIAN=%d\n", NUMVAL_SIZE, 
    12491249               PARROT_BIGENDIAN ? "big-endian" : "little-endian"); 
    1250 #    endif 
    1251 #  endif 
    12521250#endif 
    12531251} 
    12541252 
     
    46544652 
    46554653=head1 HISTORY 
    46564654 
    4657 Parrot_readbc and Parrot_loadbc renamed. Trace macros, long double and 
    4658 64-bit conversion work by Reini Urban 2009. 
     4655Parrot_readbc and Parrot_loadbc renamed. Trace macros, long double, 
     4656float and 64-bit conversion work by Reini Urban 2009. 
    46594657 
    46604658Rework by Melvin; new bytecode format, make bytecode portable. (Do 
    46614659endian conversion and wordsize transforms on the fly.) 
  • src/packfile/pf_items.c

    old new  
    4646        __attribute__nonnull__(2) 
    4747        FUNC_MODIFIES(*dest); 
    4848 
    49 static void cvt_num12_num16_le( 
     49static void cvt_num12_num4( 
    5050    ARGOUT(unsigned char *dest), 
    5151    ARGIN(const unsigned char *src)) 
    5252        __attribute__nonnull__(1) 
     
    6060        __attribute__nonnull__(2) 
    6161        FUNC_MODIFIES(*dest); 
    6262 
    63 static void cvt_num12_num8_le( 
    64     ARGOUT(unsigned char *dest), 
    65     ARGIN(unsigned char *src)) 
    66         __attribute__nonnull__(1) 
    67         __attribute__nonnull__(2) 
    68         FUNC_MODIFIES(*dest); 
    69  
    7063static void cvt_num16_num12( 
    7164    ARGOUT(unsigned char *dest), 
    7265    ARGIN(const unsigned char *src)) 
     
    7467        __attribute__nonnull__(2) 
    7568        FUNC_MODIFIES(*dest); 
    7669 
    77 static void cvt_num16_num12_be( 
     70static void cvt_num16_num4( 
    7871    ARGOUT(unsigned char *dest), 
    7972    ARGIN(const unsigned char *src)) 
    8073        __attribute__nonnull__(1) 
     
    8881        __attribute__nonnull__(2) 
    8982        FUNC_MODIFIES(*dest); 
    9083 
    91 static void cvt_num16_num8_be( 
     84static void cvt_num4_num12( 
    9285    ARGOUT(unsigned char *dest), 
    9386    ARGIN(const unsigned char *src)) 
    9487        __attribute__nonnull__(1) 
    9588        __attribute__nonnull__(2) 
    9689        FUNC_MODIFIES(*dest); 
    9790 
    98 static void cvt_num16_num8_le( 
    99     ARGOUT(unsigned char *dest), 
    100     ARGIN(unsigned char *src)) 
    101         __attribute__nonnull__(1) 
    102         __attribute__nonnull__(2) 
    103         FUNC_MODIFIES(*dest); 
    104  
    105 static void cvt_num8_num12( 
     91static void cvt_num4_num16( 
    10692    ARGOUT(unsigned char *dest), 
    10793    ARGIN(const unsigned char *src)) 
    10894        __attribute__nonnull__(1) 
    10995        __attribute__nonnull__(2) 
    11096        FUNC_MODIFIES(*dest); 
    11197 
    112 static void cvt_num8_num12_be( 
     98static void cvt_num4_num8( 
    11399    ARGOUT(unsigned char *dest), 
    114100    ARGIN(const unsigned char *src)) 
    115101        __attribute__nonnull__(1) 
    116102        __attribute__nonnull__(2) 
    117103        FUNC_MODIFIES(*dest); 
    118104 
    119 static void cvt_num8_num16( 
     105static void cvt_num8_num12( 
    120106    ARGOUT(unsigned char *dest), 
    121107    ARGIN(const unsigned char *src)) 
    122108        __attribute__nonnull__(1) 
    123109        __attribute__nonnull__(2) 
    124110        FUNC_MODIFIES(*dest); 
    125111 
    126 static void cvt_num8_num16_be( 
     112static void cvt_num8_num16( 
    127113    ARGOUT(unsigned char *dest), 
    128114    ARGIN(const unsigned char *src)) 
    129115        __attribute__nonnull__(1) 
    130116        __attribute__nonnull__(2) 
    131117        FUNC_MODIFIES(*dest); 
    132118 
    133 static void cvt_num8_num16_le( 
     119static void cvt_num8_num4( 
    134120    ARGOUT(unsigned char *dest), 
    135121    ARGIN(const unsigned char *src)) 
    136122        __attribute__nonnull__(1) 
     
    164150#define ASSERT_ARGS_cvt_num12_num16 __attribute__unused__ int _ASSERT_ARGS_CHECK = \ 
    165151       PARROT_ASSERT_ARG(dest) \ 
    166152    || PARROT_ASSERT_ARG(src) 
    167 #define ASSERT_ARGS_cvt_num12_num16_le __attribute__unused__ int _ASSERT_ARGS_CHECK = \ 
     153#define ASSERT_ARGS_cvt_num12_num4 __attribute__unused__ int _ASSERT_ARGS_CHECK = \ 
    168154       PARROT_ASSERT_ARG(dest) \ 
    169155    || PARROT_ASSERT_ARG(src) 
    170156#define ASSERT_ARGS_cvt_num12_num8 __attribute__unused__ int _ASSERT_ARGS_CHECK = \ 
    171157       PARROT_ASSERT_ARG(dest) \ 
    172158    || PARROT_ASSERT_ARG(src) 
    173 #define ASSERT_ARGS_cvt_num12_num8_le __attribute__unused__ int _ASSERT_ARGS_CHECK = \ 
    174        PARROT_ASSERT_ARG(dest) \ 
    175     || PARROT_ASSERT_ARG(src) 
    176159#define ASSERT_ARGS_cvt_num16_num12 __attribute__unused__ int _ASSERT_ARGS_CHECK = \ 
    177160       PARROT_ASSERT_ARG(dest) \ 
    178161    || PARROT_ASSERT_ARG(src) 
    179 #define ASSERT_ARGS_cvt_num16_num12_be __attribute__unused__ int _ASSERT_ARGS_CHECK = \ 
     162#define ASSERT_ARGS_cvt_num16_num4 __attribute__unused__ int _ASSERT_ARGS_CHECK = \ 
    180163       PARROT_ASSERT_ARG(dest) \ 
    181164    || PARROT_ASSERT_ARG(src) 
    182165#define ASSERT_ARGS_cvt_num16_num8 __attribute__unused__ int _ASSERT_ARGS_CHECK = \ 
    183166       PARROT_ASSERT_ARG(dest) \ 
    184167    || PARROT_ASSERT_ARG(src) 
    185 #define ASSERT_ARGS_cvt_num16_num8_be __attribute__unused__ int _ASSERT_ARGS_CHECK = \ 
     168#define ASSERT_ARGS_cvt_num4_num12 __attribute__unused__ int _ASSERT_ARGS_CHECK = \ 
    186169       PARROT_ASSERT_ARG(dest) \ 
    187170    || PARROT_ASSERT_ARG(src) 
    188 #define ASSERT_ARGS_cvt_num16_num8_le __attribute__unused__ int _ASSERT_ARGS_CHECK = \ 
     171#define ASSERT_ARGS_cvt_num4_num16 __attribute__unused__ int _ASSERT_ARGS_CHECK = \ 
    189172       PARROT_ASSERT_ARG(dest) \ 
    190173    || PARROT_ASSERT_ARG(src) 
    191 #define ASSERT_ARGS_cvt_num8_num12 __attribute__unused__ int _ASSERT_ARGS_CHECK = \ 
     174#define ASSERT_ARGS_cvt_num4_num8 __attribute__unused__ int _ASSERT_ARGS_CHECK = \ 
    192175       PARROT_ASSERT_ARG(dest) \ 
    193176    || PARROT_ASSERT_ARG(src) 
    194 #define ASSERT_ARGS_cvt_num8_num12_be __attribute__unused__ int _ASSERT_ARGS_CHECK = \ 
     177#define ASSERT_ARGS_cvt_num8_num12 __attribute__unused__ int _ASSERT_ARGS_CHECK = \ 
    195178       PARROT_ASSERT_ARG(dest) \ 
    196179    || PARROT_ASSERT_ARG(src) 
    197180#define ASSERT_ARGS_cvt_num8_num16 __attribute__unused__ int _ASSERT_ARGS_CHECK = \ 
    198181       PARROT_ASSERT_ARG(dest) \ 
    199182    || PARROT_ASSERT_ARG(src) 
    200 #define ASSERT_ARGS_cvt_num8_num16_be __attribute__unused__ int _ASSERT_ARGS_CHECK = \ 
    201        PARROT_ASSERT_ARG(dest) \ 
    202     || PARROT_ASSERT_ARG(src) 
    203 #define ASSERT_ARGS_cvt_num8_num16_le __attribute__unused__ int _ASSERT_ARGS_CHECK = \ 
     183#define ASSERT_ARGS_cvt_num8_num4 __attribute__unused__ int _ASSERT_ARGS_CHECK = \ 
    204184       PARROT_ASSERT_ARG(dest) \ 
    205185    || PARROT_ASSERT_ARG(src) 
    206186#define ASSERT_ARGS_fetch_op_be_4 __attribute__unused__ int _ASSERT_ARGS_CHECK = \ 
     
    239219 * Floattype 0 = IEEE-754 8 byte double 
    240220 * Floattype 1 = x86 little endian 12 byte long double 
    241221 * Floattype 2 = IEEE-754 16 byte long double 
     222 * Floattype 3 = IEEE-754 4 byte single float 
    242223 * 
    243224 */ 
    244225 
     
    254235 
    255236*/ 
    256237 
     238#if NUMVAL_SIZE == 8 
    257239static void 
    258240cvt_num12_num8(ARGOUT(unsigned char *dest), ARGIN(const unsigned char *src)) 
    259241{ 
     
    331313 
    332314/* 
    333315 
    334 =item C<static void cvt_num16_num12> 
    335  
    336 Converts IEEE 754 LE 16-byte long double to i386 LE 12-byte long double . 
    337 See http://babbage.cs.qc.cuny.edu/IEEE-754/References.xhtml 
    338  
    339 Untested. 
    340  
    341 =cut 
    342  
    343 */ 
    344  
    345 #if (NUMVAL_SIZE == 12) && !PARROT_BIGENDIAN 
    346 static void 
    347 cvt_num16_num12(ARGOUT(unsigned char *dest), ARGIN(const unsigned char *src)) 
    348 { 
    349     ASSERT_ARGS(cvt_num16_num12) 
    350  
    351     /* 
    352        16-byte double (128 bits): 
    353        sign  1  bit 127 
    354        exp  15 bits 126-112 
    355        man 112 bits 111-0 
    356     to 12-byte double (96 bits): 
    357        sign  1  bit 95 
    358        exp  15 bits 94-80 
    359        man  80 bits 79-0 
    360  
    361     +-------+-------+-------+-------+-------+-------+--...--+-------+ 
    362     |src[15]|src[14]|src[13]|src[12]|src[11]|src[10]| ...   |src[0] | 
    363     S|     E        |                    F                          | 
    364     +-------+-------+-------+-------+-------+-------+--...--+-------+ 
    365     1|<-----15----->|<----------------112 bits--------------------->| 
    366     <---------------------------128 bits----------------------------> 
    367             16-byte LONG DOUBLE FLOATING-POINT (IA64 or BE 64-bit) 
    368  
    369     +-------+-------+-------+-------+-------+-------+--...--+-------+ 
    370     |dest[11]dest[10]dest[9]|dest[8]|dest[7]|dest[6]| ...   |dest[0]| 
    371     S|     E        |                    F                          | 
    372     +-------+-------+-------+-------+-------+-------+--...--+-------+ 
    373     1|<-----15----->|<----------------80 bits---------------------->| 
    374     <----------------------------96 bits----------------------------> 
    375               12-byte LONG DOUBLE FLOATING-POINT (i386 special) 
    376  
    377     */ 
    378  
    379     memset(dest, 0, 12); 
    380     /* simply copy over sign + exp */ 
    381     TRACE_PRINTF_2(("  cvt_num16_num12: sign+exp=0x%2x\n", src[15])); 
    382     dest[11] = src[15]; 
    383     dest[12] = src[14]; 
    384     /* and trunc the rest */ 
    385     memcpy(&dest[10], &src[13], 10); 
    386     TRACE_PRINTF_2(("  cvt_num16_num12: mantissa=0x%10x, double=%lf\n", 
    387                     src[13], (long double)*dest)); 
    388 } 
    389 #endif 
    390  
    391 /* 
    392  
    393 =item C<static void cvt_num12_num16> 
    394  
    395 Converts i386 LE 12-byte long double to IEEE 754 LE 16-byte long double. 
    396  
    397 Untested. 
    398 Fallback 12->8->16 disabled. 
    399  
    400 =cut 
    401  
    402 */ 
    403  
    404 #if (NUMVAL_SIZE == 16) 
    405 static void 
    406 cvt_num12_num16(ARGOUT(unsigned char *dest), ARGIN(const unsigned char *src)) 
    407 { 
    408     ASSERT_ARGS(cvt_num12_num16) 
    409 #  if 0 
    410     unsigned char b[8]; 
    411     cvt_num12_num8(b, src); 
    412     cvt_num8_num16(dest, b); 
    413 #  endif 
    414     /* 
    415        12-byte double (96 bits): 
    416        sign  1  bit 95 
    417        exp  15 bits 94-80 
    418        man  80 bits 79-0 
    419     to 16-byte double (128 bits): 
    420        sign  1  bit 127 
    421        exp  15 bits 126-112 
    422        man 112 bits 111-0 
    423  
    424     +-------+-------+-------+-------+-------+-------+--...--+-------+ 
    425     |src[11]|src[10]| src[9]| src[8]| src[7]| src[6]| ...   | src[0]| 
    426     S|     E        |                    F                          | 
    427     +-------+-------+-------+-------+-------+-------+--...--+-------+ 
    428     1|<-----15----->|<----------------80 bits---------------------->| 
    429     <----------------------------96 bits----------------------------> 
    430               12-byte LONG DOUBLE FLOATING-POINT (i386 special) 
    431  
    432     +-------+-------+-------+-------+-------+-------+--...--+-------+ 
    433     |dest[15]dest[14]dest[13]dest[12]dest[11]dest[10] ...   |dest[0]| 
    434     S|     E        |                    F                          | 
    435     +-------+-------+-------+-------+-------+-------+--...--+-------+ 
    436     1|<-----15----->|<----------------112 bits--------------------->| 
    437     <---------------------------128 bits----------------------------> 
    438             16-byte LONG DOUBLE FLOATING-POINT (IA64 or BE 64-bit) 
    439  
    440     */ 
    441  
    442     memset(dest, 0, 16); 
    443     /* simply copy over sign + exp */ 
    444     TRACE_PRINTF_2(("  cvt_num12_num16: sign+exp=0x%2x\n", src[11])); 
    445     dest[15] = src[11]; 
    446     dest[14] = src[12]; 
    447     /* and trunc the rest */ 
    448     memcpy(&dest[13], &src[9], 10); 
    449     TRACE_PRINTF_2(("  cvt_num12_num15: mantissa=0x%10x, double=%lf\n", 
    450                     src[19], (long double)*dest)); 
    451 } 
    452 #endif 
    453 /* 
    454  
    455316=item C<static void cvt_num16_num8> 
    456317 
    457318Converts IEEE 754 16-byte long double to IEEE 754 8 byte double. 
     
    554415        dest[0] |= src[1] >> 3; 
    555416    } 
    556417} 
    557  
    558418/* 
    559419 
    560 =item C<static void cvt_num8_num16> 
     420=item C<static void cvt_num4_num8> 
    561421 
    562 Converts IEEE 754 8-byte double to IEEE 754 16 byte long double. 
     422Converts IEEE 754 4-byte single-float to IEEE 754 8 byte double. 
    563423 
    564424Untested. 
    565425 
     
    567427 
    568428*/ 
    569429 
    570 #if (NUMVAL_SIZE == 16) 
    571430static void 
    572 cvt_num8_num16(ARGOUT(unsigned char *dest), ARGIN(const unsigned char *src)) 
     431cvt_num4_num8(ARGOUT(unsigned char *dest), ARGIN(const unsigned char *src)) 
    573432{ 
    574     ASSERT_ARGS(cvt_num8_num16) 
     433    ASSERT_ARGS(cvt_num4_num8) 
    575434    /* The compiler can do this for us */ 
    576     long double ld; 
    577435    double d; 
    578     memcpy(&d, src, 8); 
    579     ld = (long double)d; /* TODO: test compiler cast */ 
    580     /*TRACE_PRINTF_2(("  cvt_num8_num16: d=%f, ld=%lf\n", d, ld));*/ 
    581     memcpy(dest, &ld, 16); 
     436    float f; 
     437 
     438    memcpy(&f, src, 4); 
     439    d = (double)f; /* TODO: test compiler cast */ 
     440    TRACE_PRINTF_2(("  cvt_num4_num8: d=%f, ld=%f\n", f, d));*/ 
     441    memcpy(dest, &d, 8); 
    582442} 
     443 
    583444#endif 
    584445 
    585446/* 
    586447 
    587 =item C<static void cvt_num8_num12> 
     448=item C<static void cvt_num16_num12> 
    588449 
    589 Converts i386 8-byte double to i386 12 byte long double. 
     450Converts IEEE 754 LE 16-byte long double to i386 LE 12-byte long double . 
     451See http://babbage.cs.qc.cuny.edu/IEEE-754/References.xhtml 
    590452 
    591 Tested ok. 
     453Untested. 
    592454 
    593455=cut 
    594456 
     
    596458 
    597459#if (NUMVAL_SIZE == 12) && !PARROT_BIGENDIAN 
    598460static void 
    599 cvt_num8_num12(ARGOUT(unsigned char *dest), ARGIN(const unsigned char *src)) 
     461cvt_num16_num12(ARGOUT(unsigned char *dest), ARGIN(const unsigned char *src)) 
    600462{ 
    601     ASSERT_ARGS(cvt_num8_num12) 
    602     long double ld; 
    603     double d; 
    604     memcpy(&d, src, 8); 
    605     ld = (long double)d; /* compiler cast */ 
    606     /*TRACE_PRINTF_2(("  cvt_num8_num12: ld=%lf, d=%f\n", ld, d));*/ 
    607     memcpy(dest, &ld, 12); 
     463    ASSERT_ARGS(cvt_num16_num12) 
     464 
     465    /* 
     466       16-byte double (128 bits): 
     467       sign  1  bit 127 
     468       exp  15 bits 126-112 
     469       man 112 bits 111-0 
     470    to 12-byte double (96 bits): 
     471       sign  1  bit 95 
     472       exp  15 bits 94-80 
     473       man  80 bits 79-0 
     474 
     475    +-------+-------+-------+-------+-------+-------+--...--+-------+ 
     476    |src[15]|src[14]|src[13]|src[12]|src[11]|src[10]| ...   |src[0] | 
     477    S|     E        |                    F                          | 
     478    +-------+-------+-------+-------+-------+-------+--...--+-------+ 
     479    1|<-----15----->|<----------------112 bits--------------------->| 
     480    <---------------------------128 bits----------------------------> 
     481            16-byte LONG DOUBLE FLOATING-POINT (IA64 or BE 64-bit) 
     482 
     483    +-------+-------+-------+-------+-------+-------+--...--+-------+ 
     484    |dest[11]dest[10]dest[9]|dest[8]|dest[7]|dest[6]| ...   |dest[0]| 
     485    S|     E        |                    F                          | 
     486    +-------+-------+-------+-------+-------+-------+--...--+-------+ 
     487    1|<-----15----->|<----------------80 bits---------------------->| 
     488    <----------------------------96 bits----------------------------> 
     489              12-byte LONG DOUBLE FLOATING-POINT (i386 special) 
     490 
     491    */ 
     492 
     493    memset(dest, 0, 12); 
     494    /* simply copy over sign + exp */ 
     495    TRACE_PRINTF_2(("  cvt_num16_num12: sign+exp=0x%2x\n", src[15])); 
     496    dest[11] = src[15]; 
     497    dest[12] = src[14]; 
     498    /* and trunc the rest */ 
     499    memcpy(&dest[10], &src[13], 10); 
     500    TRACE_PRINTF_2(("  cvt_num16_num12: mantissa=0x%10x, double=%lf\n", 
     501                    src[13], (long double)*dest)); 
    608502} 
    609 #endif 
    610503 
    611504 
    612505/* 
    613506 
    614 =item C<static void cvt_num8_num12_be> 
     507=item C<static void cvt_num8_num12> 
    615508 
    616 Converts a big-endian IEEE 754 8-byte double to i386 LE 12-byte long double. 
     509Converts i386 8-byte double to i386 12 byte long double. 
    617510 
    618511Tested ok. 
    619512 
     
    621514 
    622515*/ 
    623516 
    624 #if (NUMVAL_SIZE == 12) && !PARROT_BIGENDIAN 
    625517static void 
    626 cvt_num8_num12_be(ARGOUT(unsigned char *dest), ARGIN(const unsigned char *src)) 
     518cvt_num8_num12(ARGOUT(unsigned char *dest), ARGIN(const unsigned char *src)) 
    627519{ 
    628     ASSERT_ARGS(cvt_num8_num12_be) 
    629     unsigned char b[8]; 
    630     fetch_buf_be_8(b, src); 
    631     /*TRACE_PRINTF_2(("  cvt_num8_num12_be: 0x%8x\n", b));*/ 
    632     cvt_num8_num12(dest, b); 
     520    ASSERT_ARGS(cvt_num8_num12) 
     521    long double ld; 
     522    double d; 
     523    memcpy(&d, src, 8); 
     524    ld = (long double)d; /* compiler cast */ 
     525    /*TRACE_PRINTF_2(("  cvt_num8_num12: ld=%lf, d=%f\n", ld, d));*/ 
     526    memcpy(dest, &ld, 12); 
    633527} 
    634 #endif 
    635528 
    636529/* 
    637530 
    638 =item C<static void cvt_num8_num16_le> 
     531=item C<static void cvt_num4_num12> 
    639532 
    640 Converts a little-endian IEEE 754 8-byte double to big-endian 16-byte long double. 
     533Converts IEEE 754 4-byte single-float to ix86 12 byte double. 
    641534 
    642535Untested. 
    643536 
     
    645538 
    646539*/ 
    647540 
    648 #if (NUMVAL_SIZE == 16) && PARROT_BIGENDIAN 
    649541static void 
    650 cvt_num8_num16_le(ARGOUT(unsigned char *dest), ARGIN(const unsigned char *src)) 
     542cvt_num4_num12(ARGOUT(unsigned char *dest), ARGIN(const unsigned char *src)) 
    651543{ 
    652     ASSERT_ARGS(cvt_num8_num16_le) 
    653     unsigned char b[8]; 
    654     fetch_buf_be_8(b, src);  /* TODO test endianize */ 
    655     TRACE_PRINTF_2(("  cvt_num8_num16_le: 0x%8x\n", b)); 
    656     cvt_num8_num16(dest, b); 
     544    ASSERT_ARGS(cvt_num4_num12) 
     545    /* The compiler can do this for us */ 
     546    long double ld; 
     547    float f; 
     548 
     549    memcpy(&f, src, 4); 
     550    ld = (long double)f; /* TODO: test compiler cast */ 
     551    TRACE_PRINTF_2(("  cvt_num4_num8: d=%f, ld=%lf\n", f, ld));*/ 
     552    memcpy(dest, &ld, 12); 
    657553} 
     554 
    658555#endif 
    659556 
    660557/* 
    661558 
    662 =item C<static void cvt_num12_num16_le> 
     559=item C<static void cvt_num12_num16> 
    663560 
    664 Converts a little-endian 12-byte double to big-endian 16-byte long double. 
     561Converts i386 LE 12-byte long double to IEEE 754 LE 16-byte long double. 
    665562 
    666563Untested. 
     564Fallback 12->8->16 disabled. 
    667565 
    668566=cut 
    669567 
    670568*/ 
    671569 
    672 #if (NUMVAL_SIZE == 16) && PARROT_BIGENDIAN 
     570#if NUMVAL_SIZE == 16 
    673571static void 
    674 cvt_num12_num16_le(ARGOUT(unsigned char *dest), ARGIN(const unsigned char *src)) 
     572cvt_num12_num16(ARGOUT(unsigned char *dest), ARGIN(const unsigned char *src)) 
    675573{ 
    676     ASSERT_ARGS(cvt_num12_num16_le) 
    677     unsigned char b[12]; 
    678     fetch_buf_be_12(b, src);  /* TODO test endianize */ 
    679     TRACE_PRINTF_2(("  cvt_num12_num16_le: 0x%8x\n", b)); 
    680     cvt_num12_num16(dest, b); 
    681 } 
    682 #endif 
    683  
    684 /* 
    685  
    686 =item C<static void cvt_num12_num8_le> 
    687  
    688 Converts a little-endian 12-byte i386 long double into a IEEE 754 8-byte double. 
     574    ASSERT_ARGS(cvt_num12_num16) 
     575#  if 0 
     576    unsigned char b[8]; 
     577    cvt_num12_num8(b, src); 
     578    cvt_num8_num16(dest, b); 
     579#  endif 
     580    /* 
     581       12-byte double (96 bits): 
     582       sign  1  bit 95 
     583       exp  15 bits 94-80 
     584       man  80 bits 79-0 
     585    to 16-byte double (128 bits): 
     586       sign  1  bit 127 
     587       exp  15 bits 126-112 
     588       man 112 bits 111-0 
    689589 
    690 Untested. 
     590    +-------+-------+-------+-------+-------+-------+--...--+-------+ 
     591    |src[11]|src[10]| src[9]| src[8]| src[7]| src[6]| ...   | src[0]| 
     592    S|     E        |                    F                          | 
     593    +-------+-------+-------+-------+-------+-------+--...--+-------+ 
     594    1|<-----15----->|<----------------80 bits---------------------->| 
     595    <----------------------------96 bits----------------------------> 
     596              12-byte LONG DOUBLE FLOATING-POINT (i386 special) 
    691597 
    692 =cut 
     598    +-------+-------+-------+-------+-------+-------+--...--+-------+ 
     599    |dest[15]dest[14]dest[13]dest[12]dest[11]dest[10] ...   |dest[0]| 
     600    S|     E        |                    F                          | 
     601    +-------+-------+-------+-------+-------+-------+--...--+-------+ 
     602    1|<-----15----->|<----------------112 bits--------------------->| 
     603    <---------------------------128 bits----------------------------> 
     604            16-byte LONG DOUBLE FLOATING-POINT (IA64 or BE 64-bit) 
    693605 
    694 */ 
     606    */ 
    695607 
    696 #if PARROT_BIGENDIAN 
    697 static void 
    698 cvt_num12_num8_le(ARGOUT(unsigned char *dest), ARGIN(unsigned char *src)) 
    699 { 
    700     ASSERT_ARGS(cvt_num12_num8_le) 
    701     unsigned char b[12]; 
    702     fetch_buf_le_12(b, src);  /* TODO test endianize */ 
    703     TRACE_PRINTF_2(("  cvt_num12_num8_le: 0x%12x\n", b)); 
    704     cvt_num12_num8(dest, b); 
     608    memset(dest, 0, 16); 
     609    /* simply copy over sign + exp */ 
     610    TRACE_PRINTF_2(("  cvt_num12_num16: sign+exp=0x%2x\n", src[11])); 
     611    dest[15] = src[11]; 
     612    dest[14] = src[12]; 
     613    /* and trunc the rest */ 
     614    memcpy(&dest[13], &src[9], 10); 
     615    TRACE_PRINTF_2(("  cvt_num12_num15: mantissa=0x%10x, double=%lf\n", 
     616                    src[19], (long double)*dest)); 
    705617} 
    706 #endif 
    707618 
    708619/* 
    709620 
    710 =item C<static void cvt_num16_num8_le> 
     621=item C<static void cvt_num8_num16> 
    711622 
    712 Converts a little-endian IEEE 754 intel 16-byte long double into a 
    713 big-endian IEEE 754 8-byte double. 
     623Converts IEEE 754 8-byte double to IEEE 754 16 byte long double. 
    714624 
    715625Untested. 
    716626 
     
    718628 
    719629*/ 
    720630 
    721 #if PARROT_BIGENDIAN 
    722631static void 
    723 cvt_num16_num8_le(ARGOUT(unsigned char *dest), ARGIN(unsigned char *src)) 
     632cvt_num8_num16(ARGOUT(unsigned char *dest), ARGIN(const unsigned char *src)) 
    724633{ 
    725     ASSERT_ARGS(cvt_num16_num8_le) 
    726     unsigned char b[16]; 
    727     fetch_buf_le_16(b, src); 
    728     TRACE_PRINTF_2(("  cvt_num16_num8_le: 0x%16x\n", b)); 
    729     cvt_num16_num8(dest, b); 
     634    ASSERT_ARGS(cvt_num8_num16) 
     635    /* The compiler can do this for us */ 
     636    long double ld; 
     637    double d; 
     638    memcpy(&d, src, 8); 
     639    ld = (long double)d; /* TODO: test compiler cast */ 
     640    /*TRACE_PRINTF_2(("  cvt_num8_num16: d=%f, ld=%lf\n", d, ld));*/ 
     641    memcpy(dest, &ld, 16); 
    730642} 
    731 #endif 
    732643 
    733644/* 
    734645 
    735 =item C<static void cvt_num16_num8_be> 
     646=item C<static void cvt_num4_num16> 
    736647 
    737 Converts a big-endian IEEE 754 16-byte long double into a IEEE 754 8-byte double. 
     648Converts IEEE 754 4-byte single-float to IEEE 754 16 byte long double. 
    738649 
    739650Untested. 
    740651 
     
    742653 
    743654*/ 
    744655 
    745 #if !PARROT_BIGENDIAN 
    746656static void 
    747 cvt_num16_num8_be(ARGOUT(unsigned char *dest), ARGIN(const unsigned char *src)) 
     657cvt_num4_num16(ARGOUT(unsigned char *dest), ARGIN(const unsigned char *src)) 
    748658{ 
    749     ASSERT_ARGS(cvt_num16_num8_be) 
    750     unsigned char b[16]; 
    751     fetch_buf_be_16(b, src); 
    752     TRACE_PRINTF_2(("  cvt_num16_num8_be: 0x%16x\n", b)); 
    753     cvt_num16_num8(dest, b); 
     659    ASSERT_ARGS(cvt_num4_num8) 
     660    /* The compiler can do this for us */ 
     661    long double ld; 
     662    float f; 
     663 
     664    memcpy(&f, src, 4); 
     665    ld = (long double)f; /* TODO: test compiler cast */ 
     666    TRACE_PRINTF_2(("  cvt_num4_num8: d=%f, ld=%lf\n", f, ld));*/ 
     667    memcpy(dest, &ld, 16); 
    754668} 
     669 
    755670#endif 
    756671 
    757672/* 
    758673 
    759 =item C<static void cvt_num16_num12_be> 
     674=item C<static void cvt_num8_num4> 
    760675 
    761 Converts a big-endian IEEE 754 16-byte long double into a 12-byte i386 long double. 
     676Converts IEEE 754 8-byte double to IEEE 754 4-byte double. 
     677See also http://www.mrob.com/pub/math/floatformats.html 
    762678 
    763679Untested. 
    764680 
     
    766682 
    767683*/ 
    768684 
    769 #if (NUMVAL_SIZE == 12) && !PARROT_BIGENDIAN 
     685#if NUMVAL_SIZE == 4 
    770686static void 
    771 cvt_num16_num12_be(ARGOUT(unsigned char *dest), ARGIN(const unsigned char *src)) 
     687cvt_num8_num4(ARGOUT(unsigned char *dest), ARGIN(const unsigned char *src)) 
    772688{ 
    773     ASSERT_ARGS(cvt_num16_num12_be) 
    774     unsigned char b[16]; 
    775     fetch_buf_be_16(b, src); 
    776     TRACE_PRINTF_2(("  cvt_num16_num12_be: 0x%16x\n", b)); 
    777     cvt_num16_num12(dest, b); 
    778 } 
    779 #endif 
     689    ASSERT_ARGS(cvt_num8_num4) 
     690    /* if we are lucky and this cpu can do double */ 
     691#if DOUBLE_SIZE == 8 
    780692 
    781 /* 
     693    double d; 
     694    float f; 
    782695 
    783 =item C<static void cvt_num8_num16_be> 
     696    memcpy(&d, src, 8); 
     697    f = (float)d; /* compiler cast */ 
     698    memcpy(dest, &f, 4); 
    784699 
    785 Converts a big-endian IEEE 754 8-byte double to little-endian IEEE 754 16 byte 
    786 long double. 
     700#else 
    787701 
    788 Untested. 
     702    int expo, i, s; 
     703#  ifdef __LCC__ 
     704    int expo2; 
     705#  endif 
    789706 
    790 =cut 
     707    /* 
     708       8-byte double (64 bits): 
     709       sign  1  bit 63 
     710       exp  11 bits 62-52 
     711       man  52 bits 51-0 
     712    to 4-byte double (32 bits): 
     713       sign  1  bit 31 
     714       exp   8 bits 30-23 
     715       man  23 bits 22-0 
    791716 
    792 */ 
     717    +-------+-------+-------+-------+-------+-------+-------+-------+ 
     718    |src[7] | src[6]| src[5]| src[4]| src[3]|src[2] |src[1] |src[0] | 
     719    S|    E     |                          F                        | 
     720    +-------+-------+-------+-------+-------+-------+-------+-------+ 
     721    1|<---11--->|<------|-------|-------|------52 bits------------->| 
     722    <----------------------------64 bits----------------------------> 
     723        8-byte DOUBLE FLOATING-POINT 
     724 
     725    +-------+-------+-------+-------+ 
     726    |dest[3]|dest[2]|dest[1]|dest[0]| 
     727    S|  E   |           F           | 
     728    +-------+-------+-------+-------+ 
     729    1|<--8-->|<------|--23bit|----->| 
     730    <------------32 bits------------> 
     731        4-byte single float 
     732    */ 
     733 
     734    memset(dest, 0, 4); 
     735    /* exponents 11 -> 7 bits */ 
     736    s = src[7] & 0x80; /* sign */ 
     737 
     738    expo = (((src[7] & 0x7f)<< 8) | (src[6] & 0xf0)); /* 11110000 */ 
     739    if (expo == 0) { 
     740nul: 
     741        if (s) 
     742            dest[3] |= 0x80; 
     743        return; 
     744    } 
     745#  ifdef __LCC__ 
     746    expo2 = expo - 1023; 
     747    expo  = expo2; 
     748#  else 
     749    expo -= 1023;        /* - bias 8byte */ 
     750#  endif 
     751    expo += 127;         /* + bias 4byte */ 
     752    if (expo <= 0)       /* underflow */ 
     753        goto nul; 
     754    if (expo > 0x7ff) {  /* inf/nan */ 
     755        dest[3] = 0x7f; 
     756        dest[2] = src[7] == 0xc0 ? 0xf8 : 0xf0 ; /* XXX */ 
     757        goto nul; 
     758    } 
     759    expo <<= 4; 
     760    dest[2] = (expo & 0x80); 
     761    dest[3] = (expo & 0x7f00) >> 8; 
     762    if (s) 
     763        dest[3] |= 0x80; 
     764    /* copy the mantissa: 52 bits => 23 bits */ 
     765    dest[2] |= src[6] >> 4; 
     766    dest[1] |= src[6] << 7 | src[5] >> 4; 
     767    dest[0] |= src[5] << 4 | src[4] >> 4; 
     768#endif 
     769} 
    793770 
    794 #if (NUMVAL_SIZE == 16) && !PARROT_BIGENDIAN 
    795771static void 
    796 cvt_num8_num16_be(ARGOUT(unsigned char *dest), ARGIN(const unsigned char *src)) 
     772cvt_num12_num4(ARGOUT(unsigned char *dest), ARGIN(const unsigned char *src)) 
    797773{ 
    798     ASSERT_ARGS(cvt_num8_num16_be) 
    799     unsigned char b[8]; 
    800     fetch_buf_be_8(b, src); 
    801     cvt_num8_num16(dest, b); 
     774    exit_fatal(1, "Unsupported floattype conversion " 
     775               "12-byte long double to 4-byte float\n"); 
     776} 
     777 
     778static void 
     779cvt_num16_num4(ARGOUT(unsigned char *dest), ARGIN(const unsigned char *src)) 
     780{ 
     781    exit_fatal(1, "Unsupported floattype conversion " 
     782               "16-byte long double to 4-byte float\n"); 
    802783} 
    803784#endif 
    804785 
     786 
    805787#if 0 
    806788 
    807789/* 
     
    11771159    /* When we have alignment all squared away we don't need 
    11781160     * to use memcpy() for native byteorder.  */ 
    11791161    FLOATVAL f; 
    1180     double d; 
     1162    int need_endianize; 
     1163    int floatsize; 
    11811164    if (!pf || !pf->fetch_nv) { 
    11821165        TRACE_PRINTF(("PF_fetch_number: Native [%d bytes]\n", 
    11831166                      sizeof (FLOATVAL))); 
     
    11871170            sizeof (opcode_t); 
    11881171        return f; 
    11891172    } 
     1173 
    11901174    f = (FLOATVAL) 0; 
    1191     TRACE_PRINTF(("PF_fetch_number at 0x%x: Converting...\n", OFFS(*stream))); 
    1192     /* 12->8 has a messy cast. */ 
    1193     if (NUMVAL_SIZE == 8 && pf->header->floattype == FLOATTYPE_12) { 
    1194         (pf->fetch_nv)((unsigned char *)&d, (const unsigned char *) *stream); 
    1195         f = d; 
    1196         TRACE_PRINTF_VAL(("PF_fetch_number: cast %f\n", f)); 
     1175    need_endianize = pf->header->byteorder != PARROT_BIGENDIAN; 
     1176    floatsize = PF_floattype_size(pf->header->floattype); 
     1177    TRACE_PRINTF(("PF_fetch_number at 0x%x: byteorder=%d, floatsize=%d\n", 
     1178                  OFFS(*stream), pf->header->byteorder, floatsize)); 
     1179 
     1180    if (need_endianize) { 
     1181        unsigned char b[32]; /* max. floatvalsize */ 
     1182        /* generic endianizer */ 
     1183        fetch_buf_generic(b, (const unsigned char *) *stream, 
     1184                          PF_floattype_size(pf->header->floattype), 
     1185                          pf->header->byteorder); 
     1186        (pf->fetch_nv)((unsigned char *)&f, b); 
     1187        TRACE_PRINTF_VAL(("PF_fetch_number: %f *endianized*\n", f)); 
    11971188    } 
    11981189    else { 
    11991190        (pf->fetch_nv)((unsigned char *)&f, (const unsigned char *) *stream); 
    12001191        TRACE_PRINTF_VAL(("PF_fetch_number: %f\n", f)); 
    12011192    } 
    1202     if (pf->header->floattype == FLOATTYPE_8) { 
    1203         *((const unsigned char **) (stream)) += 8; 
    1204     } 
    1205     else if (pf->header->floattype == FLOATTYPE_12) { 
    1206         *((const unsigned char **) (stream)) += 12; 
    1207     } 
    1208     else if (pf->header->floattype == FLOATTYPE_16) { 
    1209         *((const unsigned char **) (stream)) += 16; 
    1210     } 
    1211     else if (pf->header->floattype == FLOATTYPE_16MIPS) { 
    1212         *((const unsigned char **) (stream)) += 16; 
    1213     } 
    1214     else if (pf->header->floattype == FLOATTYPE_16AIX) { 
    1215         *((const unsigned char **) (stream)) += 16; 
    1216     } 
    1217     else if (pf->header->floattype == FLOATTYPE_4) { 
    1218         *((const unsigned char **) (stream)) += 4; 
    1219     } 
     1193    *((const unsigned char **) (stream)) += floatsize; 
    12201194    return f; 
    12211195} 
    12221196 
     
    14771451*/ 
    14781452 
    14791453PARROT_PURE_FUNCTION 
     1454PARROT_WARN_UNUSED_RESULT 
    14801455size_t 
    14811456PF_size_cstring(ARGIN(const char *s)) 
    14821457{ 
     
    14901465 
    14911466/* 
    14921467 
     1468=item C<int PF_floattype_size> 
     1469 
     1470Returns the numval size in bytes for the given internal floattype 
     1471- usually from C<pf->header->floattype>. 
     1472 
     1473=cut 
     1474 
     1475*/ 
     1476 
     1477PARROT_CONST_FUNCTION 
     1478int 
     1479PF_floattype_size(const int floattype) 
     1480{ 
     1481    ASSERT_ARGS(PF_floattype_size) 
     1482 
     1483    switch (floattype) { 
     1484      case FLOATTYPE_4:  return 4; 
     1485      case FLOATTYPE_8:  return 8; 
     1486      case FLOATTYPE_12: return 12; 
     1487      case FLOATTYPE_16: return 16; 
     1488      case FLOATTYPE_16AIX: return 16; 
     1489      case FLOATTYPE_16MIPS: return 16; 
     1490      case FLOATTYPE_32: return 32; 
     1491      default: 
     1492        exit_fatal(1, "PF_floattype_size: Unsupported floattype=%d\n", 
     1493                   floattype); 
     1494        return 0; 
     1495    } 
     1496} 
     1497 
     1498/* 
     1499 
    14931500=item C<void PackFile_assign_transforms> 
    14941501 
    14951502Assigns transform functions to the vtable. 
     
    15181525        pf->fetch_iv = pf->fetch_op; 
    15191526 
    15201527        switch (pf->header->floattype) { 
    1521 #  if NUMVAL_SIZE == 8 
     1528#  if NUMVAL_SIZE == 4 
     1529        case FLOATTYPE_4: 
     1530            pf->fetch_nv = fetch_buf_le_4; 
     1531            break; 
     1532        case FLOATTYPE_8: 
     1533            pf->fetch_nv = cvt_num8_num4; 
     1534            break; 
     1535        case FLOATTYPE_12: 
     1536            pf->fetch_nv = cvt_num12_num4; 
     1537            break; 
     1538        case FLOATTYPE_16: 
     1539            pf->fetch_nv = cvt_num16_num4; 
     1540            break; 
     1541#  elif NUMVAL_SIZE == 8 
     1542        case FLOATTYPE_4: 
     1543            pf->fetch_nv = cvt_num4_num8; 
     1544            break; 
    15221545        case FLOATTYPE_8: 
    15231546            pf->fetch_nv = fetch_buf_le_8; 
    15241547            break; 
    15251548        case FLOATTYPE_12: 
    1526             pf->fetch_nv = cvt_num12_num8_le; 
     1549            pf->fetch_nv = cvt_num12_num8; 
    15271550            break; 
    15281551        case FLOATTYPE_16: 
    1529             pf->fetch_nv = cvt_num16_num8_le; 
     1552            pf->fetch_nv = cvt_num16_num8; 
     1553            break; 
     1554#  elif NUMVAL_SIZE == 16 
     1555        case FLOATTYPE_4: 
     1556            pf->fetch_nv = cvt_num4_num16; 
    15301557            break; 
    1531 #  endif 
    1532 #  if NUMVAL_SIZE == 16 
    15331558        case FLOATTYPE_8: 
    1534             pf->fetch_nv = cvt_num8_num16_le; 
     1559            pf->fetch_nv = cvt_num8_num16; 
    15351560            break; 
    15361561        case FLOATTYPE_12: 
    1537             pf->fetch_nv = cvt_num12_num16_le; 
     1562            pf->fetch_nv = cvt_num12_num16; 
    15381563            break; 
    15391564        case FLOATTYPE_16: 
    15401565            pf->fetch_nv = fetch_buf_le_16; 
     
    15571582        pf->fetch_iv = pf->fetch_op; 
    15581583 
    15591584        switch (pf->header->floattype) { 
    1560 #  if NUMVAL_SIZE == 8 
     1585#  if NUMVAL_SIZE == 4 
     1586        case FLOATTYPE_4: 
     1587            break; 
     1588        case FLOATTYPE_8: 
     1589            pf->fetch_nv = cvt_num8_num4; 
     1590            break; 
     1591        case FLOATTYPE_12: 
     1592            pf->fetch_nv = cvt_num12_num4; 
     1593            break; 
     1594        case FLOATTYPE_16: 
     1595            pf->fetch_nv = cvt_num16_num4; 
     1596            break; 
     1597#  elif NUMVAL_SIZE == 8 
     1598        case FLOATTYPE_4: 
     1599            pf->fetch_nv = cvt_num4_num8; 
     1600            break; 
    15611601        case FLOATTYPE_8: /* native */ 
    15621602            break; 
    15631603        case FLOATTYPE_12: 
     
    15661606        case FLOATTYPE_16: 
    15671607            pf->fetch_nv = cvt_num16_num8; 
    15681608            break; 
    1569 #  endif 
    1570 #  if NUMVAL_SIZE == 16 
     1609#  elif NUMVAL_SIZE == 16 
     1610        case FLOATTYPE_4: 
     1611            pf->fetch_nv = cvt_num4_num16; 
     1612            break; 
    15711613        case FLOATTYPE_8: 
    15721614            pf->fetch_nv = cvt_num8_num16; 
    15731615            break; 
     
    15981640        pf->fetch_iv = pf->fetch_op; 
    15991641 
    16001642        switch (pf->header->floattype) { 
    1601 #  if NUMVAL_SIZE == 8 
     1643#  if NUMVAL_SIZE == 4 
     1644        case FLOATTYPE_4: 
     1645            pf->fetch_nv = fetch_buf_be_4; 
     1646            break; 
     1647        case FLOATTYPE_8: 
     1648            pf->fetch_nv = cvt_num8_num4; 
     1649            break; 
     1650        case FLOATTYPE_12: 
     1651            exit_fatal(1, "PackFile_unpack: invalid floattype 1 big-endian"); 
     1652            break; 
     1653        case FLOATTYPE_16: 
     1654            pf->fetch_nv = cvt_num16_num4; 
     1655            break; 
     1656#  elif NUMVAL_SIZE == 8 
     1657        case FLOATTYPE_4: 
     1658            pf->fetch_nv = cvt_num4_num8; 
     1659            break; 
    16021660        case FLOATTYPE_8: 
    16031661            pf->fetch_nv = fetch_buf_be_8; 
    16041662            break; 
     
    16061664            exit_fatal(1, "PackFile_unpack: invalid floattype 1 big-endian"); 
    16071665            break; 
    16081666        case FLOATTYPE_16: 
    1609             pf->fetch_nv = cvt_num16_num8_be; 
     1667            pf->fetch_nv = cvt_num16_num8; 
     1668            break; 
     1669#  elif NUMVAL_SIZE == 12 
     1670        case FLOATTYPE_4: 
     1671            pf->fetch_nv = cvt_num4_num12; 
    16101672            break; 
    1611 #  endif 
    1612 #  if NUMVAL_SIZE == 12 
    16131673        case FLOATTYPE_8: 
    1614             pf->fetch_nv = cvt_num8_num12_be; 
     1674            pf->fetch_nv = cvt_num8_num12; 
    16151675            break; 
    16161676        case FLOATTYPE_12: 
    16171677            exit_fatal(1, "PackFile_unpack: invalid floattype 1 big-endian"); 
    16181678            break; 
    16191679        case FLOATTYPE_16: 
    1620             pf->fetch_nv = cvt_num16_num12_be; 
     1680            pf->fetch_nv = cvt_num16_num12; 
     1681            break; 
     1682#  elif NUMVAL_SIZE == 16 
     1683        case FLOATTYPE_4: 
     1684            pf->fetch_nv = cvt_num4_num16; 
    16211685            break; 
    1622 #  endif 
    1623 #  if NUMVAL_SIZE == 16 
    16241686        case FLOATTYPE_8: 
    1625             pf->fetch_nv = cvt_num8_num16_be; 
     1687            pf->fetch_nv = cvt_num8_num16; 
    16261688            break; 
    16271689        case FLOATTYPE_12: 
    16281690            exit_fatal(1, "PackFile_unpack: invalid floattype 1 big-endian"); 
     
    16481710        pf->fetch_iv = pf->fetch_op; 
    16491711 
    16501712        switch (pf->header->floattype) { 
    1651 #  if NUMVAL_SIZE == 8 
     1713#  if NUMVAL_SIZE == 4 
     1714        case FLOATTYPE_4: /* native */ 
     1715            break; 
     1716        case FLOATTYPE_8: 
     1717            pf->fetch_nv = cvt_num8_num4; 
     1718            break; 
     1719        case FLOATTYPE_12: 
     1720            pf->fetch_nv = cvt_num12_num4; 
     1721            break; 
     1722        case FLOATTYPE_16: 
     1723            pf->fetch_nv = cvt_num16_num4; 
     1724            break; 
     1725#  elif NUMVAL_SIZE == 8 
     1726        case FLOATTYPE_4: 
     1727            pf->fetch_nv = cvt_num4_num8; 
     1728            break; 
    16521729        case FLOATTYPE_8: /* native */ 
    16531730            break; 
    16541731        case FLOATTYPE_12: 
     
    16571734        case FLOATTYPE_16: 
    16581735            pf->fetch_nv = cvt_num16_num8; 
    16591736            break; 
    1660 #  endif 
    1661 #  if NUMVAL_SIZE == 12 
     1737#  elif NUMVAL_SIZE == 12 
     1738        case FLOATTYPE_4: 
     1739            pf->fetch_nv = cvt_num4_num12; 
     1740            break; 
    16621741        case FLOATTYPE_8: 
    16631742            pf->fetch_nv = cvt_num8_num12; 
    16641743            break; 
     
    16671746        case FLOATTYPE_16: 
    16681747            pf->fetch_nv = cvt_num16_num12; 
    16691748            break; 
    1670 #  endif 
    1671 #  if NUMVAL_SIZE == 16 
     1749#  elif NUMVAL_SIZE == 16 
     1750        case FLOATTYPE_4: 
     1751            pf->fetch_nv = cvt_num4_num16; 
     1752            break; 
    16721753        case FLOATTYPE_8: 
    16731754            pf->fetch_nv = cvt_num8_num16; 
    16741755            break; 
  • config/auto/jit.pm

    old new  
    5353 
    5454    my $cpuarch     = $conf->data->get('cpuarch'); 
    5555    my $osname      = $conf->data->get('osname'); 
     56    my $nvsize      = $conf->data->get('nvsize'); 
    5657 
    5758    my $jitbase  = $self->{jitbase_default};   # base path for jit sources 
    5859 
     
    6263        if $verbose; 
    6364 
    6465    my $jitcapable = 
    65         $self->_check_jitcapability($corejit, $cpuarch, $osname); 
     66        $self->_check_jitcapability($corejit, $cpuarch, $osname, $nvsize); 
    6667 
    6768    my $jitarchname = "$cpuarch-$osname"; 
    6869    _handle_asm( { 
     
    148149 
    149150sub _check_jitcapability { 
    150151    my $self = shift; 
    151     my ($corejit, $cpuarch, $osname) = @_; 
     152    my ($corejit, $cpuarch, $osname, $nvsize) = @_; 
    152153    my $jitcapable = 0; 
    153154    if ( -e $corejit ) { 
    154155 
     
    162163            $jitcapable = 1; 
    163164        } 
    164165 
     166        # Can only jit double. For long double see patch in TT #352. 
     167        # float not yet planned. 
     168        if ( $nvsize != 8 ) { 
     169            $jitcapable = 0; 
     170        } 
     171 
    165172        # Another exception 
    166173        if ( $cpuarch eq 'i386' && $osname eq 'darwin' ) { 
    167174            $jitcapable = 0; 
  • t/native_pbc/header.t

    old new  
    6464is( $h{magic}, "\xfe\x50\x42\x43\x0a\x1a\x0a", "magic string 0xfePBC0x0a0x1a0x0a len=7" ); 
    6565ok( $h{wordsize} == 2 || $h{wordsize} == 4 || $h{wordsize} == 8,  "wordsize: $h{wordsize}" ); 
    6666ok( $h{byteorder} < 2, "byteorder: $h{byteorder}" ); 
    67 ok( $h{floattype} < 3, "floattype: $h{floattype}" ); 
     67ok( $h{floattype} <= 3, "floattype: $h{floattype}" ); 
    6868is( $h{major}, $PConfig{MAJOR}, "major version: $h{major} vs $PConfig{MAJOR}" ); 
    6969is( $h{minor}, $PConfig{MINOR}, "minor version: $h{minor} vs $PConfig{MINOR}" ); 
    7070is( $h{patch}, $PConfig{PATCH}, "patch version: $h{patch} vs $PConfig{PATCH}" ); 
  • t/native_pbc/number.t

    old new  
    5555 
    5656=cut 
    5757 
    58 # tt #357: need better testmatrix for coverage overview 
     58# tt #357: testmatrix for coverage overview 
    5959# float conversion src: left-side (pbc) to dest: upper-side (platform) 
    6060# 1: tested ok, 0: fails (skip), ?: not yet tested (todo) 
    6161my $testmatrix = <<EOF; 
    62        8_le 12_le 16_le 8_be 16_be 
    63 8_le     1     1    0     1     ? 
    64 12_le    1     1    0     0     ? 
    65 16_le    1     1    1     ?     ? 
    66 8_be     1     1    ?     1     ? 
    67 16_be    1     1    1     ?     1 
     62       8_le 12_le 16_le 8_be 16_be 4_le 
     638_le     1     1     0    1     0    1 
     6412_le    1     1     0    0     0    0 
     6516_le    1     1     1    ?     ?    0 
     668_be     1     1     0    1     0    ? 
     6716_be    1     1     1    ?     1    0 
     684_le     1     1     1    ?     1    1 
    6869EOF 
    6970 
    7071=begin comment 
     
    101102#8_be     1     1    ?     1     ? 
    102103#16_be    1     1    1     ?     1 
    103104my $destarch = { '8_le'  => [1,4], '12_le' => [2], '16_le' => [5], 
    104                  '8_be'  => [3,6], '16_be' => [7] }; 
     105                 '8_be'  => [3,6], '4_le'  => [7], '16_be' => [8] }; 
    105106# the reverse: which tests for which arch 
    106 my @archtest = qw(8_le 12_le 8_be 8_le 16_le 8_be 16_be); 
     107my @archtest = qw(8_le 12_le 8_be 8_le 16_le 8_be 4_le 16_be); 
    107108# @todo lists of tests for your architecture. 
    108109# e.g. for arch 8_le => tests (8_be) => todo (3 6) 
    109110sub generate_skip_list { 
     
    157158    $todo->{8} = $todo_msg; 
    158159} 
    159160 
     161my $output_float = << 'END_OUTPUT'; 
     1621 
     1634 
     16416 
     16564 
     166256 
     1671024 
     1684096 
     16916384 
     17065536 
     171262144 
     1721048576 
     1734194304 
     1741.677722e+07 
     1756.710886e+07 
     1762.684355e+08 
     1771.073742e+09 
     1784.294967e+09 
     1791.717987e+10 
     1806.871948e+10 
     1812.748779e+11 
     1821.099512e+12 
     1834.398047e+12 
     1841.759219e+13 
     1857.036874e+13 
     1862.81475e+14 
     1871.1259e+15 
     188END_OUTPUT 
     189 
    160190my $output = << 'END_OUTPUT'; 
    1611911 
    1621924 
     
    1862161.12589990684262e+15 
    187217END_OUTPUT 
    188218 
     219$output = $output_float if $PConfig{numvalsize} == 4; 
     220 
    189221# test_pbc_number(1, "i386 8-byte double float, 32 bit opcode_t"); 
    190222sub test_pbc_number { 
    191223    my $id   = shift; 
  • tools/dev/mk_native_pbc

    old new  
    104104                # force double on 2nd run not to default to long double 
    105105                conf=" --floatval=double" 
    106106            else 
    107                 N=7 
    108                 echo "7: ppc/BE 64 bit opcode_t, 16-byte long double" 
     107                N=8 
     108                echo "8: ppc/BE 64 bit opcode_t, 16-byte long double" 
    109109            fi 
    110110        fi 
    111111    else 
  • t/steps/auto_jit-01.t

    old new  
    55 
    66use strict; 
    77use warnings; 
    8 use Test::More tests =>  50; 
     8use Test::More tests =>  51; 
    99use Carp; 
    1010use Cwd; 
    1111use File::Path qw( mkpath ); 
     
    5252    my $corejitdir = File::Spec->catdir ( $jitbase, $cpuarch ); 
    5353    mkpath( $corejitdir, 0, 755 ) or croak "Unable to make testing directory"; 
    5454    my $corejit = File::Spec->catfile( $jitbase, $cpuarch, q{core.jit} ); 
    55     is( $step->_check_jitcapability($corejit, $cpuarch, $osname), 0, 
     55    is( $step->_check_jitcapability($corejit, $cpuarch, $osname, 8), 0, 
    5656        "Got expected value for _check_jitcapability(): no core.jit case"); 
    5757 
    5858    chdir $cwd or croak "Unable to change back to starting directory"; 
     
    7171        or croak "Unable to open handle to file for testing"; 
    7272    print $FH qq{Hello, JIT\n}; 
    7373    close $FH or croak "Unable to close handle to file for testing"; 
    74     is( $step->_check_jitcapability($corejit, $cpuarch, $osname), 0, 
     74    is( $step->_check_jitcapability($corejit, $cpuarch, $osname, 8), 0, 
    7575        "Got expected value for _check_jitcapability(): no JIT on this architecture case"); 
    7676 
    7777    chdir $cwd or croak "Unable to change back to starting directory"; 
     
    9292    close $FH or croak "Unable to close handle to file for testing"; 
    9393    my $orig = $step->{jit_is_working}; 
    9494    $step->{jit_is_working} = { $cpuarch => 1 }; 
    95     is( $step->_check_jitcapability($corejit, $cpuarch, $osname), 1, 
     95    is( $step->_check_jitcapability($corejit, $cpuarch, $osname, 8), 1, 
    9696        "Got expected value for _check_jitcapability(): mock JIT case"); 
    9797    $step->{jit_is_working} = $orig; 
    9898 
     
    114114    close $FH or croak "Unable to close handle to file for testing"; 
    115115    my $orig = $step->{jit_is_working}; 
    116116    $step->{jit_is_working} = { $cpuarch => 1 }; 
    117     is( $step->_check_jitcapability($corejit, $cpuarch, $osname), 0, 
     117    is( $step->_check_jitcapability($corejit, $cpuarch, $osname, 8), 0, 
    118118        "Got expected value for _check_jitcapability(): mock darwin-i386 case"); 
    119119    $step->{jit_is_working} = $orig; 
    120120 
    121121    chdir $cwd or croak "Unable to change back to starting directory"; 
    122122} 
    123123 
     124{ 
     125    my $tdir = tempdir( CLEANUP => 1 ); 
     126    chdir $tdir or croak "Unable to change to temporary directory"; 
     127    my $jitbase = 'foo'; 
     128    my $cpuarch = 'i386'; 
     129    my $osname = 'MSWin32'; 
     130    my $corejitdir = File::Spec->catdir ( $jitbase, $cpuarch ); 
     131    mkpath( $corejitdir, 0, 755 ) or croak "Unable to make testing directory"; 
     132    my $corejit = File::Spec->catfile( $jitbase, $cpuarch, q{core.jit} ); 
     133    open my $FH, '>', $corejit 
     134        or croak "Unable to open handle to file for testing"; 
     135    print $FH qq{Hello, JIT\n}; 
     136    close $FH or croak "Unable to close handle to file for testing"; 
     137    my $orig = $step->{jit_is_working}; 
     138    $step->{jit_is_working} = { $cpuarch => 1 }; 
     139    is( $step->_check_jitcapability($corejit, $cpuarch, $osname, 4), 0, 
     140        "Got expected value for _check_jitcapability(): mock single-float"); 
     141    $step->{jit_is_working} = $orig; 
     142 
     143    chdir $cwd or croak "Unable to change back to starting directory"; 
     144} 
     145 
    124146########### _handle_asm() ########### 
    125147 
    126148{ 
  • t/compilers/imcc/imcpasm/opt1.t

    old new  
    11541154 
    11551155############################## 
    11561156 
    1157 $output = $PConfig{numvalsize} == 8 
    1158   ? '/^# IMCC does produce b0rken PASM files 
     1157if ($PConfig{numvalsize} == 8) { 
     1158    $output = '/^# IMCC does produce b0rken PASM files 
    11591159# see http://guest@rt.perl.org/rt3/Ticket/Display.html\?id=32392 
    11601160_main: 
    11611161   set N0, 1\.6e\+0?22 
    11621162   end$/ 
    1163 ' : '/^# IMCC does produce b0rken PASM files 
     1163'; 
     1164} 
     1165elsif ($PConfig{numvalsize} > 8) { 
     1166    $output = '/^# IMCC does produce b0rken PASM files 
    11641167# see http://guest@rt.perl.org/rt3/Ticket/Display.html\?id=32392 
    11651168_main: 
    11661169   set N0, 16000000000000000000000 
    11671170   end$/ 
    11681171'; 
     1172} 
     1173elsif ($PConfig{numvalsize} < 8) { 
     1174    $output = '/^# IMCC does produce b0rken PASM files 
     1175# see http://guest@rt.perl.org/rt3/Ticket/Display.html\?id=32392 
     1176_main: 
     1177        set N0, 1\.6e\+22 
     1178        end$/ 
     1179'; 
     1180} 
    11691181 
    11701182pir_2_pasm_like( <<'CODE', $output, "constant add big nums" ); 
    11711183.sub _main 
  • t/op/arithmetics.t

    old new  
    1111 
    1212# test for GMP 
    1313use Parrot::Config; 
     14my $output; 
    1415 
    1516=head1 NAME 
    1617 
     
    184185# 
    185186 
    186187pasm_output_is( <<'CODE', <<OUTPUT, 'negate a native number' ); 
    187         set N0, 123.4567890 
     188        set N0, 123.456 
    188189        neg N0 
    189190        say N0 
    190         set N0, -123.4567890 
     191        set N0, -123.456 
    191192        neg N0 
    192193        say N0 
    193         set N0, 123.4567890 
     194        set N0, 123.456 
    194195        neg N1, N0 
    195196        say N1 
    196         set N0, -123.4567890 
     197        set N0, -123.456 
    197198        neg N1, N0 
    198199        say N1 
    199200        end 
    200201CODE 
    201 -123.456789 
    202 123.456789 
    203 -123.456789 
    204 123.456789 
     202-123.456 
     203123.456 
     204-123.456 
     205123.456 
    205206OUTPUT 
    206207 
    207208pasm_output_is( <<'CODE', <<OUTPUT, "take the absolute of a native number" ); 
     
    211212        set N0, -0.0 
    212213        abs N0 
    213214        say N0 
    214         set N0, 123.45678901 
     215        set N0, 123.456 
    215216        abs N0 
    216217        say N0 
    217         set N0, -123.45678901 
     218        set N0, -123.456 
    218219        abs N0 
    219220        say N0 
    220221        set N0, 0 
     
    225226        set N1, 1 
    226227        abs N1, N0 
    227228        say N1 
    228         set N0, 123.45678901 
     229        set N0, 123.456 
    229230        set N1, 1 
    230231        abs N1, N0 
    231232        say N1 
    232         set N0, -123.45678901 
     233        set N0, -123.456 
    233234        set N1, 1 
    234235        abs N1, N0 
    235236        say N1 
     
    237238CODE 
    2382390 
    2392400 
    240 123.45678901 
    241 123.45678901 
     241123.456 
     242123.456 
    2422430 
    2432440 
    244 123.45678901 
    245 123.45678901 
     245123.456 
     246123.456 
    246247OUTPUT 
    247248 
    248249pasm_output_is( <<'CODE', <<OUTPUT, "ceil of a native number" ); 
     
    462463-4123.369 
    463464OUTPUT 
    464465 
    465 pasm_output_is( <<'CODE', <<OUTPUT, "multiply native number with native number" ); 
     466$output = $PConfig{numvalsize} < 8 
     467  ? '-492522.3 
     468-492522.3 
     469' 
     470  : '-492522.288258 
     471-492522.288258 
     472'; 
     473 
     474pasm_output_is( <<'CODE', $output, "multiply native number with native number" ); 
    466475        set N2, 4000.246 
    467476        set N0, -123.123 
    468477        mul N1, N0, N2 
     
    471480        say N0 
    472481        end 
    473482CODE 
    474 -492522.288258 
    475 -492522.288258 
    476 OUTPUT 
    477483 
    478 pasm_output_is( <<'CODE', <<OUTPUT, "divide native number by native number" ); 
     484$output = $PConfig{numvalsize} < 8 
     485  ? '-0.03077886 
     486-0.03077886 
     487' 
     488  : '-0.0307788571002883 
     489-0.0307788571002883 
     490'; 
     491 
     492pasm_output_is( <<'CODE', $output, "divide native number by native number" ); 
    479493        set N2, 4000.246 
    480494        set N0, -123.123 
    481495        div N1, N0, N2 
     
    484498        say N0 
    485499        end 
    486500CODE 
    487 -0.0307788571002883 
    488 -0.0307788571002883 
    489 OUTPUT 
    490501 
    491502pasm_output_is( <<'CODE', <<OUTPUT, "lcm_I_I_I" ); 
    492503        set I0, 10 
  • t/op/integer.t

    old new  
    66use warnings; 
    77use lib qw( . lib ../lib ../../lib ); 
    88use Test::More; 
     9use Parrot::Config; 
    910use Parrot::Test tests => 56; 
     11my $output; 
    1012 
    1113=head1 NAME 
    1214 
     
    103510375 
    10361038OUTPUT 
    10371039 
    1038 pasm_output_is( <<CODE, <<OUTPUT, "set_n_i" ); 
     1040$output = $PConfig{numvalsize} < 8 
     1041  ? '0 
     10422.147484e+09 
     1043-2.147484e+09 
     1044' 
     1045  : '0 
     10462147483647 
     1047-2147483648 
     1048'; 
     1049 
     1050pasm_output_is( <<CODE, $output, "set_n_i" ); 
    10391051        set     I0, 0 
    10401052        set     N0, I0 
    1041         print   N0 
    1042         print   "\\n" 
     1053        say     N0 
    10431054 
    10441055        set     I1, 2147483647 
    10451056        set     N1, I1 
    1046         print   N1 
    1047         print   "\\n" 
     1057        say     N1 
    10481058 
    10491059        set     I2, -2147483648 
    10501060        set     N2, I2 
    1051         print   N2 
    1052         print   "\\n" 
     1061        say     N2 
    10531062        end 
    10541063CODE 
    1055 0 
    1056 2147483647 
    1057 -2147483648 
    1058 OUTPUT 
    10591064 
    10601065pasm_output_is( <<CODE, <<OUTPUT, "cleari" ); 
    10611066        set     I0, 0xdeadbee 
  • t/op/number.t

    old new  
    2525 
    2626my $output; 
    2727 
    28 pasm_output_is( <<CODE, <<OUTPUT, "set_n_nc" ); 
     28$output = $PConfig{numvalsize} < 8 
     29  ? '1 
     304 
     3116 
     3264 
     33256 
     341024 
     354096 
     3616384 
     3765536 
     38262144 
     391048576 
     404194304 
     411.677722e+07 
     426.710886e+07 
     432.684355e+08 
     441.073742e+09 
     454.294967e+09 
     461.717987e+10 
     476.871948e+10 
     482.748779e+11 
     491.099512e+12 
     504.398047e+12 
     511.759219e+13 
     527.036874e+13 
     532.81475e+14 
     541.1259e+15 
     55' 
     56  : '1 
     574 
     5816 
     5964 
     60256 
     611024 
     624096 
     6316384 
     6465536 
     65262144 
     661048576 
     674194304 
     6816777216 
     6967108864 
     70268435456 
     711073741824 
     724294967296 
     7317179869184 
     7468719476736 
     75274877906944 
     761099511627776 
     774398046511104 
     7817592186044416 
     7970368744177664 
     80281474976710656 
     811.12589990684262e+15 
     82'; 
     83 
     84pasm_output_is( <<CODE, $output, "set_n_nc" ); 
    2985        set     N0, 1.0 
    3086        set     N1, 4.0 
    3187        set     N2, 16.0 
     
    107163        print   "\\n" 
    108164        end 
    109165CODE 
    110 1 
    111 4 
    112 16 
    113 64 
    114 256 
    115 1024 
    116 4096 
    117 16384 
    118 65536 
    119 262144 
    120 1048576 
    121 4194304 
    122 16777216 
    123 67108864 
    124 268435456 
    125 1073741824 
    126 4294967296 
    127 17179869184 
    128 68719476736 
    129 274877906944 
    130 1099511627776 
    131 4398046511104 
    132 17592186044416 
    133 70368744177664 
    134 281474976710656 
    135 1.12589990684262e+15 
    136 OUTPUT 
    137166 
    138167pasm_output_is( <<CODE, <<OUTPUT, "set_n" ); 
    139168        set     N0, 42.0 
     
    804833-5 
    805834OUTPUT 
    806835 
    807 pasm_output_is( <<CODE, <<OUTPUT, "set_i_n" ); 
     836$output = $PConfig{numvalsize} < 8 
     837  # TODO numeric overflow in single-float 
     838  ? '0 
     839-2147483648 
     840-2147483648 
     841' 
     842  : '0 
     8432147483647 
     844-2147483648 
     845'; 
     846 
     847pasm_output_is( <<CODE, $output, "set_i_n" ); 
    808848        set     N0, 0.0 
    809849        set     I0, N0 
    810850        print   I0 
     
    821861        print   "\\n" 
    822862        end 
    823863CODE 
    824 0 
    825 2147483647 
    826 -2147483648 
    827 OUTPUT 
    828864 
    829865pasm_output_is( <<CODE, <<OUTPUT, "clearn" ); 
    830866        set     N0, 547972.0 
     
    93096612 
    931967OUTPUT 
    932968 
    933 pasm_output_is( <<CODE, <<OUTPUT, "fact_n_i" ); 
     969$output = $PConfig{numvalsize} < 8 
     970  ? '6 
     9713.99168e+07 
     9721 
     9731 
     974' 
     975  : '6 
     97639916800 
     9771 
     9781 
     979'; 
     980 
     981pasm_output_is( <<CODE, $output, "fact_n_i" ); 
    934982    set I0, 3 
    935983    set I1, 11 
    936984    set I2, 0 
     
    949997    print "\\n" 
    950998    end 
    951999CODE 
    952 6 
    953 39916800 
    954 1 
    955 1 
    956 OUTPUT 
    9571000 
    958 pasm_output_is( <<CODE, <<OUTPUT, "fact_n_ic" ); 
     1001pasm_output_is( <<CODE, $output, "fact_n_ic" ); 
    9591002    fact N5, 3 
    9601003    print N5 
    9611004    print "\\n" 
     
    9701013    print "\\n" 
    9711014    end 
    9721015CODE 
    973 6 
    974 39916800 
    975 1 
    976 1 
    977 OUTPUT 
    9781016 
    9791017pasm_output_is( <<'CODE', <<OUTPUT, "exchange" ); 
    9801018    set N1, 1.234560 
     
    108111190.5 
    10821120OUTPUT 
    10831121 
    1084 # long double succeeds 
    1085 $output = $PConfig{numvalsize} == 8 
    1086   ? '1.4142135623731 
     1122# double looses 
     1123if ($PConfig{numvalsize} == 8) { 
     1124    $output = '1.4142135623731 
    108711251.41421356237309 
    1088 ' : '1.4142135623731 
     1126'; 
     1127} 
     1128# single-float not bad 
     1129elsif ($PConfig{numvalsize} < 8) { 
     1130    $output = '1.414214 
     11311.414214 
     1132'; 
     1133} 
     1134# and long double succeeds 
     1135elsif ($PConfig{numvalsize} > 8) { 
     1136    $output = '1.4142135623731 
    108911371.4142135623731 
    10901138'; 
     1139} 
     1140 
    10911141pasm_output_is( <<'CODE', $output, "sqrt_n_n" ); 
    10921142        set N1, 2 
    10931143        sqrt N2, N1 
  • t/op/sprintf.t

    old new  
    325325 
    326326    .local string test_file 
    327327 
     328    .local int nvsize 
     329    load_bytecode 'config.pbc' 
     330    $P0 = _config() 
     331    nvsize = $P0["nvsize"] 
     332 
    328333    bsr reset_skip_info 
    329334    test_file = 'sprintf_tests' 
    330335    skip_info[5] = 'parrot extension (%B)' 
     
    373378    skip_info[307] = 'perl5-specific extension (%v...)' 
    374379    skip_info[308] = 'perl5-specific extension (%v...)' 
    375380 
     381    if nvsize >= 8 goto end_float 
     382    skip_info[11] = 'too high for single-float %G' 
     383    skip_info[12] = 'too high for single-float %G' 
     384    skip_info[14] = 'too high for single-float %G' 
     385    skip_info[15] = 'too high for single-float %G' 
     386    skip_info[102] = 'too high for single-float %e' 
     387    skip_info[104] = 'too high for single-float %e' 
     388    skip_info[122] = 'too high for single-float %e' 
     389    skip_info[123] = 'too high for single-float %e' 
     390    skip_info[162] = 'too high for single-float %e' 
     391    skip_info[163] = 'too high for single-float %e' 
     392    skip_info[164] = 'too high for single-float %e' 
     393    skip_info[165] = 'too high for single-float %e' 
     394    skip_info[167] = 'too high for single-float %e' 
     395    skip_info[178] = 'too high for single-float %e' 
     396    skip_info[179] = 'too high for single-float %e' 
     397    skip_info[185] = 'too high for single-float %e' 
     398    skip_info[186] = 'too high for single-float %e' 
     399 
     400  end_float: 
    376401    skip_tests[test_file] = skip_info 
    377402 
    378403    .return (skip_tests) 
  • t/op/time.t

    old new  
    6363ok, (now>before) timelords need not apply 
    6464OUTPUT 
    6565 
    66 pasm_output_is( <<CODE, <<OUTPUT, "sleep" ); 
    67         print   "start\\n" 
     66pir_output_is( <<'CODE', <<OUTPUT, "sleep" ); 
     67.sub main :main 
    6868 
    69         time    I1 
     69        say   "start" 
     70        time    $I1 
    7071 
    7172        sleep   1 
    72         set     I0, 1 
    73         sleep   I0 
     73        set     $I0, 1 
     74        sleep   $I0 
    7475 
    75         time    I0 
     76        time    $I0 
    7677 
    77         gt      I0, I1, ALLOK 
    78         print   "no, sleeping made time go the wrong way " 
     78        gt      $I0, $I1, ALLOK 
     79        print   "no, sleeping made time go the wrong way: I0=" 
     80        print   $I0 
     81        print   ", I1=" 
     82        print   $I1 
     83        print   " " 
    7984 
    8085ALLOK: 
    81         print   "done\\n" 
    82         end 
     86        say   "done" 
     87.end 
    8388CODE 
    8489start 
    8590done 
  • src/scheduler.c

    old new  
    999999#if PARROT_HAS_THREADS 
    10001000    Parrot_cond condition; 
    10011001    Parrot_mutex lock; 
     1002#if NUMVAL_SIZE > 4 
    10021003    FLOATVAL timer_end = time + Parrot_floatval_time(); 
     1004#else 
     1005    UINTVAL timer_end = time + Parrot_intval_time(); 
     1006#endif 
    10031007    struct timespec time_struct; 
    10041008 
    10051009    /* Tell the scheduler runloop to wake, this is a good time to process 
     
    10111015    MUTEX_INIT(lock); 
    10121016    LOCK(lock); 
    10131017    time_struct.tv_sec = (time_t) timer_end; 
     1018#if NUMVAL_SIZE > 4 
    10141019    time_struct.tv_nsec = (long)((timer_end - time_struct.tv_sec)*1000.0f) *1000L*1000L; 
     1020#else 
     1021    time_struct.tv_nsec = (long)((timer_end*1000L - time_struct.tv_sec*1000L)*1000.0f); 
     1022#endif 
    10151023    COND_TIMED_WAIT(condition, lock, &time_struct); 
    10161024    UNLOCK(lock); 
    10171025    COND_DESTROY(condition); 
  • t/pmc/bigint.t

    old new  
    129129ok 4 
    130130OUT 
    131131 
    132 pasm_output_is( <<'CODE', <<'OUT', "set double, get str" ); 
     132my $output = $PConfig{numvalsize} < 8 ? "1229999964160\n" : "1230000000000\n"; 
     133# inexact with short floats 
     134pasm_output_is( <<'CODE', $output, "set double, get str" ); 
    133135   new P0, ['BigInt'] 
    134136   set P0, 1.23e12 
    135    print P0 
    136    print "\n" 
     137   say P0 
    137138   end 
    138139CODE 
    139 1230000000000 
    140 OUT 
    141140 
     141# but exact with strings 
    142142pasm_output_is( <<'CODE', <<'OUT', "set str, get str" ); 
    143143   new P0, ['BigInt'] 
    144144   set P0, "1230000000000" 
  • t/pmc/complex.t

    old new  
    1717=cut 
    1818 
    1919.sub main :main 
     20    .local int nvsize 
     21    load_bytecode "config.pbc" 
     22    $P0 = _config() 
     23    nvsize = $P0['nvsize'] 
     24    if nvsize > 4 goto no_singlefloat 
     25    say "1..0 # SKIP crashes on single float" 
     26    goto fin 
     27 
     28 no_singlefloat: 
    2029    .include 'test_more.pir' 
    21     .include 'fp_equality.pasm' 
     30    # .include 'fp_equality.pasm' 
    2231    .include "iglobals.pasm" 
    2332 
    2433    plan(467) 
     
    7988    add_using_subclass_of_complex_bug_59630() 
    8089 
    8190    # END_OF_TESTS 
    82  
     91  fin: 
    8392.end 
    8493 
    8594.macro exception_is( M ) 
  • runtime/parrot/include/fp_equality.pasm

    old new  
    3636.endm 
    3737 
    3838.macro fp_eq_pasm ( J, K, L ) 
     39    set N13, 0.000001 
    3940    set N10, .J 
    4041    set N11, .K 
    4142    sub N12, N11, N10 
    4243    abs N12, N12 
    43     gt  N12, 0.000001, .$FPEQNOK 
     44    gt  N12, N13, .$FPEQNOK 
    4445 
    4546    branch  .L 
    4647.label $FPEQNOK: 
    4748.endm 
    4849 
     50.macro fp_eq_prec_pasm ( J, K, L, M ) 
     51    set N10, .J 
     52    set N11, .K 
     53    sub N12, N11, N10 
     54    abs N12, N12 
     55    set N13, .L 
     56    gt  N12, N13, .$FPEQNOK 
     57 
     58    branch  .M 
     59.label $FPEQNOK: 
     60.endm 
    4961 
    5062.macro fp_ne_pasm ( J, K, L ) 
    5163    set N10, .J 
  • t/pmc/float.t

    old new  
    2424 
    2525=cut 
    2626 
     27my $output; 
    2728 
    2829pasm_output_is( <<"CODE", <<OUTPUT, "basic assignment" ); 
    2930    .include 'include/fp_equality.pasm' 
     
    109110pasm_output_is( <<"CODE", <<OUTPUT, "multiply number by self" ); 
    110111    .include 'include/fp_equality.pasm' 
    111112    new P0, ['Float'] 
    112     set P0, 123.4 
     113    set P0, 12.4 
    113114    mul P0, P0, P0 
    114     .fp_eq_pasm( P0, 15227.56, EQ1) 
     115    .fp_eq_pasm( P0, 153.76, EQ1) 
    115116    print P0 
    116     print "not " 
    117 EQ1:    print "ok 1\\n" 
     117    print " not " 
     118EQ1:    say "ok 1" 
    118119    end 
    119120CODE 
    120121ok 1 
     
    288289 
    289290pasm_output_is( << "CODE", << 'OUTPUT', "Basic integer arithmetic: subtraction" ); 
    290291    .include 'include/fp_equality.pasm' 
    291     new P0, ['Float'] 
     292    open P0, 'runtime/parrot/include/config.fpmc', 'r' 
     293    read S2, P0, 60000 
     294    close P0 
     295    thaw P1, S2 
     296    set N1, P1['nvsize'] 
     297    set N2, 0.000001 
     298    gt N1, 4, no_float 
     299    set N2, 0.001 
     300no_float:   new P0, ['Float'] 
    292301    set P0, 103.45 
    293302    sub P0, 77 
    294     .fp_eq_pasm(P0, 26.45, EQ1) 
     303    .fp_eq_prec_pasm(P0, 26.45, N2, EQ1) 
    295304    print P0 
    296305    print "not " 
    297 EQ1:    print "ok 1\\n" 
     306EQ1:    say "ok 1" 
    298307 
    299308    sub P0, -24 
    300     .fp_eq_pasm(P0, 50.45, EQ2) 
     309    .fp_eq_prec_pasm(P0, 50.45, N2, EQ2) 
    301310    print P0 
    302311    print "not " 
    303 EQ2:    print "ok 2\\n" 
     312EQ2:    say "ok 2" 
    304313    end 
    305314CODE 
    306315ok 1 
     
    113411431 
    11351144OUTPUT 
    11361145 
    1137 pir_output_is( <<'CODE', <<'OUTPUT', 'acos as a method' ); 
     1146$output = $PConfig{numvalsize} < 8 
     1147  ? "acos(0.0) is 1.570796371\nacos(0.5) is 1.047197580\n" 
     1148  : "acos(0.0) is 1.570796327\nacos(0.5) is 1.047197551\n"; 
     1149 
     1150pir_output_is( <<'CODE', $output, 'acos as a method' ); 
    11381151.include 'fp_equality.pasm' 
    11391152.sub main :main 
    11401153    .local pmc array 
     
    11571170    say $S0 
    11581171.end 
    11591172CODE 
    1160 acos(0.0) is 1.570796327 
    1161 acos(0.5) is 1.047197551 
    1162 OUTPUT 
    11631173 
    1164 pir_output_is( <<'CODE', <<'OUTPUT', 'cos as a method' ); 
     1174$output = $PConfig{numvalsize} < 8 
     1175  ? "cos(0.0) is 1.000000000\ncos(0.5) is 0.877582550\n" 
     1176  : "cos(0.0) is 1.000000000\ncos(0.5) is 0.877582562\n"; 
     1177 
     1178pir_output_is( <<'CODE', $output, 'cos as a method' ); 
    11651179.include 'fp_equality.pasm' 
    11661180.sub main :main 
    11671181    .local pmc array 
     
    11841198    say $S0 
    11851199.end 
    11861200CODE 
    1187 cos(0.0) is 1.000000000 
    1188 cos(0.5) is 0.877582562 
    1189 OUTPUT 
    11901201 
    1191 pir_output_is( <<'CODE', <<'OUTPUT', 'asec as a method' ); 
     1202$output = $PConfig{numvalsize} < 8 
     1203  ? "asec(1.0) is 0.000000000\nasec(3.0) is 1.230959415\n" 
     1204  : "asec(1.0) is 0.000000000\nasec(3.0) is 1.230959417\n"; 
     1205 
     1206pir_output_is( <<'CODE', $output, 'asec as a method' ); 
    11921207.include 'fp_equality.pasm' 
    11931208.sub main :main 
    11941209    .local pmc array 
     
    12111226    say $S0 
    12121227.end 
    12131228CODE 
    1214 asec(1.0) is 0.000000000 
    1215 asec(3.0) is 1.230959417 
    1216 OUTPUT 
    12171229 
    1218 pir_output_is( <<'CODE', <<'OUTPUT', 'asin as a method' ); 
     1230$output = $PConfig{numvalsize} < 8 
     1231  ? "asin(0.0) is 0.000000000\nasin(0.5) is 0.523598790\n" 
     1232  : "asin(0.0) is 0.000000000\nasin(0.5) is 0.523598776\n"; 
     1233 
     1234pir_output_is( <<'CODE', $output, 'asin as a method' ); 
    12191235.include 'fp_equality.pasm' 
    12201236.sub main :main 
    12211237    .local pmc array 
     
    12381254    say $S0 
    12391255.end 
    12401256CODE 
    1241 asin(0.0) is 0.000000000 
    1242 asin(0.5) is 0.523598776 
    1243 OUTPUT 
    12441257 
    1245 pir_output_is( <<'CODE', <<'OUTPUT', 'atan as a method' ); 
     1258$output = $PConfig{numvalsize} < 8 
     1259  ? "atan(0.0) is 0.000000000\natan(0.5) is 0.463647604\n" 
     1260  : "atan(0.0) is 0.000000000\natan(0.5) is 0.463647609\n"; 
     1261 
     1262pir_output_is( <<'CODE', $output, 'atan as a method' ); 
    12461263.include 'fp_equality.pasm' 
    12471264.sub main :main 
    12481265    .local pmc array 
     
    12651282    say $S0 
    12661283.end 
    12671284CODE 
    1268 atan(0.0) is 0.000000000 
    1269 atan(0.5) is 0.463647609 
    1270 OUTPUT 
    12711285 
    1272 pir_output_is( <<'CODE', <<'OUTPUT', 'atan2 as a method' ); 
     1286$output = $PConfig{numvalsize} < 8 
     1287  ? "atan2(0.7, 0.5) is 0.950546861\n" 
     1288  : "atan2(0.7, 0.5) is 0.950546841\n"; 
     1289 
     1290pir_output_is( <<'CODE', $output, 'atan2 as a method' ); 
    12731291.include 'fp_equality.pasm' 
    12741292.sub main :main 
    12751293    .local pmc array 
     
    12871305    say $S0 
    12881306.end 
    12891307CODE 
    1290 atan2(0.7, 0.5) is 0.950546841 
    1291 OUTPUT 
    12921308 
    1293 pir_output_is( <<'CODE', <<'OUTPUT', 'cosh as a method' ); 
     1309$output = $PConfig{numvalsize} < 8 
     1310  ? "cosh(0.0) is 1.000000000\ncosh(0.5) is 1.127625942\n" 
     1311  : "cosh(0.0) is 1.000000000\ncosh(0.5) is 1.127625965\n"; 
     1312 
     1313pir_output_is( <<'CODE', $output, 'cosh as a method' ); 
    12941314.include 'fp_equality.pasm' 
    12951315.sub main :main 
    12961316    .local pmc array 
     
    13131333    say $S0 
    13141334.end 
    13151335CODE 
    1316 cosh(0.0) is 1.000000000 
    1317 cosh(0.5) is 1.127625965 
    1318 OUTPUT 
    13191336 
    1320 pir_output_is( <<'CODE', <<'OUTPUT', 'exp as a method' ); 
     1337$output = $PConfig{numvalsize} < 8 
     1338  ? "exp(0.0) is 1.000000000\nexp(0.5) is 1.648721218\n" 
     1339  : "exp(0.0) is 1.000000000\nexp(0.5) is 1.648721271\n"; 
     1340 
     1341pir_output_is( <<'CODE', $output, 'exp as a method' ); 
    13211342.include 'fp_equality.pasm' 
    13221343.sub main :main 
    13231344    .local pmc array 
     
    13401361    say $S0 
    13411362.end 
    13421363CODE 
    1343 exp(0.0) is 1.000000000 
    1344 exp(0.5) is 1.648721271 
    1345 OUTPUT 
    13461364 
    1347 pir_output_is( <<'CODE', <<'OUTPUT', 'ln as a method' ); 
     1365$output = $PConfig{numvalsize} < 8 
     1366  ? "ln(45.0) is 3.806662560\nln(0.5) is -0.693147182\n" 
     1367  : "ln(45.0) is 3.806662490\nln(0.5) is -0.693147181\n"; 
     1368 
     1369pir_output_is( <<'CODE', $output, 'ln as a method' ); 
    13481370.include 'fp_equality.pasm' 
    13491371.sub main :main 
    13501372    .local pmc array 
     
    13671389    say $S0 
    13681390.end 
    13691391CODE 
    1370 ln(45.0) is 3.806662490 
    1371 ln(0.5) is -0.693147181 
    1372 OUTPUT 
    13731392 
    1374 pir_output_is( <<'CODE', <<'OUTPUT', 'log10 as a method' ); 
     1393$output = $PConfig{numvalsize} < 8 
     1394  ? "log10(1000.0) is 3.000000000\nlog10(0.5) is -0.301030010\n" 
     1395  : "log10(1000.0) is 3.000000000\nlog10(0.5) is -0.301029996\n"; 
     1396 
     1397pir_output_is( <<'CODE', $output, 'log10 as a method' ); 
    13751398.include 'fp_equality.pasm' 
    13761399.sub main :main 
    13771400    .local pmc array 
     
    13941417    say $S0 
    13951418.end 
    13961419CODE 
    1397 log10(1000.0) is 3.000000000 
    1398 log10(0.5) is -0.301029996 
    1399 OUTPUT 
    14001420 
    1401 pir_output_is( <<'CODE', <<'OUTPUT', 'log2 as a method' ); 
     1421$output = $PConfig{numvalsize} < 8 
     1422  ? "log2(32.0) is 5.000000000\nlog2(0.5) is -1.000000000\n" 
     1423  : "log2(32.0) is 5.000000000\nlog2(0.5) is -1.000000000\n"; 
     1424 
     1425pir_output_is( <<'CODE', $output, 'log2 as a method' ); 
    14021426.include 'fp_equality.pasm' 
    14031427.sub main :main 
    14041428    .local pmc array 
     
    14211445    say $S0 
    14221446.end 
    14231447CODE 
    1424 log2(32.0) is 5.000000000 
    1425 log2(0.5) is -1.000000000 
    1426 OUTPUT 
    14271448 
    1428 pir_output_is( <<'CODE', <<'OUTPUT', 'sec as a method' ); 
     1449$output = $PConfig{numvalsize} < 8 
     1450  ? "sec(0.0) is 1.000000000\nsec(0.5) is 1.139493942\n" 
     1451  : "sec(0.0) is 1.000000000\nsec(0.5) is 1.139493927\n"; 
     1452 
     1453pir_output_is( <<'CODE', $output, 'sec as a method' ); 
    14291454.include 'fp_equality.pasm' 
    14301455.sub main :main 
    14311456    .local pmc array 
     
    14481473    say $S0 
    14491474.end 
    14501475CODE 
    1451 sec(0.0) is 1.000000000 
    1452 sec(0.5) is 1.139493927 
    1453 OUTPUT 
    14541476 
    1455 pir_output_is( <<'CODE', <<'OUTPUT', 'sech as a method' ); 
     1477$output = $PConfig{numvalsize} < 8 
     1478  ? "sech(0.0) is 1.000000000\nsech(0.5) is 0.886818886\n" 
     1479  : "sech(0.0) is 1.000000000\nsech(0.5) is 0.886818884\n"; 
     1480 
     1481pir_output_is( <<'CODE', $output, 'sech as a method' ); 
    14561482.include 'fp_equality.pasm' 
    14571483.sub main :main 
    14581484    .local pmc array 
     
    14751501    say $S0 
    14761502.end 
    14771503CODE 
    1478 sech(0.0) is 1.000000000 
    1479 sech(0.5) is 0.886818884 
    1480 OUTPUT 
    14811504 
    1482 pir_output_is( <<'CODE', <<'OUTPUT', 'sin as a method' ); 
     1505$output = $PConfig{numvalsize} < 8 
     1506  ? "sin(0.0) is 0.000000000\nsin(0.5) is 0.479425550\n" 
     1507  : "sin(0.0) is 0.000000000\nsin(0.5) is 0.479425539\n"; 
     1508 
     1509pir_output_is( <<'CODE', $output, 'sin as a method' ); 
    14831510.include 'fp_equality.pasm' 
    14841511.sub main :main 
    14851512    .local pmc array 
     
    15021529    say $S0 
    15031530.end 
    15041531CODE 
    1505 sin(0.0) is 0.000000000 
    1506 sin(0.5) is 0.479425539 
    1507 OUTPUT 
    15081532 
    1509 pir_output_is( <<'CODE', <<'OUTPUT', 'sinh as a method' ); 
     1533$output = $PConfig{numvalsize} < 8 
     1534  ? "sinh(0.0) is 0.000000000\nsinh(0.5) is 0.521095276\n" 
     1535  : "sinh(0.0) is 0.000000000\nsinh(0.5) is 0.521095305\n"; 
     1536 
     1537pir_output_is( <<'CODE', $output, 'sinh as a method' ); 
    15101538.include 'fp_equality.pasm' 
    15111539.sub main :main 
    15121540    .local pmc array 
     
    15291557    say $S0 
    15301558.end 
    15311559CODE 
    1532 sinh(0.0) is 0.000000000 
    1533 sinh(0.5) is 0.521095305 
    1534 OUTPUT 
    15351560 
    1536 pir_output_is( <<'CODE', <<'OUTPUT', 'tan as a method' ); 
     1561$output = $PConfig{numvalsize} < 8 
     1562  ? "tan(0.0) is 0.000000000\ntan(0.5) is 0.546302497\n" 
     1563  : "tan(0.0) is 0.000000000\ntan(0.5) is 0.546302490\n"; 
     1564 
     1565pir_output_is( <<'CODE', $output, 'tan as a method' ); 
    15371566.include 'fp_equality.pasm' 
    15381567.sub main :main 
    15391568    .local pmc array 
     
    15561585    say $S0 
    15571586.end 
    15581587CODE 
    1559 tan(0.0) is 0.000000000 
    1560 tan(0.5) is 0.546302490 
    1561 OUTPUT 
    15621588 
    1563 pir_output_is( <<'CODE', <<'OUTPUT', 'tanh as a method' ); 
     1589$output = $PConfig{numvalsize} < 8 
     1590  ? "tanh(0.0) is 0.000000000\ntanh(0.5) is 0.462117165\n" 
     1591  : "tanh(0.0) is 0.000000000\ntanh(0.5) is 0.462117157\n"; 
     1592 
     1593pir_output_is( <<'CODE', $output, 'tanh as a method' ); 
    15641594.include 'fp_equality.pasm' 
    15651595.sub main :main 
    15661596    .local pmc array 
     
    15831613    say $S0 
    15841614.end 
    15851615CODE 
    1586 tanh(0.0) is 0.000000000 
    1587 tanh(0.5) is 0.462117157 
    1588 OUTPUT 
    15891616 
    1590 pir_output_is( <<'CODE', <<'OUTPUT', 'sqrt as a method' ); 
     1617$output = $PConfig{numvalsize} < 8 
     1618  ? "sqrt(16.0) is 4.000000000\nsqrt(2.0) is 1.414213538\n" 
     1619  : "sqrt(16.0) is 4.000000000\nsqrt(2.0) is 1.414213562\n"; 
     1620 
     1621pir_output_is( <<'CODE', $output, 'sqrt as a method' ); 
    15911622.include 'fp_equality.pasm' 
    15921623.sub main :main 
    15931624    .local pmc array 
     
    16101641    say $S0 
    16111642.end 
    16121643CODE 
    1613 sqrt(16.0) is 4.000000000 
    1614 sqrt(2.0) is 1.414213562 
    1615 OUTPUT 
    16161644 
    16171645 
    16181646# Local Variables: 
  • t/pmc/nci.t

    old new  
    3131=cut 
    3232 
    3333$ENV{TEST_PROG_ARGS} ||= ''; 
     34my $output; 
    3435 
    3536SKIP: { 
    3637    unless ( -e "runtime/parrot/dynext/libnci_test$PConfig{load_ext}" ) { 
     
    14314422 
    144145OUTPUT 
    145146 
    146     pir_output_is( << 'CODE', << 'OUTPUT', "nci_d and nci_dlvar_double" ); 
     147    $output = $PConfig{numvalsize} < 8 
     148      ? "libnci_test was successfully loaded 
     149-55555.55 
     150-555555.6 
     151-5555556 
     152-5.555556e+07 
     153-5.555556e+08 
     154-5.555555e+09\n" 
     155      : "libnci_test was successfully loaded 
     156-55555.55555 
     157-555555.5555 
     158-5555555.555 
     159-55555555.55 
     160-555555555.5 
     161-5555555555\n"; 
     162 
     163    pir_output_is( << 'CODE', $output, "nci_d and nci_dlvar_double" ); 
    147164 
    148165.include "datatypes.pasm" 
    149166 
     
    196213NOT_LOADED: 
    197214.end 
    198215CODE 
    199 libnci_test was successfully loaded 
    200 -55555.55555 
    201 -555555.5555 
    202 -5555555.555 
    203 -55555555.55 
    204 -555555555.5 
    205 -5555555555 
    206 OUTPUT 
    207216 
    208     pir_output_is( << 'CODE', << 'OUTPUT', "nci_f and nci_dlvar_float" ); 
     217    $output = $PConfig{numvalsize} < 8 
     218      ? "libnci_test was successfully loaded 
     219-333 
     220-3330 
     221-33300 
     222-333000 
     223-3330000 
     224-3.33e+07\n" 
     225      : "libnci_test was successfully loaded 
     226-333 
     227-3330 
     228-33300 
     229-333000 
     230-3330000 
     231-33300000\n"; 
     232 
     233    pir_output_is( << 'CODE', $output, "nci_f and nci_dlvar_float" ); 
    209234 
    210235.include "datatypes.pasm" 
    211236 
     
    258283NOT_LOADED: 
    259284.end 
    260285CODE 
    261 libnci_test was successfully loaded 
    262 -333 
    263 -3330 
    264 -33300 
    265 -333000 
    266 -3330000 
    267 -33300000 
    268 OUTPUT 
    269286 
    270287    pir_output_is( << 'CODE', << "OUTPUT", "nci_l - return a long in an INTEGER register" ); 
    271288 
  • t/pmc/string.t

    old new  
    9494        set $S0, $P0 
    9595        is( $S0, "123", 'String obj set with literal int' ) 
    9696 
    97         set $P0, 1.23456789 
     97        set $P0, 1.23456 
    9898        set $S0, $P0 
    99         is( $S0, "1.23456789", 'String obj set with literal floating point' ) 
     99        is( $S0, "1.23456", 'String obj set with literal floating point' ) 
    100100 
    101101        set $P0, "0xFFFFFF" 
    102102        set $S0, $P0 
  • t/pmc/sub.t

    old new  
    10061006 
    10071007unlink( $l1_pbc, $l2_pbc ); 
    10081008 
    1009 pir_output_is( <<'CODE', <<'OUTPUT', "immediate code as const" ); 
     1009my $output = $PConfig{numvalsize} > 4 ? "3.14159265358979\n" : "3.141593\n"; 
     1010pir_output_is( <<'CODE', $output, "immediate code as const" ); 
    10101011.sub make_pi :immediate :anon 
    10111012    $N0 = atan 1.0, 1.0 
    10121013    $N0 *= 4 
     
    10171018 
    10181019.sub main :main 
    10191020    .const 'Sub' pi = "make_pi" 
    1020     print pi 
    1021     print "\n" 
     1021    say pi 
    10221022.end 
    10231023CODE 
    1024 3.14159265358979 
    1025 OUTPUT 
    10261024 
    10271025pir_output_is( <<'CODE', <<'OUTPUT', "immediate code as const - obj" ); 
    10281026.sub make_obj :immediate :anon 
  • t/pmc/timer.t

    old new  
    77use lib qw( . lib ../lib ../../lib ); 
    88use Test::More; 
    99use Parrot::Test tests => 6; 
     10use Parrot::Config; 
    1011 
    1112=head1 NAME 
    1213 
     
    126127/ok 2/ 
    127128OUT 
    128129 
    129     pasm_output_is( <<'CODE', <<'OUT', "Timer setup - initializer/start/stop" ); 
     130    my @todo = $PConfig{nvsize} == 4 ? 
     131       ( todo => 'single-float timer resolution' ) : (); 
     132    pasm_output_is( <<'CODE', <<'OUT', "Timer setup - initializer/start/stop", @todo ); 
    130133.include "timer.pasm" 
    131134    new P1, ['FixedPMCArray'] 
    132135    set P1, 6 
     
    153156ok 2 
    154157OUT 
    155158 
    156     my @todo = $ENV{TEST_PROG_ARGS} =~ /-j/ ? 
    157        ( todo => 'RT #49718, add scheduler features to JIT' ) : (); 
     159    @todo = $ENV{TEST_PROG_ARGS} =~ /-j/ 
     160       ? ( todo => 'RT #49718, add scheduler features to JIT' ) 
     161       : $PConfig{nvsize} == 4 
     162         ? ( todo => 'single-float timer resolution' ) 
     163         : (); 
    158164    pasm_output_is( <<'CODE', <<'OUT', "Timer setup - initializer/start/repeat" , @todo ); 
    159165.include "timer.pasm" 
    160166    new P1, ['FixedPMCArray'] 
  • t/dynoplibs/myops.t

    old new  
    5353 
    5454pir_error_output_like( << 'CODE', << 'OUTPUT', "hcf" ); 
    5555.loadlib "myops_ops" 
     56 
    5657.sub main :main 
    5758    print "neither here\n" 
    5859    hcf 
     
    7778    pasm_output_is( $quine, $quine, 'a short cheating quine', @todo ); 
    7879} 
    7980 
    80     my @todo = $ENV{TEST_PROG_ARGS} =~ /-j/ ? 
    81        ( todo => 'RT #49718, add scheduler features to JIT' ) : (); 
     81SKIP: { 
     82    skip "alarm, single-float timer resolution", 1 if $PConfig{nvsize} == 4; 
     83 
     84    my @todo = $ENV{TEST_PROG_ARGS} =~ /-j/ 
     85      ? ( todo => 'RT #49718, add scheduler features to JIT' ) 
     86      : (); 
    8287 
    83 pir_output_is( << 'CODE', << 'OUTPUT', "one alarm", @todo ); 
     88    pir_output_is( << 'CODE', << 'OUTPUT', "one alarm", @todo ); 
    8489.loadlib "myops_ops" 
    8590 
    8691.sub main :main 
     
    1091143 
    110115done. 
    111116OUTPUT 
     117} 
    112118 
    113119SKIP: { 
    114120    skip "three alarms, infinite loop under mingw32", 2 if $is_mingw; 
     
    169175/7/ 
    170176OUTPUT 
    171177 
     178    skip "alarm, single-float timer resolution", 1 if $PConfig{nvsize} == 4; 
    172179    pir_output_like( << 'CODE', << 'OUTPUT', "repeating alarm", @todo ); 
    173180 
    174181.loadlib "myops_ops" 
  • t/library/dumper.t

    old new  
    763763    .local pmc float1 
    764764 
    765765    new float1, 'Float' 
    766     float1 = 12345.678 
     766    float1 = 12345.67 
    767767    _dumper( float1, "Float:" ) 
    768768.end 
    769769.include "library/dumper.pir" 
    770770CODE 
    771 "Float:" => 12345.678 
     771"Float:" => 12345.67 
    772772OUTPUT 
    773773 
    774774# no. 18 
  • t/library/mt19937ar.t

    old new  
    77use lib qw( t . lib ../lib ../../lib ); 
    88use Test::More; 
    99use Parrot::Test tests => 10; 
     10use Parrot::Config; 
    1011 
    1112=head1 NAME 
    1213 
     
    144145OUTPUT 
    145146 
    146147 
    147 my $out = Parrot::Test::slurp_file(File::Spec->catfile( 't', 'library', 'mt19937ar.txt' )); 
     148my $out = Parrot::Test::slurp_file(File::Spec->catfile 
     149    ( 't', 'library', $PConfig{numvalsize} > 4 
     150      ? 'mt19937ar.txt' : 'mt_float.txt')); 
    148151pir_output_is( << 'CODE', $out, 'mt19937ar output' ); 
    149152.sub test :main 
    150153    load_bytecode 'library/Math/Random/mt19937ar.pbc' 
     
    177180    goto L1 
    178181  L2: 
    179182    print "\n1000 outputs of genrand_real2()\n" 
     183    .local int nvsize 
     184    load_bytecode "config.pbc" 
     185    $P1 = _config() 
     186    nvsize = $P1['nvsize'] 
    180187    i = 0 
    181188  L4: 
    182189    unless i < 1000 goto L5 
    183190    $N0 = mt.'genrand_real2'() 
    184191    $P0[0] = $N0 
     192    if nvsize > 4 goto no_singlefloat 
     193    $S0 = sprintf "%10.5f ", $P0 
     194    goto L7 
     195  no_singlefloat: 
    185196    $S0 = sprintf "%10.8f ", $P0 
     197  L7: 
    186198    print $S0 
    187199    $I0 = i % 5 
    188200    unless $I0 == 4 goto L6 
  • (a) /dev/null vs. (b) parrot-svn/t/library/mt_float.txt

    a b  
     11000 outputs of genrand_int32() 
     21067595299  955945823  477289528 4107218783 4228976476  
     33344332714 3355579695  227628506  810200273 2591290167  
     42560260675 3242736208  646746669 1479517882 4245472273  
     51143372638 3863670494 3221021970 1773610557 1138697238  
     61421897700 1269916527 2859934041 1764463362 3874892047  
     73965319921   72549643 2383988930 2600218693 3237492380  
     82792901476  725331109  605841842  271258942  715137098  
     93297999536 1322965544 4229579109 1395091102 3735697720  
     102101727825 3730287744 2950434330 1661921839 2895579582  
     112370511479 1004092106 2247096681 2111242379 3237345263  
     124082424759  219785033 2454039889 3709582971  835606218  
     132411949883 2735205030  756421180 2175209704 1873865952  
     142762534237 4161807854 3351099340  181129879 3269891896  
     15 776029799 2218161979 3001745796 1866825872 2133627728  
     16  34862734 1191934573 3102311354 2916517763 1012402762  
     172184831317 4257399449 2899497138 3818095062 3030756734  
     181282161629  420003642 2326421477 2741455717 1278020671  
     193744179621  271777016 2626330018 2560563991 3055977700  
     204233527566 1228397661 3595579322 1077915006 2395931898  
     211851927286 3013683506 1999971931 3006888962 1049781534  
     221488758959 3491776230  104418065 2448267297 3075614115  
     233872332600  891912190 3936547759 2269180963 2633455084  
     241047636807 2604612377 2709305729 1952216715  207593580  
     252849898034  670771757 2210471108  467711165  263046873  
     263569667915 1042291111 3863517079 1464270005 2758321352  
     273790799816 2301278724 3106281430    7974801 2792461636  
     28 555991332  621766759 1322453093  853629228  686962251  
     291455120532  957753161 1802033300 1021534190 3486047311  
     301902128914 3701138056 4176424663 1795608698  560858864  
     313737752754 3141170998 1553553385 3367807274  711546358  
     322475125503  262969859  251416325 2980076994 1806565895  
     33 969527843 3529327173 2736343040 2987196734 1649016367  
     342206175811 3048174801 3662503553 3138851612 2660143804  
     351663017612 1816683231  411916003 3887461314 2347044079  
     361015311755 1203592432 2170947766 2569420716  813872093  
     371105387678 1431142475  220570551 4243632715 4179591855  
     382607469131 3090613241  282341803 1734241730 1391822177  
     391001254810  827927915 1886687171 3935097347 2631788714  
     403905163266  110554195 2447955646 3717202975 3304793075  
     413739614479 3059127468  953919171 2590123714 1132511021  
     423795593679 2788030429  982155079 3472349556  859942552  
     432681007391 2299624053  647443547  233600422  608168955  
     443689327453 1849778220 1608438222 3968158357 2692977776  
     452851872572  246750393 3582818628 3329652309 4036366910  
     461012970930  950780808 3959768744 2538550045  191422718  
     472658142375 3276369011 2927737484 1234200027 1920815603  
     483536074689 1535612501 2184142071 3276955054  428488088  
     492378411984 4059769550 3913744741 2732139246   64369859  
     503755670074  842839565 2819894466 2414718973 1010060670  
     511839715346 2410311136  152774329 3485009480 4102101512  
     522852724304  879944024 1785007662 2748284463 1354768064  
     533267784736 2269127717 3001240761 3179796763  895723219  
     54 865924942 4291570937   89355264 1471026971 4114180745  
     553201939751 2867476999 2460866060 3603874571 2238880432  
     563308416168 2072246611 2755653839 3773737248 1709066580  
     574282731467 2746170170 2832568330  433439009 3175778732  
     58  26248366 2551382801  183214346 3893339516 1928168445  
     591337157619 3429096554 3275170900 1782047316 4264403756  
     601876594403 4289659572 3223834894 1728705513 4068244734  
     612867840287 1147798696  302879820 1730407747 1923824407  
     621180597908 1569786639  198796327  560793173 2107345620  
     632705990316 3448772106 3678374155  758635715  884524671  
     64 486356516 1774865603 3881226226 2635213607 1181121587  
     651508809820 3178988241 1594193633 1235154121  326117244  
     662304031425  937054774 2687415945 3192389340 2003740439  
     671823766188 2759543402   10067710 1533252662 4132494984  
     68  82378136  420615890 3467563163  541562091 3535949864  
     692277319197 3330822853 3215654174 4113831979 4204996991  
     702162248333 3255093522 2219088909 2978279037  255818579  
     712859348628 3097280311 2569721123 1861951120 2907080079  
     722719467166  998319094 2521935127 2404125338  259456032  
     732086860995 1839848496 1893547357 2527997525 1489393124  
     742860855349   76448234 2264934035  744914583 2586791259  
     751385380501   66529922 1819103258 1899300332 2098173828  
     761793831094  276463159  360132945 4178212058  595015228  
     77 177071838 2800080290 1573557746 1548998935  378454223  
     781460534296 1116274283 3112385063 3709761796  827999348  
     793580042847 1913901014  614021289 4278528023 1905177404  
     80  45407939 3298183234 1184848810 3644926330 3923635459  
     811627046213 3677876759  969772772 1160524753 1522441192  
     82 452369933 1527502551  832490847 1003299676 1071381111  
     832891255476  973747308 4086897108 1847554542 3895651598  
     842227820339 1621250941 2881344691 3583565821 3510404498  
     85 849362119  862871471  797858058 2867774932 2821282612  
     863272403146 3997979905  209178708 1805135652    6783381  
     872823361423  792580494 4263749770  776439581 3798193823  
     882853444094 2729507474 1071873341 1329010206 1289336450  
     893327680758 2011491779   80157208  922428856 1158943220  
     901667230961 2461022820 2608845159  387516115 3345351910  
     911495629111 4098154157 3156649613 3525698599 4134908037  
     92 446713264 2137537399 3617403512  813966752 1157943946  
     933734692965 1680301658 3180398473 3509854711 2228114612  
     941008102291  486805123  863791847 3189125290 1050308116  
     953777341526 4291726501  844061465 1347461791 2826481581  
     96 745465012 2055805750 4260209475 2386693097 2980646741  
     97 447229436 2077782664 1232942813 4023002732 1399011509  
     983140569849 2579909222 3794857471  900758066 2887199683  
     991720257997 3367494931 2668921229  955539029 3818726432  
     1001105704962 3889207255 2277369307 2746484505 1761846513  
     1012413916784 2685127085 4240257943 1166726899 4215215715  
     1023082092067 3960461946 1663304043 2087473241 4162589986  
     1032507310778 1579665506  767234210  970676017  492207530  
     1041441679602 1314785090 3262202570 3417091742 1561989210  
     1053011406780 1146609202 3262321040 1374872171 1634688712  
     1061280458888 2230023982  419323804 3262899800   39783310  
     1071641619040 1700368658 2207946628 2571300939 2424079766  
     108 780290914 2715195096 3390957695  163151474 2309534542  
     1091860018424  555755123  280320104 1604831083 2713022383  
     1101728987441 3639955502  623065489 3828630947 4275479050  
     1113516347383 2343951195 2430677756  635534992 3868699749  
     112 808442435 3070644069 4282166003 2093181383 2023555632  
     1131568662086 3422372620 4134522350 3016979543 3259320234  
     1142888030729 3185253876 4258779643 1267304371 1022517473  
     115 815943045  929020012 2995251018 3371283296 3608029049  
     1162018485115  122123397 2810669150 1411365618 1238391329  
     1171186786476 3155969091 2242941310 1765554882  279121160  
     1184279838515 1641578514 3796324015   13351065  103516986  
     1191609694427  551411743 2493771609 1316337047 3932650856  
     1204189700203  463397996 2937735066 1855616529 2626847990  
     121  55091862 3823351211  753448970 4045045500 1274127772  
     1221124182256   92039808 2126345552  425973257  386287896  
     1232589870191 1987762798 4084826973 2172456685 3366583455  
     1243602966653 2378803535 2901764433 3716929006 3710159000  
     1252653449155 3469742630 3096444476 3932564653 2595257433  
     126 318974657 3146202484  853571438  144400272 3768408841  
     127 782634401 2161109003  570039522 1886241521   14249488  
     1282230804228 1604941699 3928713335 3921942509 2155806892  
     129 134366254  430507376 1924011722  276713377  196481886  
     1303614810992 1610021185 1785757066  851346168 3761148643  
     1312918835642 3364422385 3012284466 3735958851 2643153892  
     1323778608231 1164289832  205853021 2876112231 3503398282  
     1333078397001 3472037921 1748894853 2740861475  316056182  
     1341660426908  168885906  956005527 3984354789  566521563  
     1351001109523 1216710575 2952284757 3834433081 3842608301  
     1362467352408 3974441264 3256601745 1409353924 1329904859  
     1372307560293 3125217879 3622920184 3832785684 3882365951  
     1382308537115 2659155028 1450441945 3532257603 3186324194  
     1391225603425 1124246549  175808705 3009142319 2796710159  
     1403651990107  160762750 1902254979 1698648476 1134980669  
     141 497144426 3302689335 4057485630 3603530763 4087252587  
     142 427812652  286876201  823134128 1627554964 3745564327  
     1432589226092 4202024494   62878473 3275585894 3987124064  
     1442791777159 1916869511 2585861905 1375038919 1403421920  
     145  60249114 3811870450 3021498009 2612993202  528933105  
     1462757361321 3341402964 2621861700  273128190 4015252178  
     1473094781002 1621621288 2337611177 1796718448 1258965619  
     1484241913140 2138560392 3022190223 4174180924  450094611  
     1493274724580  617150026 2704660665 1469700689 1341616587  
     150 356715071 1188789960 2278869135 1766569160 2795896635  
     151  57824704 2893496380 1235723989 1630694347 3927960522  
     152 428891364 1814070806 2287999787 4125941184 3968103889  
     1533548724050 1025597707 1404281500 2002212197   92429143  
     1542313943944 2403086080 3006180634 3561981764 1671860914  
     1551768520622 1803542985  844848113 3006139921 1410888995  
     1561157749833 2125704913 1789979528 1799263423  741157179  
     1572405862309  767040434 2655241390 3663420179 2172009096  
     1582511931187 1680542666  231857466 1154981000  157168255  
     1591454112128 3505872099 1929775046 2309422350 2143329496  
     1602960716902  407610648 2938108129 2581749599  538837155  
     1612342628867  430543915  740188568 1937713272 3315215132  
     1622085587024 4030765687  766054429 3517641839  689721775  
     1631294158986 1753287754 4202601348 1974852792   33459103  
     1643568087535 3144677435 1686130825 4134943013 3005738435  
     1653599293386  426570142  754104406 3660892564 1964545167  
     166 829466833  821587464 1746693036 1006492428 1595312919  
     1671256599985 1024482560 1897312280 2902903201  691790057  
     1681037515867 3176831208 1968401055 2173506824 1089055278  
     1691748401123 2941380082  968412354 1818753861 2973200866  
     1703875951774 1119354008 3988604139 1647155589 2232450826  
     1713486058011 3655784043 3759258462  847163678 1082052057  
     172 989516446 2871541755 3196311070 3929963078  658187585  
     1733664944641 2175149170 2203709147 2756014689 2456473919  
     1743890267390 1293787864 2830347984 3059280931 4158802520  
     1751561677400 2586570938  783570352 1355506163   31495586  
     1763789437343 3340549429 2092501630  896419368  671715824  
     1773530450081 3603554138 1055991716 3442308219 1499434728  
     1783130288473 3639507000   17769680 2259741420  487032199  
     1794227143402 3693771256 1880482820 3924810796  381462353  
     1804017855991 2452034943 2736680833 2209866385 2128986379  
     181 437874044  595759426  641721026 1636065708 3899136933  
     182 629879088 3591174506  351984326 2638783544 2348444281  
     1832341604660 2123933692  143443325 1525942256  364660499  
     184 599149312  939093251 1523003209  106601097  376589484  
     1851346282236 1297387043  764598052 3741218111  933457002  
     1861886424424 3219631016  525405256 3014235619  323149677  
     1872038881721 4100129043 2851715101 2984028078 1888574695  
     1882014194741 3515193880 4180573530 3461824363 2641995497  
     1893179230245 2902294983 2217320456 4040852155 1784656905  
     1903311906931   87498458 2752971818 2635474297 2831215366  
     1913682231106 2920043893 3772929704 2816374944  309949752  
     1922383758854  154870719  385111597 1191604312 1840700563  
     193 872191186 2925548701 1310412747 2102066999 1504727249  
     1943574298750 1191230036 3330575266 3180292097 3539347721  
     195 681369118 3305125752 3648233597  950049240 4173257693  
     1961760124957  512151405  681175196  580563018 1169662867  
     1974015033554 2687781101  699691603 2673494188 1137221356  
     198 123599888  472658308 1053598179 1012713758 3481064843  
     1993759461013 3981457956 3830587662 1877191791 3650996736  
     200 988064871 3515461600 4089077232 2225147448 1249609188  
     2012643151863 3896204135 2416995901 1397735321 3460025646  
     202 
     2031000 outputs of genrand_real2() 
     204   0.76275    0.99001    0.98670    0.10143    0.27933  
     205   0.69867    0.94219    0.03427    0.78842    0.28181  
     206   0.92179    0.20786    0.54535    0.69644    0.38108  
     207   0.23978    0.65287    0.07515    0.22765    0.94873  
     208   0.74558    0.62664    0.54708    0.90959    0.42043  
     209   0.86335    0.19189    0.14719    0.70260    0.63426  
     210   0.77408    0.04532    0.04606    0.88596    0.69398  
     211   0.05377    0.61711    0.05566    0.10134    0.41501  
     212   0.91811    0.22321    0.23354    0.92872    0.98897  
     213   0.19787    0.80559    0.06961    0.55840    0.90479  
     214   0.63288    0.95010    0.54948    0.20645    0.45001  
     215   0.87051    0.70807    0.19407    0.79286    0.49333  
     216   0.78484    0.75145    0.12342    0.42030    0.16728  
     217   0.59906    0.37575    0.97815    0.39816    0.43595  
     218   0.04952    0.33918    0.76510    0.61034    0.90655  
     219   0.92916    0.85366    0.18812    0.65913    0.28815  
     220   0.59476    0.27836    0.60723    0.68310    0.69387  
     221   0.03700    0.65898    0.17527    0.02889    0.86777  
     222   0.12352    0.91439    0.32023    0.44446    0.34904  
     223   0.74639    0.65918    0.92493    0.31873    0.77750  
     224   0.85414    0.76386    0.32744    0.91326    0.27458  
     225   0.22190    0.19865    0.31227    0.85321    0.84243  
     226   0.78544    0.71854    0.92504    0.82703    0.88306  
     227   0.47284    0.70059    0.48004    0.38672    0.60466  
     228   0.41747    0.47163    0.72751    0.65830    0.10955  
     229   0.64215    0.23456    0.95945    0.72822    0.40888  
     230   0.69980    0.26677    0.57334    0.39792    0.85378  
     231   0.76963    0.72005    0.90903    0.51377    0.37733  
     232   0.12692    0.71250    0.81218    0.37037    0.32772  
     233   0.14238    0.05615    0.74363    0.39773    0.94859  
     234   0.31452    0.11730    0.62963    0.33334    0.45547  
     235   0.10090    0.56551    0.60539    0.16028    0.13245  
     236   0.60960    0.04672    0.99356    0.57661    0.40270  
     237   0.45275    0.06700    0.85064    0.87743    0.54508  
     238   0.87243    0.29321    0.67661    0.68231    0.79052  
     239   0.48592    0.25186    0.93770    0.28565    0.47219  
     240   0.99055    0.13155    0.47110    0.98557    0.84398  
     241   0.12875    0.90953    0.49129    0.23793    0.79481  
     242   0.44338    0.96564    0.67749    0.55685    0.27287  
     243   0.79538    0.61965    0.22488    0.02226    0.49248  
     244   0.42247    0.91798    0.99250    0.23450    0.52532  
     245   0.10246    0.78686    0.34311    0.89893    0.40455  
     246   0.68608    0.30752    0.83601    0.54956    0.63778  
     247   0.82200    0.24891    0.48801    0.48662    0.51224  
     248   0.32970    0.31075    0.21393    0.73453    0.15566  
     249   0.58585    0.28977    0.97621    0.61499    0.23891  
     250   0.28519    0.46810    0.18372    0.37598    0.13492  
     251   0.66849    0.82811    0.56240    0.37549    0.27563  
     252   0.27522    0.74096    0.77177    0.13748    0.99747  
     253   0.92505    0.09175    0.21389    0.21767    0.31183  
     254   0.23271    0.21207    0.57903    0.77523    0.13243  
     255   0.31038    0.01205    0.71653    0.84488    0.14982  
     256   0.57423    0.45678    0.48420    0.53465    0.52667  
     257   0.46881    0.49850    0.05671    0.79022    0.03872  
     258   0.21697    0.20443    0.28949    0.81678    0.87629  
     259   0.92297    0.27373    0.84625    0.51506    0.00583  
     260   0.33296    0.91848    0.92537    0.91760    0.07541  
     261   0.71746    0.61159    0.00942    0.03136    0.71527  
     262   0.24822    0.63637    0.86160    0.26450    0.60160  
     263   0.35558    0.24477    0.07186    0.51757    0.62120  
     264   0.97981    0.69955    0.21066    0.13383    0.27693  
     265   0.59644    0.71501    0.04111    0.95730    0.91601  
     266   0.47705    0.26183    0.34707    0.07545    0.29398  
     267   0.93236    0.60486    0.48015    0.08870    0.45549  
     268   0.91873    0.38143    0.10669    0.01398    0.04520  
     269   0.93822    0.18012    0.57577    0.91428    0.30911  
     270   0.95853    0.23611    0.69620    0.69602    0.76765  
     271   0.58516    0.49479    0.11289    0.97188    0.32095  
     272   0.57564    0.40761    0.78703    0.43261    0.90878  
     273   0.84686    0.10599    0.72873    0.19315    0.66153  
     274   0.10211    0.06258    0.47951    0.47062    0.72701  
     275   0.48915    0.66110    0.60171    0.24517    0.12726  
     276   0.03451    0.90865    0.83495    0.94800    0.91035  
     277   0.14481    0.88459    0.53498    0.15963    0.55379  
     278   0.35171    0.28720    0.09098    0.00668    0.32310  
     279   0.87561    0.42535    0.91749    0.73908    0.41793  
     280   0.99280    0.87908    0.28458    0.59133    0.98672  
     281   0.28547    0.09452    0.89911    0.53681    0.37931  
     282   0.62683    0.56610    0.24802    0.52948    0.98329  
     283   0.66404    0.55524    0.75887    0.84785    0.86830  
     284   0.71449    0.84670    0.43923    0.20771    0.64158  
     285   0.25664    0.73056    0.86396    0.65853    0.99062  
     286   0.40281    0.39146    0.07291    0.97201    0.20556  
     287   0.59616    0.08138    0.45796    0.33681    0.33989  
     288   0.18717    0.53546    0.60551    0.86521    0.34291  
     289   0.72743    0.73024    0.34196    0.65020    0.02765  
     290   0.72576    0.32710    0.03421    0.26062    0.56998  
     291   0.28439    0.84423    0.77638    0.55982    0.06720  
     292   0.58449    0.71657    0.15820    0.58043    0.07948  
     293   0.40194    0.11376    0.88763    0.67532    0.71224  
     294   0.27829    0.04806    0.21144    0.58830    0.04140  
     295   0.43216    0.12953    0.94669    0.87391    0.98382  
     296   0.27751    0.90850    0.90963    0.59270    0.96102  
     297   0.49545    0.32007    0.62586    0.03120    0.85953  
     298   0.22018    0.05834    0.80731    0.53800    0.74167  
     299   0.77427    0.43938    0.54862    0.58576    0.15886  
     300   0.73214    0.11649    0.77464    0.85789    0.17062  
     301   0.66838    0.96076    0.07949    0.68522    0.89986  
     302   0.05667    0.12741    0.83471    0.63969    0.46613  
     303   0.10200    0.01195    0.10476    0.90285    0.31221  
     304   0.32981    0.46042    0.52025    0.05425    0.28331  
     305   0.60427    0.00598    0.97244    0.21136    0.78562  
     306   0.78429    0.63423    0.32910    0.44771    0.27381  
     307   0.14967    0.18156    0.65687    0.28726    0.97075  
     308   0.63676    0.96649    0.24526    0.08297    0.54258  
     309   0.03167    0.33735    0.15947    0.02103    0.46228  
     310   0.11892    0.33408    0.29876    0.29848    0.73768  
     311   0.02081    0.62980    0.08082    0.22993    0.25031  
     312   0.87788    0.45150    0.13673    0.63408    0.97908  
     313   0.52242    0.50580    0.06274    0.05270    0.77032  
     314   0.05113    0.24393    0.75036    0.37436    0.22878  
     315   0.59975    0.85708    0.88691    0.85547    0.36641  
     316   0.58720    0.45463    0.09244    0.32982    0.07820  
     317   0.25422    0.36005    0.60092    0.46192    0.36759  
     318   0.98424    0.08020    0.68594    0.45826    0.29962  
     319   0.79365    0.89231    0.49479    0.87646    0.23591  
     320   0.28107    0.75026    0.08136    0.79582    0.76011  
     321   0.82793    0.27948    0.72483    0.82191    0.46172  
     322   0.79190    0.96044    0.51610    0.88996    0.28999  
     323   0.55192    0.03935    0.83034    0.49553    0.98010  
     324   0.19018    0.98348    0.33452    0.87144    0.72106  
     325   0.71272    0.71466    0.88362    0.85571    0.73782  
     326   0.20920    0.34855    0.46767    0.02780    0.74898  
     327   0.03681    0.44867    0.77426    0.91026    0.25195  
     328   0.87320    0.63265    0.25552    0.27422    0.95217  
     329   0.39282    0.66442    0.09159    0.94516    0.07801  
     330   0.02508    0.39901    0.17383    0.12141    0.85502  
     331   0.19903    0.02160    0.44461    0.14689    0.68020  
     332   0.71324    0.60922    0.95400    0.99611    0.90898  
     333   0.41074    0.66207    0.32065    0.62805    0.50677  
     334   0.52690    0.87473    0.73918    0.39827    0.43684  
     335   0.80459    0.32423    0.01958    0.95320    0.98326  
     336   0.83932    0.69061    0.33671    0.68063    0.65152  
     337   0.33393    0.03452    0.95227    0.68201    0.85074  
     338   0.64721    0.51234    0.73402    0.00970    0.93835  
     339   0.80804    0.31485    0.20090    0.01323    0.59934  
     340   0.31585    0.20210    0.33755    0.68604    0.24443  
     341   0.19952    0.78163    0.10337    0.11361    0.23537  
     342   0.23262    0.67804    0.48750    0.74658    0.92157  
     343   0.56706    0.36683    0.99157    0.23421    0.45184  
     344   0.91610    0.85573    0.37706    0.77043    0.30892  
     345   0.40710    0.06945    0.61343    0.88817    0.58735  
     346   0.98711    0.14744    0.63243    0.87704    0.68347  
     347   0.84447    0.43265    0.25146    0.04130    0.34260  
     348   0.92697    0.40879    0.56990    0.76204    0.19820  
     349   0.66315    0.02483    0.06669    0.50206    0.26084  
     350   0.65139    0.41650    0.09734    0.56344    0.62652  
     351   0.67332    0.58037    0.47258    0.21011    0.05713  
     352   0.89391    0.10781    0.32037    0.07628    0.34228  
     353   0.42191    0.58202    0.77364    0.49595    0.86031  
     354   0.83907    0.81098    0.26694    0.14216    0.88210  
     355   0.53634    0.12091    0.82480    0.75930    0.31847  
     356   0.92768    0.01038    0.56202    0.88107    0.35926  
     357   0.85861    0.61109    0.70408    0.58435    0.92192  
     358   0.62668    0.75988    0.06859    0.36156    0.58057  
     359   0.13636    0.57720    0.59340    0.63531    0.22976  
     360   0.71916    0.41163    0.63980    0.09931    0.79344  
     361   0.10894    0.84450    0.23122    0.99486    0.73637  
     362   0.17276    0.13358    0.74966    0.64992    0.61990  
     363   0.41523    0.05878    0.05687    0.05497    0.42868  
     364   0.42571    0.25811    0.89643    0.30440    0.39310  
     365   0.11357    0.04288    0.23398    0.11201    0.85621  
     366   0.89734    0.37509    0.42077    0.68597    0.72781  
     367   0.19296    0.61699    0.31667    0.67756    0.00177  
     368   0.05725    0.79475    0.18885    0.06725    0.68193  
     369   0.42202    0.22082    0.28555    0.64996    0.87852  
     370   0.29125    0.61010    0.87375    0.05744    0.69903  
     371   0.81925    0.45654    0.37237    0.31119    0.52734  
     372   0.39673    0.38185    0.30164    0.17375    0.04913  
     373   0.90405    0.25743    0.58266    0.97663    0.79823  
     374   0.36438    0.15206    0.26530    0.22690    0.05839  
     375   0.84721    0.18622    0.37809    0.55707    0.49829  
     376   0.47659    0.24290    0.88478    0.07807    0.56246  
     377   0.73491    0.21099    0.13165    0.75840    0.66877  
     378   0.28988    0.44046    0.24967    0.80048    0.26030  
     379   0.30417    0.64152    0.52068    0.12881    0.85465  
     380   0.02691    0.19149    0.49630    0.79683    0.43566  
     381   0.00288    0.81484    0.03764    0.68529    0.01340  
     382   0.38405    0.30537    0.22995    0.44000    0.27218  
     383   0.53831    0.02870    0.86282    0.61831    0.09165  
     384   0.25610    0.07446    0.72186    0.90059    0.30071  
     385   0.94477    0.56822    0.21934    0.96773    0.80063  
     386   0.26308    0.31183    0.16501    0.55436    0.68562  
     387   0.23829    0.86512    0.57869    0.81888    0.20127  
     388   0.93172    0.66028    0.21787    0.78516    0.10262  
     389   0.35390    0.79304    0.63428    0.90480    0.31025  
     390   0.60635    0.56198    0.63574    0.91854    0.99701  
     391   0.83086    0.31692    0.01926    0.97446    0.98751  
     392   0.60944    0.13751    0.69520    0.68957    0.56969  
     393   0.46440    0.88342    0.36754    0.89224    0.39786  
     394   0.85055    0.12750    0.79452    0.89450    0.14568  
     395   0.45717    0.74822    0.28200    0.42546    0.17465  
     396   0.68309    0.65497    0.52935    0.12736    0.61524  
     397   0.81591    0.63108    0.39787    0.20102    0.53293  
     398   0.75486    0.59847    0.32862    0.12126    0.58917  
     399   0.07638    0.86845    0.29193    0.03990    0.52180  
     400   0.32503    0.64072    0.69517    0.74255    0.54587  
     401   0.48713    0.32920    0.08720    0.63497    0.54328  
     402   0.64179    0.45584    0.70694    0.85213    0.86074  
     403   0.33163    0.85740    0.59908    0.74566    0.72157  
  • t/library/yaml_dumper.t

    old new  
    88 
    99use Test::More; 
    1010use Parrot::Test tests => 26; 
     11use Parrot::Config; 
    1112 
    1213=head1 NAME 
    1314 
     
    820821} 
    821822OUTPUT 
    822823 
     824my $float = $PConfig{numvalsize} > 4 ? "12345.6789" : "12345.67"; 
    823825 
    824 pir_output_is( <<'CODE', <<'OUTPUT', "dumping Float PMC" ); 
     826pir_output_is( <<"CODE", <<"OUTPUT", "dumping Float PMC" ); 
    825827 
    826828.sub test :main 
    827829    .local pmc float1 
    828830 
    829831    new float1, 'Float' 
    830     float1 = 12345.678 
    831     yaml( float1, "Float" ) 
     832    float1 = $float 
     833    yaml( float1, 'Float' ) 
    832834.end 
    833 .include "library/yaml_dumper.pir" 
     835.include 'library/yaml_dumper.pir' 
    834836CODE 
    835837--- 
    836838{ 
    837     "Float" : !Float [ 12345.678 ], 
     839    \"Float\" : !Float [ $float ], 
    838840} 
    839841OUTPUT 
    840842 
  • t/tools/pbc_merge.t

    old new  
    100100 
    101101.sub _get_years 
    102102    .local num n 
    103     n = 10.398571 
     103    n = 10.39857 
    104104    .return(n) 
    105105.end 
    106106PIR 
    107107    pbc_merge( "pbc_merge_t2", "pbc_merge_t2_1", "pbc_merge_t2_2" ); 
    108     is( run_pbc("pbc_merge_t2"), "Rammstein have rocked for over 10.398571 years!" ); 
     108    is( run_pbc("pbc_merge_t2"), "Rammstein have rocked for over 10.39857 years!" ); 
    109109} 
    110110 
    111111# Third test - sub calls back and forth between blocks.