summaryrefslogtreecommitdiff
path: root/test/-ext-/bignum/test_pack.rb
AgeCommit message (Collapse)Author
2013-07-28* include/ruby/intern.h (rb_absint_size): Declaration moved fromakr
internal.h to calculate required buffer size to pack integers. (rb_absint_numwords): Ditto. (rb_absint_singlebit_p): Ditto. [ruby-core:42813] [Feature #6065] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42208 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-22* bignum.c (bary_unpack_internal): Specialized unpacker implemented.akr
(bary_unpack): Support INTEGER_PACK_FORCE_GENERIC_IMPLEMENTATION. (rb_integer_unpack): Support INTEGER_PACK_FORCE_GENERIC_IMPLEMENTATION. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41566 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-22* bignum.c (bary_pack): Supportakr
INTEGER_PACK_FORCE_GENERIC_IMPLEMENTATION flag. Fix byte order and word order handling in code specialized for wordsize % SIZEOF_BDIGITS == 0. * internal.h (INTEGER_PACK_FORCE_GENERIC_IMPLEMENTATION): Defined. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41565 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-21* bignum.c (bary_pack): Specialized packers implemented.akr
(HOST_BIGENDIAN_P): New macro. (ALIGNOF): New macro. (CLEAR_LOWBITS): New macro. (FILL_LOWBITS): New macro. (swap_bdigit): New macro. (bary_2comp): Returns an int. * internal.h (swap16): Moved from pack.c (swap32): Ditto. (swap64): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-20* bignum.c (bary_unpack_internal): Return -2 when negative overflow.akr
(bary_unpack): Set the overflowed bit if an extra BDIGIT exists. (rb_integer_unpack): Set the overflowed bit. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41494 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-16* bignum.c (bary_2comp): Extracted from get2comp.akr
(integer_unpack_num_bdigits): Extracted from rb_integer_unpack_internal. (bary_unpack_internal): Renamed from bary_unpack and support INTEGER_PACK_2COMP. (bary_unpack): New function to validate arguments and invoke bary_unpack_internal. (rb_integer_unpack_internal): Removed. (rb_integer_unpack): Invoke bary_unpack_internal. (rb_integer_unpack_2comp): Removed. * internal.h (rb_integer_unpack_2comp): Removed. * pack.c: Follow the above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41337 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-16* internal.h (INTEGER_PACK_2COMP): Defined.akr
(rb_integer_pack_2comp): Removed. * bignum.c (bary_pack): Support INTEGER_PACK_2COMP. (rb_integer_pack): Invoke bary_pack directly. (rb_integer_pack_2comp): Removed. (rb_integer_pack_internal): Ditto. (absint_numwords_generic): Follow the above change. * pack.c (pack_pack): Ditto. * sprintf.c (rb_str_format): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41336 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-12* bignum.c (rb_integer_unpack_2comp): New function.akr
(rb_integer_unpack_internal): Extracted from rb_integer_unpack and nlp_bits_ret argument added. (integer_unpack_num_bdigits_small): nlp_bits_ret argument added to return number of leading padding bits. (integer_unpack_num_bdigits_generic): Ditto. * internal.h (rb_integer_unpack_2comp): Declared. * pack.c (pack_unpack): Use rb_integer_unpack_2comp and rb_integer_unpack. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-11* internal.h (INTEGER_PACK_NEGATIVE): Defined.akr
(rb_integer_unpack): sign argument removed. * bignum.c (rb_integer_unpack): sign argument removed. Non-negative integers generated by default. INTEGER_PACK_NEGATIVE flag is used to generate non-positive integers. * pack.c (pack_unpack): Follow the above change. * random.c (int_pair_to_real_inclusive): Ditto. (make_seed_value): Ditto. (mt_state): Ditto. (limited_big_rand): Ditto. * marshal.c (r_object0): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41239 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-11* bignum.c (validate_integer_pack_format): Don't require a word orderakr
flag if numwords is 1 or less. (absint_numwords_generic): Don't specify a word order for rb_integer_pack. * hash.c (rb_hash): Ditto. * time.c (v2w_bignum): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41234 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-11rb_integer_pack tests refined.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41231 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-11* bignum.c (rb_integer_pack_internal): Renamed from rb_integer_packakr
and overflow_2comp argument added. (rb_integer_pack): Just call rb_integer_pack_internal. (rb_integer_pack_2comp): New function. * internal.h (rb_integer_pack_2comp): Declared. * sprintf.c (rb_str_format): Use rb_integer_pack and rb_integer_pack_2comp to format binary/octal/hexadecimal integers. (ruby_digitmap): Declared. (remove_sign_bits): Removed. (BITSPERDIG): Ditto. (EXTENDSIGN): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41230 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-09* bignum.c (rb_integer_pack): numwords_allocated argument removed.akr
* internal.h (rb_integer_pack): Follow the above change. * hash.c (rb_hash): Ditto. * time.c (v2w_bignum): Ditto. * pack.c (pack_pack): Ditto. * random.c (int_pair_to_real_inclusive): Ditto. (rand_init): Ditto. (random_load): Ditto. (limited_big_rand): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-07* bignum.c (rb_integer_pack): Arguments changed. Use flags toakr
specify word order and byte order. (rb_integer_unpack): Ditto. (validate_integer_format): Follow the above change. (integer_format_loop_setup): Ditto. * pack.c: Ditto. * internal.h: Ditto. (INTEGER_PACK_MSWORD_FIRST): Defined. (INTEGER_PACK_LSWORD_FIRST): Ditto. (INTEGER_PACK_MSBYTE_FIRST): Ditto. (INTEGER_PACK_LSBYTE_FIRST): Ditto. (INTEGER_PACK_NATIVE_BYTE_ORDER): Ditto. (INTEGER_PACK_LITTLE_ENDIAN): Ditto. (INTEGER_PACK_BIG_ENDIAN): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-07* bignum.c (rb_integer_pack): Renamed from rb_int_export.akr
(rb_integer_unpack): Renamed from rb_int_import. * internal.h, pack.c: Follow the above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e