1. 11 4月, 2012 1 次提交
  2. 10 4月, 2012 3 次提交
    • R
      new floating point parser/converter · 415c4cd7
      Rich Felker 提交于
      this version is intended to be fully conformant to the ISO C, POSIX,
      and IEEE standards for conversion of decimal/hex floating point
      strings to float, double, and long double (ld64 or ld80 only at
      present) values. in particular, all results are intended to be rounded
      correctly according to the current rounding mode. further, this
      implementation aims to set the floating point underflow, overflow, and
      inexact flags to reflect the conversion performed.
      
      a moderate amount of testing has been performed (by nsz and myself)
      prior to integration of the code in musl, but it still may have bugs.
      
      so far, only strto(d|ld|f) use the new code. scanf integration will be
      done as a separate commit, and i will add implementations of the wide
      character functions later.
      415c4cd7
    • R
      fix alloca issue in stdlib.h too · 3be616c1
      Rich Felker 提交于
      I forgot _GNU_SOURCE also has it declared here...
      3be616c1
    • R
      alloca cannot be a function. #define it to the gcc builtin if possible · d71d0805
      Rich Felker 提交于
      gcc makes this mapping by default anyway, but it will be disabled by
      -fno-builtin (and presumably by -std=c99 or similar). for the main
      program the error will be reported by the linker, and the issue can
      easily be fixed, but for dynamic-loaded so files, the error cannot be
      detected until dlopen time, at which point it has become very obscure.
      d71d0805
  3. 04 4月, 2012 2 次提交
    • R
      work around nasty gcc bug in the i386 syscall asm · 5bd0ab8a
      Rich Felker 提交于
      when the "r" (register) constraint is used to let gcc choose a
      register, gcc will sometimes assign the same register that was used
      for one of the other fixed-register operands, if it knows the values
      are the same. one common case is multiple zero arguments to a syscall.
      this horribly breaks the intended usage, which is swapping the GOT
      pointer from ebx into the temp register and back to perform the
      syscall.
      
      presumably there is a way to fix this with advanced usage of register
      constaints on the inline asm, but having bad memories about hellish
      compatibility issues with different gcc versions, for the time being
      i'm just going to hard-code specific registers to be used. this may
      hurt the compiler's ability to optimize, but it will fix serious
      miscompilation issues.
      
      so far the only function i know what compiled incorrectly is
      getrlimit.c, and naturally the bug only applies to shared (PIC)
      builds, but it may be more extensive and may have gone undetected..
      5bd0ab8a
    • R
      450f2c4a
  4. 02 4月, 2012 1 次提交
    • R
      improve name lookup performance in corner cases · 4f346b08
      Rich Felker 提交于
      the buffer in getaddrinfo really only matters when /etc/hosts is huge,
      but in that case, the huge number of syscalls resulting from a tiny
      buffer would seriously impact the performance of every name lookup.
      
      the buffer in __dns.c has also been enlarged a bit so that typical
      resolv.conf files will fit fully in the buffer. there's no need to
      make it so large as to dominate the syscall overhead for large files,
      because resolv.conf should never be large.
      4f346b08
  5. 31 3月, 2012 2 次提交
  6. 29 3月, 2012 4 次提交
  7. 28 3月, 2012 4 次提交
  8. 26 3月, 2012 1 次提交
  9. 25 3月, 2012 4 次提交
  10. 23 3月, 2012 8 次提交
  11. 22 3月, 2012 3 次提交
    • N
      acos.s fix: use the formula acos(x) = atan2(sqrt(1-x),sqrt(1+x)) · a4a0c912
      nsz 提交于
      the old formula atan2(1,sqrt((1+x)/(1-x))) was faster but
      could give nan result at x=1 when the rounding mode is
      FE_DOWNWARD (so 1-1 == -0 and 2/-0 == -inf), the new formula
      gives -0 at x=+-1 with downward rounding.
      a4a0c912
    • R
      2e0c1fed
    • R
      fix DECIMAL_DIG definitions · 47db8903
      Rich Felker 提交于
      DECIMAL_DIG is not the same as LDBL_DIG
      
      type_DIG is the maximimum number of decimal digits that can survive a
      round trip from decimal to type and back to decimal.
      
      DECIMAL_DIG is the minimum number of decimal digits required in order
      for any floating point type to survive the round trip to decimal and
      back, and it is generally larger than LDBL_DIG. since the exact
      formula is non-trivial, and defining it larger than necessary may be
      legal but wasteful, just define the right value in bits/float.h.
      47db8903
  12. 21 3月, 2012 7 次提交
    • R
      initial, very primitive strfmon · 25501c10
      Rich Felker 提交于
      25501c10
    • R
      x86_64 math asm, long double functions only · 30df206c
      Rich Felker 提交于
      this has not been tested heavily, but it's known to at least assemble
      and run in basic usage cases. it's nearly identical to the
      corresponding i386 code, and thus expected to be just as correct or
      just as incorrect.
      30df206c
    • R
      limits.h: support gcc's -funsigned-char · 80949ccd
      Rich Felker 提交于
      some software apparently uses this and breaks with musl due to
      mismatching definitions...
      80949ccd
    • R
      Merge remote branch 'nsz/master' · 58bf7485
      Rich Felker 提交于
      58bf7485
    • R
      upgrade to latest upstream TRE regex code (0.8.0) · ad47d45e
      Rich Felker 提交于
      the main practical results of this change are
      1. the regex code is no longer subject to LGPL; it's now 2-clause BSD
      2. most (all?) popular nonstandard regex extensions are supported
      
      I hesitate to call this a "sync" since both the old and new code are
      heavily modified. in one sense, the old code was "more severely"
      modified, in that it was actively hostile to non-strictly-conforming
      expressions. on the other hand, the new code has eliminated the
      useless translation of the entire regex string to wchar_t prior to
      compiling, and now only converts multibyte character literals as
      needed.
      
      in the future i may use this modified TRE as a basis for writing the
      long-planned new regex engine that will avoid multibyte-to-wide
      character conversion entirely by compiling multibyte bracket
      expressions specific to UTF-8.
      ad47d45e
    • N
      nearbyint optimization (only clear inexact when necessary) · 91c28f61
      nsz 提交于
      old code saved/restored the fenv (the new code is only as slow
      as that when inexact is not set before the call, but some other
      flag is set and the rounding is inexact, which is rare)
      
      before:
      bench_nearbyint_exact              5000000 N        261 ns/op
      bench_nearbyint_inexact_set        5000000 N        262 ns/op
      bench_nearbyint_inexact_unset      5000000 N        261 ns/op
      
      after:
      bench_nearbyint_exact             10000000 N         94.99 ns/op
      bench_nearbyint_inexact_set       25000000 N         65.81 ns/op
      bench_nearbyint_inexact_unset     10000000 N         94.97 ns/op
      91c28f61
    • N
      remove a fixme comment · 8c6fc860
      nsz 提交于
      8c6fc860