pastebin - collaborative debugging tool
rovema.kpaste.net RSS


gcc/clang CPP symbols for SSE math
Posted by Anonymous on Tue 13th Sep 2022 19:08
raw | new post

  1. #!/bin/ksh93
  2.  
  3. #
  4. # print the C preprocessor symbols used by SSE
  5. #
  6.  
  7. builtin cat
  8. compound c
  9.  
  10. c.compiler="gcc"
  11.  
  12. c.s1="$( ${c.compiler} -E -dM -m32 - < /dev/null | sort )"
  13. c.s2="$( ${c.compiler} -E -dM -m32 -mfpmath=sse -msse2 - < /dev/null | sort )"
  14.  
  15. diff -u <(cat <<<"${c.s1}") <(cat <<<"${c.s2}")
  16. # EOF.
  17.  
  18. rmainz@derfwpc5131:~/work/math_sse_test$ ksh test_math_sse.ksh
  19. --- /dev/fd/3   2022-09-13 20:01:30.993682803 +0200
  20. +++ /dev/fd/4   2022-09-13 20:01:30.993682803 +0200
  21. @@ -133,8 +133,8 @@
  22.  #define __FLT_DENORM_MIN__ 1.40129846432481707092372958328991613e-45F
  23.  #define __FLT_DIG__ 6
  24.  #define __FLT_EPSILON__ 1.19209289550781250000000000000000000e-7F
  25. -#define __FLT_EVAL_METHOD__ 2
  26. -#define __FLT_EVAL_METHOD_TS_18661_3__ 2
  27. +#define __FLT_EVAL_METHOD__ 0
  28. +#define __FLT_EVAL_METHOD_TS_18661_3__ 0
  29.  #define __FLT_HAS_DENORM__ 1
  30.  #define __FLT_HAS_INFINITY__ 1
  31.  #define __FLT_HAS_QUIET_NAN__ 1
  32. @@ -247,6 +247,7 @@
  33.  #define __LONG_LONG_WIDTH__ 64
  34.  #define __LONG_MAX__ 0x7fffffffL
  35.  #define __LONG_WIDTH__ 32
  36. +#define __MMX__ 1
  37.  #define __NO_INLINE__ 1
  38.  #define __ORDER_BIG_ENDIAN__ 4321
  39.  #define __ORDER_LITTLE_ENDIAN__ 1234
  40. @@ -289,6 +290,10 @@
  41.  #define __SIZEOF_WINT_T__ 4
  42.  #define __SIZE_TYPE__ unsigned int
  43.  #define __SIZE_WIDTH__ 32
  44. +#define __SSE__ 1
  45. +#define __SSE2__ 1
  46. +#define __SSE2_MATH__ 1
  47. +#define __SSE_MATH__ 1
  48.  #define __STDC__ 1
  49.  #define __STDC_HOSTED__ 1
  50.  #define __STDC_IEC_559__ 1

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at