Add optimized tagged integer addition/subtractions for x86_64.
authorLudovic Courtès <ludo@gnu.org>
Wed, 17 Nov 2010 22:06:26 +0000 (23:06 +0100)
committerLudovic Courtès <ludo@gnu.org>
Fri, 19 Nov 2010 12:34:43 +0000 (13:34 +0100)
commit0c57673a1176dec03d6ddb88fa5cfc82a2628cc3
treee57d89e00876317f1bac4fb98295318073e9ad37
parentf13f1e9f6ff111fa676e54090eb62f2a0f066d13
Add optimized tagged integer addition/subtractions for x86_64.

This results in a 17% improvement in the execution time of the "+" and
"-" benchmarks for fixnums.

* libguile/vm-i-scheme.c (ASM_ADD, ASM_SUB)[defined __x86_64__ &&
  SCM_GNUC_PREREQ (4, 5)]: New macros.
  (add)[defined ASM_ADD]: Use `ASM_ADD' for the fast path.
  (sub)[defined ASM_SUB]: Use `ASM_SUB' for the fast path.

* test-suite/tests/numbers.test ("+")["fixnum + fixnum = bignum
  (32-bit)", "fixnum + fixnum = bignum (64-bit)", "bignum + fixnum =
  fixnum", "wrong type"]: New tests.
  ("-")["fixnum - fixnum = bignum (32-bit)", "fixnum - fixnum = bignum
  (64-bit)", "bignum - fixnum = fixnum", "wrong type"]: New tests.

* test-suite/tests/00-initial-env.test ("goopsless")["+ wrong type
  argument"]: Use `with-test-prefix/c&e' instead of `with-test-prefix'.
  ["- wrong type argument"]: New test prefix.
libguile/vm-i-scheme.c
test-suite/tests/00-initial-env.test
test-suite/tests/numbers.test