[PATCH] D41813: [builtins] Enable CRT_HAS_128BIT for MSVC

Loo Rong Jie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 18 01:33:19 PST 2018


rongjiecomputer added a comment.

There is a compile warning for `char assumption_3[sizeof(long double)*CHAR_BIT == 128] = {0}` in these codes because `long double` == `double` in Clang + MSVC:

- fixunsxfti_test.c
- fixxfti_test.c
- floattixf_test.c
- floatuntixf_test.c

mulvti3_test.c hit a `compilerrt_abort`:

  ..\lib\builtins\mulvti3.c:50: abort in __mulvti3

Summary of other test failures:

  fixunsdfti_test.c
  error in __fixunsdfti(0X1.FFFFFFFFFFFFFP+63) = 0x0000000000000000FFFFFFFFFFFFF800, expected 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFF800
  
  fixunssfti_test.c
  error in __fixunssfti(0X1.FFFFFE0000000P+63) = 0x0000000000000000FFFFFF0000000000, expected 0xFFFFFFFFFFFFFFFFFFFFFF0000000000
  
  fixunsxfti_test.c
  error in __fixunsxfti(0X1.0000000000000P+0) = 0x00000000000000000000000000000000, expected 0x00000000000000000000000000000001
  
  fixxfti_test.c
  error in __fixxfti(0X1.0000000000000P+0) = 0x00000000000000000000000000000000, expected 0x00000000000000000000000000000001
  
  floattixf_test.c
  error in __floattixf(0x00000000000000000000000000000001) = 0X1.0000000000000P-1022, expected 0X1.0000000000000P+0
  
  floatuntisf_test.c
  error in __floatuntisf(0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE) = inf, expected 0x1.0000000000000p+64
  
  floatuntixf_test.c
  error in __floatuntixf(0x00000000000000000000000000000001) = 0X1.0000000000000P-1022, expected 0X1.0000000000000P+0
  
  modti3_test.c
  error in __modti3: 0xFFFFFFFFFFFFFFFF8000000000000000 % 0x00000000000000000000000000000003 = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE, expected 0x00000000000000000000000000000002
  
  muloti4_test.c
  error in __muloti4: overflow=1 expected=0
  error in __muloti4: 0x000000000000000000000000B504F333 * 0x000000000000000000000000B504F333 = 0x00000000000000007FFFFFFE9EA1DC29, expected 0x00000000000000007FFFFFFE9EA1DC29

Since the tests work on other platforms, I am guessing the tests fail for `clang-cl` due to Clang trying to imitate MSVC's bugs. I am not sure how to make them work, so I might have to abandon this patch.

Thanks for your time to review this.


https://reviews.llvm.org/D41813





More information about the llvm-commits mailing list