Skip to content

Commit

Permalink
compiler-rt builtins: move 80-bit long double functions into their own
Browse files Browse the repository at this point in the history
block, only enabling it for x86, and add more 128-bit quad functions.
  • Loading branch information
DimitryAndric committed Feb 9, 2024
1 parent b3086e6 commit b8840b4
Showing 1 changed file with 39 additions and 21 deletions.
60 changes: 39 additions & 21 deletions lib/libcompiler_rt/Makefile.inc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

CRTARCH= ${MACHINE_CPUARCH:C/amd64/x86_64/}
CRTARCH= ${MACHINE_CPUARCH:C/amd64/x86_64/:C/powerpc/ppc/}
.info DIMDBG: CRTARCH=${CRTARCH}

CRTSRC= ${SRCTOP}/contrib/llvm-project/compiler-rt/lib/builtins

Expand Down Expand Up @@ -35,12 +36,9 @@ SRCF+= divmodsi4
SRCF+= divmodti4
SRCF+= divsc3
SRCF+= divsi3
SRCF+= divtc3
SRCF+= divti3
SRCF+= divxc3
SRCF+= enable_execute_stack
SRCF+= extendhfsf2
SRCF+= extendxftf2
SRCF+= ffsdi2
SRCF+= ffssi2
SRCF+= ffsti2
Expand All @@ -54,21 +52,12 @@ SRCF+= fixunsdfti
SRCF+= fixunssfdi
SRCF+= fixunssfsi
SRCF+= fixunssfti
SRCF+= fixunsxfdi
SRCF+= fixunsxfsi
SRCF+= fixunsxfti
SRCF+= fixxfdi
SRCF+= fixxfti
SRCF+= floatditf
SRCF+= floattidf
SRCF+= floattisf
SRCF+= floattixf
SRCF+= floatunditf
SRCF+= floatunsidf
SRCF+= floatunsisf
SRCF+= floatuntidf
SRCF+= floatuntisf
SRCF+= floatuntixf
SRCF+= int_util
SRCF+= lshrdi3
SRCF+= lshrti3
Expand All @@ -81,12 +70,10 @@ SRCF+= mulodi4
SRCF+= mulosi4
SRCF+= muloti4
SRCF+= mulsc3
SRCF+= multc3
SRCF+= multi3
SRCF+= mulvdi3
SRCF+= mulvsi3
SRCF+= mulvti3
SRCF+= mulxc3
SRCF+= negdf2
SRCF+= negdi2
SRCF+= negsf2
Expand All @@ -102,15 +89,12 @@ SRCF+= popcountsi2
SRCF+= popcountti2
SRCF+= powidf2
SRCF+= powisf2
SRCF+= powitf2
SRCF+= powixf2
SRCF+= subvdi3
SRCF+= subvsi3
SRCF+= subvti3
SRCF+= trampoline_setup
SRCF+= truncdfhf2
SRCF+= truncsfhf2
SRCF+= trunctfxf2
SRCF+= ucmpdi2
SRCF+= ucmpti2
SRCF+= udivdi3
Expand All @@ -134,18 +118,44 @@ SRCF+= atomic
.if ${MACHINE_CPUARCH} == "i386" && empty(MACHINE_CPU:Msse2)
SRCS+= floatdidf.c
SRCS+= floatdisf.c
SRCS+= floatdixf.c
SRCS+= floatundidf.c
SRCS+= floatundisf.c
SRCS+= floatundixf.c
.else
SRCF+= floatdidf
SRCF+= floatdisf
SRCF+= floatdixf
SRCF+= floatundidf
SRCF+= floatundisf
.endif

#
# 80-bit long double functions, only used on x86.
#
.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
.info DIMDBG: Enabling 80-bit long double
SRCF+= divxc3
SRCF+= extendxftf2
SRCF+= fixxfdi
SRCF+= fixxfti
SRCF+= fixunsxfdi
SRCF+= fixunsxfsi
SRCF+= fixunsxfti
SRCF+= floattixf
SRCF+= floatuntixf
SRCF+= mulxc3
SRCF+= powixf2
SRCF+= trunctfxf2

# Avoid using SSE2 instructions on i386, if unsupported.
.if ${MACHINE_CPUARCH} == "i386" && empty(MACHINE_CPU:Msse2)
SRCS+= floatdixf.c
SRCS+= floatundixf.c
.else
SRCF+= floatdixf
SRCF+= floatundixf
.endif
.else
.info DIMDBG: NOT enabling 80-bit long double
.endif

# __cpu_model support, only used on aarch64 and x86
.if ${MACHINE_CPUARCH} == "aarch64"
Expand All @@ -168,8 +178,10 @@ SRCF+= fp_mode
#
.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
${MACHINE_CPUARCH} == "riscv"
.info DIMDBG: Enabling 128-bit quad precision
SRCF+= addtf3
SRCF+= comparetf2
SRCF+= divtc3
SRCF+= divtf3
SRCF+= extenddftf2
SRCF+= extendhftf2
Expand All @@ -180,15 +192,21 @@ SRCF+= fixtfti
SRCF+= fixunstfdi
SRCF+= fixunstfsi
SRCF+= fixunstfti
SRCF+= floatditf
SRCF+= floatsitf
SRCF+= floattitf
SRCF+= floatunditf
SRCF+= floatunsitf
SRCF+= floatuntitf
SRCF+= multc3
SRCF+= multf3
SRCF+= powitf2
SRCF+= subtf3
SRCF+= trunctfdf2
SRCF+= trunctfhf2
SRCF+= trunctfsf2
.else
.info DIMDBG: NOT enabling 128-bit quad precision
.endif

# These are already shipped by libc.a on some architectures.
Expand Down

0 comments on commit b8840b4

Please sign in to comment.