Mercurial > octave
comparison m4/acinclude.m4 @ 21302:8376de2eaf00
define OCTAVE_HAVE_FAST_INT_OPS in octave-config.h
* acinclude.m4 (OCTAVE_FAST_INT_OPS): Define OCTAVE_HAVE_FAST_INT_OPS
instead of HAVE_FAST_INT_OPS.
* oct-inttypes.cc, oct-inttypes.h: Use new macro name.
* mk-octave-config-h.sh: Emit definition of OCTAVE_HAVE_FAST_INT_OPS.
* build-env-features.sh: Also include symbols beginning with
"OCTAVE_HAVE_".
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 18 Feb 2016 16:42:42 -0500 |
parents | 6c4f41a9439d |
children | 06d15e4e611a |
comparison
equal
deleted
inserted
replaced
21301:40de9f8f23a6 | 21302:8376de2eaf00 |
---|---|
1493 AC_MSG_RESULT([no]) | 1493 AC_MSG_RESULT([no]) |
1494 ifelse([$3], , , [$3]) | 1494 ifelse([$3], , , [$3]) |
1495 fi | 1495 fi |
1496 ]) | 1496 ]) |
1497 dnl | 1497 dnl |
1498 dnl Check whether fast signed integer arithmetics using bit tricks | 1498 dnl Check whether fast signed integer arithmetic using bit tricks |
1499 dnl can be used in oct-inttypes.h. Defines HAVE_FAST_INT_OPS if | 1499 dnl can be used in oct-inttypes.h. |
1500 dnl the following conditions hold: | 1500 dnl |
1501 dnl 1. Signed numbers are represented by twos complement | 1501 dnl Defines OCTAVE_HAVE_FAST_INT_OPS if the following conditions hold: |
1502 dnl (see <http://en.wikipedia.org/wiki/Two%27s_complement>) | 1502 dnl |
1503 dnl 2. static_cast to unsigned int counterpart works like interpreting | 1503 dnl 1. Signed numbers are represented by twos complement (see |
1504 dnl the signed bit pattern as unsigned (and is thus zero-cost). | 1504 dnl <http://en.wikipedia.org/wiki/Two%27s_complement>) |
1505 dnl 3. Signed addition and subtraction yield the same bit results as unsigned. | 1505 dnl |
1506 dnl (We use casts to prevent optimization interference, so there is no | 1506 dnl 2. static_cast to unsigned int counterpart works like |
1507 dnl need for things like -ftrapv). | 1507 dnl interpreting the signed bit pattern as unsigned (and is thus |
1508 dnl 4. Bit operations on signed integers work like on unsigned integers, | 1508 dnl zero-cost). |
1509 dnl except for the shifts. Shifts are arithmetic. | 1509 dnl |
1510 dnl 3. Signed addition and subtraction yield the same bit results | |
1511 dnl as unsigned. (We use casts to prevent optimization | |
1512 dnl interference, so there is no need for things like -ftrapv). | |
1513 dnl | |
1514 dnl 4. Bit operations on signed integers work like on unsigned | |
1515 dnl integers, except for the shifts. Shifts are arithmetic. | |
1510 dnl | 1516 dnl |
1511 AC_DEFUN([OCTAVE_FAST_INT_OPS], [ | 1517 AC_DEFUN([OCTAVE_FAST_INT_OPS], [ |
1512 AC_CACHE_CHECK([whether fast integer arithmetics is usable], | 1518 AC_CACHE_CHECK([whether fast integer arithmetics is usable], |
1513 [octave_cv_fast_int_ops], | 1519 [octave_cv_fast_int_ops], |
1514 [AC_LANG_PUSH(C++) | 1520 [AC_LANG_PUSH(C++) |
1561 octave_cv_fast_int_ops=no, | 1567 octave_cv_fast_int_ops=no, |
1562 octave_cv_fast_int_ops=yes) | 1568 octave_cv_fast_int_ops=yes) |
1563 AC_LANG_POP(C++) | 1569 AC_LANG_POP(C++) |
1564 ]) | 1570 ]) |
1565 if test $octave_cv_fast_int_ops = yes; then | 1571 if test $octave_cv_fast_int_ops = yes; then |
1566 AC_DEFINE(HAVE_FAST_INT_OPS, 1, | 1572 AC_DEFINE(OCTAVE_HAVE_FAST_INT_OPS, 1, |
1567 [Define to 1 if signed integers use two's complement.]) | 1573 [Define to 1 if signed integers use two's complement.]) |
1568 fi | 1574 fi |
1569 ]) | 1575 ]) |
1570 dnl | 1576 dnl |
1571 dnl Check to see if the compiler and the linker can handle the flags | 1577 dnl Check to see if the compiler and the linker can handle the flags |