Skip to content

Commit

Permalink
[compiler-rt][mips] Add support for quad precision builtins for mips64
Browse files Browse the repository at this point in the history
Match the builtins that GCC provides for IEEE754 quad precision
on MIPS64. Also, enable building them with clang as PR20098 is resolved.

Disable tests for xf and xc modes as MIPS doesn't support that mode in
hardware or software.

Reviewers: slthakur

Differential Revision: https://reviews.llvm.org/D32794

llvm-svn: 302147
  • Loading branch information
Simon Dardis committed May 4, 2017
1 parent 4fd1562 commit 19a4d97
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 23 deletions.
45 changes: 25 additions & 20 deletions compiler-rt/lib/builtins/CMakeLists.txt
Expand Up @@ -167,6 +167,26 @@ set(GENERIC_SOURCES
umodti3.c
emutls.c)

set(GENERIC_TF_SOURCES
comparetf2.c
extenddftf2.c
extendsftf2.c
fixtfdi.c
fixtfsi.c
fixtfti.c
fixunstfdi.c
fixunstfsi.c
fixunstfti.c
floatditf.c
floatsitf.c
floattitf.c
floatunditf.c
floatunsitf.c
floatuntitf.c
multc3.c
trunctfdf2.c
trunctfsf2.c)

option(COMPILER_RT_EXCLUDE_ATOMIC_BUILTIN
"Skip the atomic builtin (this may be needed if system headers are unavailable)"
Off)
Expand Down Expand Up @@ -404,24 +424,7 @@ elseif(NOT WIN32)
endif()

set(aarch64_SOURCES
comparetf2.c
extenddftf2.c
extendsftf2.c
fixtfdi.c
fixtfsi.c
fixtfti.c
fixunstfdi.c
fixunstfsi.c
fixunstfti.c
floatditf.c
floatsitf.c
floattitf.c
floatunditf.c
floatunsitf.c
floatuntitf.c
multc3.c
trunctfdf2.c
trunctfsf2.c
${GENERIC_TF_SOURCES}
${GENERIC_SOURCES})

set(armhf_SOURCES ${arm_SOURCES})
Expand All @@ -437,8 +440,10 @@ set(armv7em_SOURCES ${arm_SOURCES})

set(mips_SOURCES ${GENERIC_SOURCES})
set(mipsel_SOURCES ${mips_SOURCES})
set(mips64_SOURCES ${mips_SOURCES})
set(mips64el_SOURCES ${mips_SOURCES})
set(mips64_SOURCES ${GENERIC_TF_SOURCES}
${mips_SOURCES})
set(mips64el_SOURCES ${GENERIC_TF_SOURCES}
${mips_SOURCES})

set(wasm32_SOURCES ${GENERIC_SOURCES})
set(wasm64_SOURCES ${GENERIC_SOURCES})
Expand Down
4 changes: 1 addition & 3 deletions compiler-rt/lib/builtins/int_types.h
Expand Up @@ -60,9 +60,7 @@ typedef union
}s;
} udwords;

/* MIPS64 issue: PR 20098 */
#if (defined(__LP64__) || defined(__wasm__)) && \
!(defined(__mips__) && defined(__clang__))
#if (defined(__LP64__) || defined(__wasm__) || defined(__mips64))
#define CRT_HAS_128BIT
#endif

Expand Down
1 change: 1 addition & 0 deletions compiler-rt/test/builtins/Unit/divxc3_test.c
Expand Up @@ -19,6 +19,7 @@
#include <complex.h>
#include <stdio.h>

// UNSUPPORTED: mips
// REQUIRES: c99-complex

// Returns: the quotient of (a + ib) / (c + id)
Expand Down
2 changes: 2 additions & 0 deletions compiler-rt/test/builtins/Unit/fixunstfti_test.c
Expand Up @@ -14,6 +14,8 @@

#include <stdio.h>

// UNSUPPORTED: mips

#if __LDBL_MANT_DIG__ == 113

#include "fp_test.h"
Expand Down
2 changes: 2 additions & 0 deletions compiler-rt/test/builtins/Unit/fixunsxfti_test.c
Expand Up @@ -2,6 +2,8 @@
// XFAIL: aarch64
// test fails for aarch64 (see pr32260)

// UNSUPPORTED: mips

//===-- fixunsxfti_test.c - Test __fixunsxfti -----------------------------===//
//
// The LLVM Compiler Infrastructure
Expand Down
2 changes: 2 additions & 0 deletions compiler-rt/test/builtins/Unit/fixxfti_test.c
Expand Up @@ -2,6 +2,8 @@
// XFAIL: aarch64
// test fails for aarch64 (see pr32260)

// UNSUPPORTED: mips

//===-- fixxfti_test.c - Test __fixxfti -----------------------------------===//
//
// The LLVM Compiler Infrastructure
Expand Down
2 changes: 2 additions & 0 deletions compiler-rt/test/builtins/Unit/floattixf_test.c
Expand Up @@ -2,6 +2,8 @@
// XFAIL: aarch64
// test fails for aarch64 (see pr32260)

// UNSUPPORTED: mips

//===-- floattixf.c - Test __floattixf ------------------------------------===//
//
// The LLVM Compiler Infrastructure
Expand Down
2 changes: 2 additions & 0 deletions compiler-rt/test/builtins/Unit/floatuntixf_test.c
Expand Up @@ -2,6 +2,8 @@
// XFAIL: aarch64
// test fails for aarch64 (see pr32260)

// UNSUPPORTED: mips

//===-- floatuntixf.c - Test __floatuntixf --------------------------------===//
//
// The LLVM Compiler Infrastructure
Expand Down
1 change: 1 addition & 0 deletions compiler-rt/test/builtins/Unit/mulxc3_test.c
Expand Up @@ -19,6 +19,7 @@
#include <complex.h>
#include <stdio.h>

// UNSUPPORTED: mips
// REQUIRES: c99-complex

// Returns: the product of a + ib and c + id
Expand Down

0 comments on commit 19a4d97

Please sign in to comment.