diff --git a/.github/workflows/build_python.yml b/.github/workflows/build_python.yml index 295393bc..7af731e3 100644 --- a/.github/workflows/build_python.yml +++ b/.github/workflows/build_python.yml @@ -9,7 +9,7 @@ on: platforms: required: true type: string - default: "linux-x86_64,linux-aarch64,linux-i386,linux-arm,linux-riscv64,linux-loongarch64,linux-s390x,linux-mips64el,macos,windows,cosmo,freebsd13-x86_64,freebsd14-x86_64,freebsd15-x86_64,solaris11-x86_64" + default: "linux-x86_64,linux-aarch64,linux-i386,linux-arm,linux-riscv64,linux-loongarch64,linux-s390x,linux-powerpc64le,linux-mips64el,macos,windows,cosmo,freebsd13-x86_64,freebsd14-x86_64,freebsd15-x86_64,solaris11-x86_64" buildsystem_branch: required: false type: string @@ -52,8 +52,8 @@ env: DEBUG_CI: ${{ inputs.debug }} VERBOSE_CI: ${{ inputs.verbose }} PORTABLE_PYTHON_BUILDSYSTEM_BRANCH: ${{ inputs.buildsystem_branch || 'portable-python' }} - image_map: '{"x86_64": "amd64/ubuntu:18.04", "i386": "i386/ubuntu:18.04", "aarch64": "arm64v8/ubuntu:18.04", "arm": "arm32v7/debian:bullseye", "riscv64": "riscv64/debian:sid", "loongarch64": "loongarch64/debian:sid", "s390x": "s390x/debian:bullseye", "mips64el": "mips64le/debian:bullseye"}' - platform_map: '{"x86_64": "linux/amd64", "i386": "linux/386", "aarch64": "linux/arm64/v8", "arm": "linux/arm/v7", "riscv64": "linux/riscv64", "loongarch64": "linux/loong64", "s390x": "linux/s390x", "mips64el": "linux/mips64le"}' + image_map: '{"x86_64": "amd64/ubuntu:18.04", "i386": "i386/ubuntu:18.04", "aarch64": "arm64v8/ubuntu:18.04", "arm": "arm32v7/debian:bullseye", "riscv64": "riscv64/debian:sid", "loongarch64": "loongarch64/debian:sid", "s390x": "s390x/debian:bullseye", "powerpc64le": "ppc64le/ubuntu:18.04", "mips64el": "mips64le/debian:bullseye"}}' + platform_map: '{"x86_64": "linux/amd64", "i386": "linux/386", "aarch64": "linux/arm64/v8", "arm": "linux/arm/v7", "riscv64": "linux/riscv64", "loongarch64": "linux/loong64", "s390x": "linux/s390x", "powerpc64le": "linux/ppc64le", "mips64el": "linux/mips64le"}' freebsd_release_map: '{"15": "15.0", "14": "14.0", "13": "13.2"}' solaris_release_map: '{"11": "11.4"}' @@ -65,7 +65,7 @@ jobs: strategy: fail-fast: false matrix: - arch: [x86_64, i386, aarch64, arm, riscv64, s390x, loongarch64, mips64el] + arch: [x86_64, i386, aarch64, arm, riscv64, s390x, loongarch64, powerpc64le, mips64el] distribution: [full, headless] exclude: - arch: ${{ !contains(inputs.platforms, 'linux-x86_64') && 'x86_64' || '' }} @@ -76,6 +76,7 @@ jobs: - arch: ${{ !contains(inputs.platforms, 'linux-loongarch64') && 'loongarch64' || '' }} - arch: ${{ !contains(inputs.platforms, 'linux-s390x') && 's390x' || '' }} - arch: ${{ !contains(inputs.platforms, 'linux-mips64el') && 'mips64el' || '' }} + - arch: ${{ !contains(inputs.platforms, 'linux-powerpc64le') && 'powerpc64le' || '' }} steps: - name: Parse image diff --git a/.github/workflows/build_python_on_branch.yml b/.github/workflows/build_python_on_branch.yml index 97c53af9..18cadd26 100644 --- a/.github/workflows/build_python_on_branch.yml +++ b/.github/workflows/build_python_on_branch.yml @@ -35,7 +35,7 @@ jobs: run_tests: ${{ inputs.run_tests || false }} debug: ${{ inputs.debug || false }} verbose: ${{ inputs.verbose || false }} - platforms: "linux-x86_64,linux-aarch64,linux-i386,linux-arm,linux-riscv64,linux-loongarch64,linux-s390x,linux-mips64el,macos,windows,cosmo,freebsd13-x86_64,freebsd14-x86_64,freebsd15-x86_64,solaris11-x86_64" + platforms: "linux-x86_64,linux-aarch64,linux-i386,linux-arm,linux-riscv64,linux-loongarch64,linux-s390x,linux-powerpc64le,linux-mips64el,macos,windows,cosmo,freebsd13-x86_64,freebsd14-x86_64,freebsd15-x86_64,solaris11-x86_64" buildsystem_branch: ${{ inputs.buildsystem_branch || 'portable-python' }} graalpy: diff --git a/.github/workflows/release_python.yml b/.github/workflows/release_python.yml index 6491084d..64b940dc 100644 --- a/.github/workflows/release_python.yml +++ b/.github/workflows/release_python.yml @@ -26,7 +26,7 @@ jobs: uses: ./.github/workflows/build_python.yml with: python_version: ${{ inputs.python_version }} - platforms: "linux-x86_64,linux-aarch64,linux-i386,linux-arm,linux-riscv64,linux-s390x,linux-loongarch64,linux-mips64el,macos,windows,cosmo,freebsd13-x86_64,freebsd14-x86_64,freebsd15-x86_64,solaris11-x86_64" + platforms: "linux-x86_64,linux-aarch64,linux-i386,linux-arm,linux-riscv64,linux-loongarch64,linux-s390x,linux-powerpc64le,linux-mips64el,macos,windows,cosmo,freebsd13-x86_64,freebsd14-x86_64,freebsd15-x86_64,solaris11-x86_64" publish: name: Publish CPython ${{ inputs.python_version }} diff --git a/scripts/build_linux_zig.sh b/scripts/build_linux_zig.sh index 09d6443c..143f0a5e 100755 --- a/scripts/build_linux_zig.sh +++ b/scripts/build_linux_zig.sh @@ -47,6 +47,10 @@ case "$ARCH" in sudo apt -y install libc6-s390x-cross sudo ln -s /usr/s390x-linux-gnu/lib/ld64.so.1 /lib/ld64.so.1 ;; + powerpc64le) + sudo apt -y install libc6-ppc64el-cross + sudo ln -s /usr/powerpc64le-linux-gnu/lib/ld64.so.2 /lib64/ld64.so.2 + ;; mips64el) sudo apt -y install libc6-mips64el-cross sudo ln -s /usr/mips64el-linux-gnuabi64/lib64/ld.so.1 /lib64/ld.so.1 @@ -111,8 +115,8 @@ else export CFLAGS="-Wl,--undefined-version ${CFLAGS}" elif [[ "${ARCH}" == "loongarch64" ]]; then export ZIG_FLAGS="-target loongarch64-linux-gnu.2.36" - elif [[ "${ARCH}" == "s390x" ]]; then - export ZIG_FLAGS="-target s390x-linux-gnu.2.19" + elif [[ "${ARCH}" == "s390x" || "${ARCH}" == "powerpc64le" ]]; then + export ZIG_FLAGS="-target ${ARCH}-linux-gnu.2.19" else export ZIG_FLAGS="-target ${ARCH}-linux-gnu.2.17" fi @@ -125,6 +129,21 @@ fi cd ${WORKDIR} +if [[ "${ARCH}" == "powerpc64le" ]]; then + # Compile the following manually and bundle them as libzigshim.a + # This is needed because the Zig compiler does not yet support powerpc64le's double double + # floating point format. https://github.com/ziglang/zig/issues/22081 + cd ${BUILDDIR} + ${CC} -c -o gcc_qadd.o ${WORKDIR}/zigshim/gcc_qadd.c + ${CC} -c -o gcc_qmul.o ${WORKDIR}/zigshim/gcc_qmul.c + ${CC} -c -o gcc_qsub.o ${WORKDIR}/zigshim/gcc_qsub.c + ${CC} -c -o gcc_qdiv.o ${WORKDIR}/zigshim/gcc_qdiv.c + ${AR} rcs libzigshim.a gcc_qadd.o gcc_qmul.o gcc_qsub.o gcc_qdiv.o + mkdir -p ${DEPSDIR}/lib + mv libzigshim.a ${DEPSDIR}/lib + export LDFLAGS="${LDFLAGS} -lzigshim" +fi + echo "::endgroup::" ######## # zlib # @@ -162,6 +181,8 @@ elif [[ "${ARCH}" == "loongarch64" ]]; then ./Configure linux64-loongarch64 no-shared --prefix=${DEPSDIR} --openssldir=${DEPSDIR} elif [[ "${ARCH}" == "s390x" ]]; then ./Configure linux64-s390x no-shared --prefix=${DEPSDIR} --openssldir=${DEPSDIR} +elif [[ "${ARCH}" == "powerpc64le" ]]; then + ./Configure linux-ppc64le no-shared --prefix=${DEPSDIR} --openssldir=${DEPSDIR} else ./Configure linux-${ARCH} no-shared --prefix=${DEPSDIR} --openssldir=${DEPSDIR} fi diff --git a/scripts/qemu_powerpc64le_interpreter b/scripts/qemu_powerpc64le_interpreter new file mode 100755 index 00000000..97e46084 --- /dev/null +++ b/scripts/qemu_powerpc64le_interpreter @@ -0,0 +1,4 @@ +#!/bin/bash +# this interpreter shim is used by cmake to run platform +# detection programs +LD_LIBRARY_PATH=/usr/powerpc64le-linux-gnu/lib qemu-ppc64le-static "$@" \ No newline at end of file diff --git a/zigshim/gcc_qadd.c b/zigshim/gcc_qadd.c new file mode 100755 index 00000000..dffc5064 --- /dev/null +++ b/zigshim/gcc_qadd.c @@ -0,0 +1,551 @@ +# 1 "gcc_qadd.c" +# 1 "" 1 +# 1 "" 3 +# 563 "" 3 +# 1 "" 1 +# 1 "" 2 +# 1 "gcc_qadd.c" 2 + + + + + + + + +# 1 "./DD.h" 1 + + + +# 1 "./../int_lib.h" 1 +# 92 "./../int_lib.h" +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/include/float.h" 1 3 +# 93 "./../int_lib.h" 2 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/include/limits.h" 1 3 +# 25 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/include/limits.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/limits.h" 1 3 +# 26 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/limits.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/libc-header-start.h" 1 3 +# 33 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/libc-header-start.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/features.h" 1 3 +# 415 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/features.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/features-time64.h" 1 3 +# 20 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/features-time64.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/wordsize.h" 1 3 +# 21 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/features-time64.h" 2 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/timesize.h" 1 3 +# 19 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/timesize.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/wordsize.h" 1 3 +# 20 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/timesize.h" 2 3 +# 22 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/features-time64.h" 2 3 +# 416 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/features.h" 2 3 +# 513 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/features.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/stdc-predef.h" 1 3 +# 514 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/features.h" 2 3 +# 527 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/features.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/sys/cdefs.h" 1 3 +# 730 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/sys/cdefs.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/wordsize.h" 1 3 +# 731 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/sys/cdefs.h" 2 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/long-double.h" 1 3 +# 732 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/sys/cdefs.h" 2 3 +# 528 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/features.h" 2 3 +# 551 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/features.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/gnu/stubs.h" 1 3 + + + + +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/wordsize.h" 1 3 +# 6 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/gnu/stubs.h" 2 3 + + + + + + + + +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/gnu/stubs-64-v2.h" 1 3 +# 15 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/gnu/stubs.h" 2 3 +# 552 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/features.h" 2 3 +# 34 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/libc-header-start.h" 2 3 +# 27 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/limits.h" 2 3 +# 195 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/limits.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/posix1_lim.h" 1 3 +# 27 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/posix1_lim.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/wordsize.h" 1 3 +# 28 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/posix1_lim.h" 2 3 +# 161 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/posix1_lim.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/local_lim.h" 1 3 +# 38 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/local_lim.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/any-linux-any/linux/limits.h" 1 3 +# 39 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/local_lim.h" 2 3 +# 81 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/local_lim.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/pthread_stack_min-dynamic.h" 1 3 +# 29 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/pthread_stack_min-dynamic.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/pthread_stack_min.h" 1 3 +# 30 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/pthread_stack_min-dynamic.h" 2 3 +# 82 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/local_lim.h" 2 3 +# 162 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/posix1_lim.h" 2 3 +# 196 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/limits.h" 2 3 + + + +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/posix2_lim.h" 1 3 +# 200 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/limits.h" 2 3 +# 26 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/include/limits.h" 2 3 +# 94 "./../int_lib.h" 2 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/include/stdbool.h" 1 3 +# 95 "./../int_lib.h" 2 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/include/stdint.h" 1 3 +# 56 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/include/stdint.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/stdint.h" 1 3 +# 26 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/stdint.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/libc-header-start.h" 1 3 +# 27 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/stdint.h" 2 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/types.h" 1 3 +# 27 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/types.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/wordsize.h" 1 3 +# 28 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/types.h" 2 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/timesize.h" 1 3 +# 19 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/timesize.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/wordsize.h" 1 3 +# 20 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/timesize.h" 2 3 +# 29 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/types.h" 2 3 + + +typedef unsigned char __u_char; +typedef unsigned short int __u_short; +typedef unsigned int __u_int; +typedef unsigned long int __u_long; + + +typedef signed char __int8_t; +typedef unsigned char __uint8_t; +typedef signed short int __int16_t; +typedef unsigned short int __uint16_t; +typedef signed int __int32_t; +typedef unsigned int __uint32_t; + +typedef signed long int __int64_t; +typedef unsigned long int __uint64_t; + + + + + + +typedef __int8_t __int_least8_t; +typedef __uint8_t __uint_least8_t; +typedef __int16_t __int_least16_t; +typedef __uint16_t __uint_least16_t; +typedef __int32_t __int_least32_t; +typedef __uint32_t __uint_least32_t; +typedef __int64_t __int_least64_t; +typedef __uint64_t __uint_least64_t; + + + +typedef long int __quad_t; +typedef unsigned long int __u_quad_t; + + + + + + + +typedef long int __intmax_t; +typedef unsigned long int __uintmax_t; +# 141 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/types.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/typesizes.h" 1 3 +# 142 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/types.h" 2 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/time64.h" 1 3 +# 143 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/types.h" 2 3 + + +typedef unsigned long int __dev_t; +typedef unsigned int __uid_t; +typedef unsigned int __gid_t; +typedef unsigned long int __ino_t; +typedef unsigned long int __ino64_t; +typedef unsigned int __mode_t; +typedef unsigned long int __nlink_t; +typedef long int __off_t; +typedef long int __off64_t; +typedef int __pid_t; +typedef struct { int __val[2]; } __fsid_t; +typedef long int __clock_t; +typedef unsigned long int __rlim_t; +typedef unsigned long int __rlim64_t; +typedef unsigned int __id_t; +typedef long int __time_t; +typedef unsigned int __useconds_t; +typedef long int __suseconds_t; +typedef long int __suseconds64_t; + +typedef int __daddr_t; +typedef int __key_t; + + +typedef int __clockid_t; + + +typedef void * __timer_t; + + +typedef long int __blksize_t; + + + + +typedef long int __blkcnt_t; +typedef long int __blkcnt64_t; + + +typedef unsigned long int __fsblkcnt_t; +typedef unsigned long int __fsblkcnt64_t; + + +typedef unsigned long int __fsfilcnt_t; +typedef unsigned long int __fsfilcnt64_t; + + +typedef long int __fsword_t; + +typedef long int __ssize_t; + + +typedef long int __syscall_slong_t; + +typedef unsigned long int __syscall_ulong_t; + + + +typedef __off64_t __loff_t; +typedef char *__caddr_t; + + +typedef long int __intptr_t; + + +typedef unsigned int __socklen_t; + + + + +typedef int __sig_atomic_t; +# 28 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/stdint.h" 2 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/wchar.h" 1 3 +# 29 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/stdint.h" 2 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/wordsize.h" 1 3 +# 30 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/stdint.h" 2 3 + + + + +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/stdint-intn.h" 1 3 +# 24 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/stdint-intn.h" 3 +typedef __int8_t int8_t; +typedef __int16_t int16_t; +typedef __int32_t int32_t; +typedef __int64_t int64_t; +# 35 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/stdint.h" 2 3 + + +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/stdint-uintn.h" 1 3 +# 24 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/stdint-uintn.h" 3 +typedef __uint8_t uint8_t; +typedef __uint16_t uint16_t; +typedef __uint32_t uint32_t; +typedef __uint64_t uint64_t; +# 38 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/stdint.h" 2 3 + + + +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/stdint-least.h" 1 3 +# 25 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/stdint-least.h" 3 +typedef __int_least8_t int_least8_t; +typedef __int_least16_t int_least16_t; +typedef __int_least32_t int_least32_t; +typedef __int_least64_t int_least64_t; + + +typedef __uint_least8_t uint_least8_t; +typedef __uint_least16_t uint_least16_t; +typedef __uint_least32_t uint_least32_t; +typedef __uint_least64_t uint_least64_t; +# 42 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/stdint.h" 2 3 + + + + + +typedef signed char int_fast8_t; + +typedef long int int_fast16_t; +typedef long int int_fast32_t; +typedef long int int_fast64_t; +# 60 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/stdint.h" 3 +typedef unsigned char uint_fast8_t; + +typedef unsigned long int uint_fast16_t; +typedef unsigned long int uint_fast32_t; +typedef unsigned long int uint_fast64_t; +# 76 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/stdint.h" 3 +typedef long int intptr_t; + + +typedef unsigned long int uintptr_t; +# 90 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/stdint.h" 3 +typedef __intmax_t intmax_t; +typedef __uintmax_t uintmax_t; +# 57 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/include/stdint.h" 2 3 +# 96 "./../int_lib.h" 2 + + + +# 1 "./../int_types.h" 1 +# 19 "./../int_types.h" +# 1 "./../int_endianness.h" 1 +# 20 "./../int_types.h" 2 + + + + + +typedef int32_t si_int; +typedef uint32_t su_int; +# 37 "./../int_types.h" +typedef int64_t di_int; +typedef uint64_t du_int; + +typedef union { + di_int all; + struct { + + su_int low; + si_int high; + + + + + } s; +} dwords; + +typedef union { + du_int all; + struct { + + su_int low; + su_int high; + + + + + } s; +} udwords; +# 79 "./../int_types.h" +typedef int ti_int __attribute__((mode(TI))); +typedef unsigned tu_int __attribute__((mode(TI))); + +typedef union { + ti_int all; + struct { + + du_int low; + di_int high; + + + + + } s; +} twords; + +typedef union { + tu_int all; + struct { + + du_int low; + du_int high; + + + + + } s; +} utwords; + +static __inline ti_int make_ti(di_int h, di_int l) { + twords r; + r.s.high = (du_int)h; + r.s.low = (du_int)l; + return r.all; +} + +static __inline tu_int make_tu(du_int h, du_int l) { + utwords r; + r.s.high = h; + r.s.low = l; + return r.all; +} +# 133 "./../int_types.h" +typedef union { + su_int u; + float f; +} float_bits; + +typedef union { + udwords u; + double f; +} double_bits; + +typedef struct { + + udwords low; + udwords high; + + + + +} uqwords; +# 184 "./../int_types.h" +typedef long double tf_float; +# 214 "./../int_types.h" +typedef union { + uqwords u; + tf_float f; +} tf_bits; +# 227 "./../int_types.h" +typedef float _Complex Fcomplex; +typedef double _Complex Dcomplex; +typedef long double _Complex Lcomplex; + +typedef Lcomplex Qcomplex; +# 100 "./../int_lib.h" 2 + + +# 1 "./../int_util.h" 1 +# 23 "./../int_util.h" +__attribute__((noreturn)) void __compilerrt_abort_impl(const char *file, int line, + const char *function); +# 103 "./../int_lib.h" 2 + + int __paritysi2(si_int a); + int __paritydi2(di_int a); + + di_int __divdi3(di_int a, di_int b); + si_int __divsi3(si_int a, si_int b); + su_int __udivsi3(su_int n, su_int d); + + su_int __udivmodsi4(su_int a, su_int b, su_int *rem); + du_int __udivmoddi4(du_int a, du_int b, du_int *rem); + + int __clzti2(ti_int a); + tu_int __udivmodti4(tu_int a, tu_int b, tu_int *rem); +# 5 "./DD.h" 2 + +typedef union { + long double ld; + struct { + double hi; + double lo; + } s; +} DD; + +typedef union { + double d; + uint64_t x; +} doublebits; + + + + +static __inline __attribute__((always_inline)) double local_fabs(double x) { + doublebits result = {.d = x}; + result.x &= 0x7fffffffffffffffUL; + return result.d; +} + +static __inline __attribute__((always_inline)) double high26bits(double x) { + doublebits result = {.d = x}; + result.x &= 0xfffffffff8000000UL; + return result.d; +} + +static __inline __attribute__((always_inline)) int different_sign(double x, double y) { + doublebits xsignbit = {.d = x}, ysignbit = {.d = y}; + int result = (int)(xsignbit.x >> 63) ^ (int)(ysignbit.x >> 63); + return result; +} + +long double __gcc_qadd(long double, long double); +long double __gcc_qsub(long double, long double); +long double __gcc_qmul(long double, long double); +long double __gcc_qdiv(long double, long double); +# 10 "gcc_qadd.c" 2 + +long double __gcc_qadd(long double x, long double y) { + static const uint32_t infinityHi = 0x7ff00000U; + + DD dst = {.ld = x}, src = {.ld = y}; + + register double A = dst.s.hi, a = dst.s.lo, B = src.s.hi, b = src.s.lo; + + + if ((A == 0.0) && (B == 0.0)) { + dst.s.hi = A + B; + dst.s.lo = 0.0; + return dst.ld; + } + + + const doublebits abits = {.d = A}; + const doublebits bbits = {.d = B}; + if ((((uint32_t)(abits.x >> 32) & infinityHi) == infinityHi) || + (((uint32_t)(bbits.x >> 32) & infinityHi) == infinityHi)) { + dst.s.hi = A + B; + dst.s.lo = 0.0; + return dst.ld; + } + + + + + const double testForOverflow = A + (B + (a + b)); + const doublebits testbits = {.d = testForOverflow}; + if (((uint32_t)(testbits.x >> 32) & infinityHi) == infinityHi) { + dst.s.hi = testForOverflow; + dst.s.lo = 0.0; + return dst.ld; + } + + double H, h; + double T, t; + double W, w; + double Y; + + H = B + (A - (A + B)); + T = b + (a - (a + b)); + h = A + (B - (A + B)); + t = a + (b - (a + b)); + + if (local_fabs(A) <= local_fabs(B)) + w = (a + b) + h; + else + w = (a + b) + H; + + W = (A + B) + w; + Y = (A + B) - W; + Y += w; + + if (local_fabs(a) <= local_fabs(b)) + w = t + Y; + else + w = T + Y; + + dst.s.hi = Y = W + w; + dst.s.lo = (W - Y) + w; + + return dst.ld; +} diff --git a/zigshim/gcc_qdiv.c b/zigshim/gcc_qdiv.c new file mode 100755 index 00000000..cfc8bcbc --- /dev/null +++ b/zigshim/gcc_qdiv.c @@ -0,0 +1,529 @@ +# 1 "gcc_qdiv.c" +# 1 "" 1 +# 1 "" 3 +# 563 "" 3 +# 1 "" 1 +# 1 "" 2 +# 1 "gcc_qdiv.c" 2 + + + + + + + + +# 1 "./DD.h" 1 + + + +# 1 "./../int_lib.h" 1 +# 92 "./../int_lib.h" +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/include/float.h" 1 3 +# 93 "./../int_lib.h" 2 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/include/limits.h" 1 3 +# 25 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/include/limits.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/limits.h" 1 3 +# 26 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/limits.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/libc-header-start.h" 1 3 +# 33 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/libc-header-start.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/features.h" 1 3 +# 415 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/features.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/features-time64.h" 1 3 +# 20 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/features-time64.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/wordsize.h" 1 3 +# 21 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/features-time64.h" 2 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/timesize.h" 1 3 +# 19 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/timesize.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/wordsize.h" 1 3 +# 20 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/timesize.h" 2 3 +# 22 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/features-time64.h" 2 3 +# 416 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/features.h" 2 3 +# 513 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/features.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/stdc-predef.h" 1 3 +# 514 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/features.h" 2 3 +# 527 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/features.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/sys/cdefs.h" 1 3 +# 730 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/sys/cdefs.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/wordsize.h" 1 3 +# 731 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/sys/cdefs.h" 2 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/long-double.h" 1 3 +# 732 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/sys/cdefs.h" 2 3 +# 528 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/features.h" 2 3 +# 551 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/features.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/gnu/stubs.h" 1 3 + + + + +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/wordsize.h" 1 3 +# 6 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/gnu/stubs.h" 2 3 + + + + + + + + +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/gnu/stubs-64-v2.h" 1 3 +# 15 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/gnu/stubs.h" 2 3 +# 552 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/features.h" 2 3 +# 34 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/libc-header-start.h" 2 3 +# 27 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/limits.h" 2 3 +# 195 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/limits.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/posix1_lim.h" 1 3 +# 27 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/posix1_lim.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/wordsize.h" 1 3 +# 28 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/posix1_lim.h" 2 3 +# 161 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/posix1_lim.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/local_lim.h" 1 3 +# 38 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/local_lim.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/any-linux-any/linux/limits.h" 1 3 +# 39 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/local_lim.h" 2 3 +# 81 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/local_lim.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/pthread_stack_min-dynamic.h" 1 3 +# 29 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/pthread_stack_min-dynamic.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/pthread_stack_min.h" 1 3 +# 30 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/pthread_stack_min-dynamic.h" 2 3 +# 82 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/local_lim.h" 2 3 +# 162 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/posix1_lim.h" 2 3 +# 196 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/limits.h" 2 3 + + + +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/posix2_lim.h" 1 3 +# 200 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/limits.h" 2 3 +# 26 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/include/limits.h" 2 3 +# 94 "./../int_lib.h" 2 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/include/stdbool.h" 1 3 +# 95 "./../int_lib.h" 2 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/include/stdint.h" 1 3 +# 56 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/include/stdint.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/stdint.h" 1 3 +# 26 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/stdint.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/libc-header-start.h" 1 3 +# 27 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/stdint.h" 2 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/types.h" 1 3 +# 27 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/types.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/wordsize.h" 1 3 +# 28 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/types.h" 2 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/timesize.h" 1 3 +# 19 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/timesize.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/wordsize.h" 1 3 +# 20 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/timesize.h" 2 3 +# 29 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/types.h" 2 3 + + +typedef unsigned char __u_char; +typedef unsigned short int __u_short; +typedef unsigned int __u_int; +typedef unsigned long int __u_long; + + +typedef signed char __int8_t; +typedef unsigned char __uint8_t; +typedef signed short int __int16_t; +typedef unsigned short int __uint16_t; +typedef signed int __int32_t; +typedef unsigned int __uint32_t; + +typedef signed long int __int64_t; +typedef unsigned long int __uint64_t; + + + + + + +typedef __int8_t __int_least8_t; +typedef __uint8_t __uint_least8_t; +typedef __int16_t __int_least16_t; +typedef __uint16_t __uint_least16_t; +typedef __int32_t __int_least32_t; +typedef __uint32_t __uint_least32_t; +typedef __int64_t __int_least64_t; +typedef __uint64_t __uint_least64_t; + + + +typedef long int __quad_t; +typedef unsigned long int __u_quad_t; + + + + + + + +typedef long int __intmax_t; +typedef unsigned long int __uintmax_t; +# 141 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/types.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/typesizes.h" 1 3 +# 142 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/types.h" 2 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/time64.h" 1 3 +# 143 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/types.h" 2 3 + + +typedef unsigned long int __dev_t; +typedef unsigned int __uid_t; +typedef unsigned int __gid_t; +typedef unsigned long int __ino_t; +typedef unsigned long int __ino64_t; +typedef unsigned int __mode_t; +typedef unsigned long int __nlink_t; +typedef long int __off_t; +typedef long int __off64_t; +typedef int __pid_t; +typedef struct { int __val[2]; } __fsid_t; +typedef long int __clock_t; +typedef unsigned long int __rlim_t; +typedef unsigned long int __rlim64_t; +typedef unsigned int __id_t; +typedef long int __time_t; +typedef unsigned int __useconds_t; +typedef long int __suseconds_t; +typedef long int __suseconds64_t; + +typedef int __daddr_t; +typedef int __key_t; + + +typedef int __clockid_t; + + +typedef void * __timer_t; + + +typedef long int __blksize_t; + + + + +typedef long int __blkcnt_t; +typedef long int __blkcnt64_t; + + +typedef unsigned long int __fsblkcnt_t; +typedef unsigned long int __fsblkcnt64_t; + + +typedef unsigned long int __fsfilcnt_t; +typedef unsigned long int __fsfilcnt64_t; + + +typedef long int __fsword_t; + +typedef long int __ssize_t; + + +typedef long int __syscall_slong_t; + +typedef unsigned long int __syscall_ulong_t; + + + +typedef __off64_t __loff_t; +typedef char *__caddr_t; + + +typedef long int __intptr_t; + + +typedef unsigned int __socklen_t; + + + + +typedef int __sig_atomic_t; +# 28 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/stdint.h" 2 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/wchar.h" 1 3 +# 29 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/stdint.h" 2 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/wordsize.h" 1 3 +# 30 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/stdint.h" 2 3 + + + + +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/stdint-intn.h" 1 3 +# 24 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/stdint-intn.h" 3 +typedef __int8_t int8_t; +typedef __int16_t int16_t; +typedef __int32_t int32_t; +typedef __int64_t int64_t; +# 35 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/stdint.h" 2 3 + + +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/stdint-uintn.h" 1 3 +# 24 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/stdint-uintn.h" 3 +typedef __uint8_t uint8_t; +typedef __uint16_t uint16_t; +typedef __uint32_t uint32_t; +typedef __uint64_t uint64_t; +# 38 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/stdint.h" 2 3 + + + +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/stdint-least.h" 1 3 +# 25 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/stdint-least.h" 3 +typedef __int_least8_t int_least8_t; +typedef __int_least16_t int_least16_t; +typedef __int_least32_t int_least32_t; +typedef __int_least64_t int_least64_t; + + +typedef __uint_least8_t uint_least8_t; +typedef __uint_least16_t uint_least16_t; +typedef __uint_least32_t uint_least32_t; +typedef __uint_least64_t uint_least64_t; +# 42 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/stdint.h" 2 3 + + + + + +typedef signed char int_fast8_t; + +typedef long int int_fast16_t; +typedef long int int_fast32_t; +typedef long int int_fast64_t; +# 60 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/stdint.h" 3 +typedef unsigned char uint_fast8_t; + +typedef unsigned long int uint_fast16_t; +typedef unsigned long int uint_fast32_t; +typedef unsigned long int uint_fast64_t; +# 76 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/stdint.h" 3 +typedef long int intptr_t; + + +typedef unsigned long int uintptr_t; +# 90 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/stdint.h" 3 +typedef __intmax_t intmax_t; +typedef __uintmax_t uintmax_t; +# 57 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/include/stdint.h" 2 3 +# 96 "./../int_lib.h" 2 + + + +# 1 "./../int_types.h" 1 +# 19 "./../int_types.h" +# 1 "./../int_endianness.h" 1 +# 20 "./../int_types.h" 2 + + + + + +typedef int32_t si_int; +typedef uint32_t su_int; +# 37 "./../int_types.h" +typedef int64_t di_int; +typedef uint64_t du_int; + +typedef union { + di_int all; + struct { + + su_int low; + si_int high; + + + + + } s; +} dwords; + +typedef union { + du_int all; + struct { + + su_int low; + su_int high; + + + + + } s; +} udwords; +# 79 "./../int_types.h" +typedef int ti_int __attribute__((mode(TI))); +typedef unsigned tu_int __attribute__((mode(TI))); + +typedef union { + ti_int all; + struct { + + du_int low; + di_int high; + + + + + } s; +} twords; + +typedef union { + tu_int all; + struct { + + du_int low; + du_int high; + + + + + } s; +} utwords; + +static __inline ti_int make_ti(di_int h, di_int l) { + twords r; + r.s.high = (du_int)h; + r.s.low = (du_int)l; + return r.all; +} + +static __inline tu_int make_tu(du_int h, du_int l) { + utwords r; + r.s.high = h; + r.s.low = l; + return r.all; +} +# 133 "./../int_types.h" +typedef union { + su_int u; + float f; +} float_bits; + +typedef union { + udwords u; + double f; +} double_bits; + +typedef struct { + + udwords low; + udwords high; + + + + +} uqwords; +# 184 "./../int_types.h" +typedef long double tf_float; +# 214 "./../int_types.h" +typedef union { + uqwords u; + tf_float f; +} tf_bits; +# 227 "./../int_types.h" +typedef float _Complex Fcomplex; +typedef double _Complex Dcomplex; +typedef long double _Complex Lcomplex; + +typedef Lcomplex Qcomplex; +# 100 "./../int_lib.h" 2 + + +# 1 "./../int_util.h" 1 +# 23 "./../int_util.h" +__attribute__((noreturn)) void __compilerrt_abort_impl(const char *file, int line, + const char *function); +# 103 "./../int_lib.h" 2 + + int __paritysi2(si_int a); + int __paritydi2(di_int a); + + di_int __divdi3(di_int a, di_int b); + si_int __divsi3(si_int a, si_int b); + su_int __udivsi3(su_int n, su_int d); + + su_int __udivmodsi4(su_int a, su_int b, su_int *rem); + du_int __udivmoddi4(du_int a, du_int b, du_int *rem); + + int __clzti2(ti_int a); + tu_int __udivmodti4(tu_int a, tu_int b, tu_int *rem); +# 5 "./DD.h" 2 + +typedef union { + long double ld; + struct { + double hi; + double lo; + } s; +} DD; + +typedef union { + double d; + uint64_t x; +} doublebits; + + + + +static __inline __attribute__((always_inline)) double local_fabs(double x) { + doublebits result = {.d = x}; + result.x &= 0x7fffffffffffffffUL; + return result.d; +} + +static __inline __attribute__((always_inline)) double high26bits(double x) { + doublebits result = {.d = x}; + result.x &= 0xfffffffff8000000UL; + return result.d; +} + +static __inline __attribute__((always_inline)) int different_sign(double x, double y) { + doublebits xsignbit = {.d = x}, ysignbit = {.d = y}; + int result = (int)(xsignbit.x >> 63) ^ (int)(ysignbit.x >> 63); + return result; +} + +long double __gcc_qadd(long double, long double); +long double __gcc_qsub(long double, long double); +long double __gcc_qmul(long double, long double); +long double __gcc_qdiv(long double, long double); +# 10 "gcc_qdiv.c" 2 + +long double __gcc_qdiv(long double a, long double b) { + static const uint32_t infinityHi = 0x7ff00000U; + DD dst = {.ld = a}, src = {.ld = b}; + + register double x = dst.s.hi, x1 = dst.s.lo, y = src.s.hi, y1 = src.s.lo; + + double yHi, yLo, qHi, qLo; + double yq, tmp, q; + + q = x / y; + + + if (q == 0.0) { + dst.s.hi = q; + dst.s.lo = 0.0; + return dst.ld; + } + + const doublebits qBits = {.d = q}; + if (((uint32_t)(qBits.x >> 32) & infinityHi) == infinityHi) { + dst.s.hi = q; + dst.s.lo = 0.0; + return dst.ld; + } + + yHi = high26bits(y); + qHi = high26bits(q); + + yq = y * q; + yLo = y - yHi; + qLo = q - qHi; + + tmp = (((((yHi) * (qHi) - (yq)) + (yHi) * (qLo)) + (yLo) * (qHi)) + (yLo) * (qLo)); + tmp = (x - yq) - tmp; + tmp = ((tmp + x1) - y1 * q) / y; + x = q + tmp; + + dst.s.lo = (q - x) + tmp; + dst.s.hi = x; + + return dst.ld; +} diff --git a/zigshim/gcc_qmul.c b/zigshim/gcc_qmul.c new file mode 100755 index 00000000..e97d0119 --- /dev/null +++ b/zigshim/gcc_qmul.c @@ -0,0 +1,527 @@ +# 1 "gcc_qmul.c" +# 1 "" 1 +# 1 "" 3 +# 563 "" 3 +# 1 "" 1 +# 1 "" 2 +# 1 "gcc_qmul.c" 2 + + + + + + + + +# 1 "./DD.h" 1 + + + +# 1 "./../int_lib.h" 1 +# 92 "./../int_lib.h" +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/include/float.h" 1 3 +# 93 "./../int_lib.h" 2 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/include/limits.h" 1 3 +# 25 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/include/limits.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/limits.h" 1 3 +# 26 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/limits.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/libc-header-start.h" 1 3 +# 33 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/libc-header-start.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/features.h" 1 3 +# 415 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/features.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/features-time64.h" 1 3 +# 20 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/features-time64.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/wordsize.h" 1 3 +# 21 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/features-time64.h" 2 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/timesize.h" 1 3 +# 19 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/timesize.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/wordsize.h" 1 3 +# 20 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/timesize.h" 2 3 +# 22 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/features-time64.h" 2 3 +# 416 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/features.h" 2 3 +# 513 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/features.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/stdc-predef.h" 1 3 +# 514 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/features.h" 2 3 +# 527 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/features.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/sys/cdefs.h" 1 3 +# 730 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/sys/cdefs.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/wordsize.h" 1 3 +# 731 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/sys/cdefs.h" 2 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/long-double.h" 1 3 +# 732 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/sys/cdefs.h" 2 3 +# 528 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/features.h" 2 3 +# 551 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/features.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/gnu/stubs.h" 1 3 + + + + +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/wordsize.h" 1 3 +# 6 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/gnu/stubs.h" 2 3 + + + + + + + + +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/gnu/stubs-64-v2.h" 1 3 +# 15 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/gnu/stubs.h" 2 3 +# 552 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/features.h" 2 3 +# 34 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/libc-header-start.h" 2 3 +# 27 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/limits.h" 2 3 +# 195 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/limits.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/posix1_lim.h" 1 3 +# 27 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/posix1_lim.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/wordsize.h" 1 3 +# 28 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/posix1_lim.h" 2 3 +# 161 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/posix1_lim.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/local_lim.h" 1 3 +# 38 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/local_lim.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/any-linux-any/linux/limits.h" 1 3 +# 39 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/local_lim.h" 2 3 +# 81 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/local_lim.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/pthread_stack_min-dynamic.h" 1 3 +# 29 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/pthread_stack_min-dynamic.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/pthread_stack_min.h" 1 3 +# 30 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/pthread_stack_min-dynamic.h" 2 3 +# 82 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/local_lim.h" 2 3 +# 162 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/posix1_lim.h" 2 3 +# 196 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/limits.h" 2 3 + + + +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/posix2_lim.h" 1 3 +# 200 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/limits.h" 2 3 +# 26 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/include/limits.h" 2 3 +# 94 "./../int_lib.h" 2 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/include/stdbool.h" 1 3 +# 95 "./../int_lib.h" 2 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/include/stdint.h" 1 3 +# 56 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/include/stdint.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/stdint.h" 1 3 +# 26 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/stdint.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/libc-header-start.h" 1 3 +# 27 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/stdint.h" 2 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/types.h" 1 3 +# 27 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/types.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/wordsize.h" 1 3 +# 28 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/types.h" 2 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/timesize.h" 1 3 +# 19 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/timesize.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/wordsize.h" 1 3 +# 20 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/timesize.h" 2 3 +# 29 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/types.h" 2 3 + + +typedef unsigned char __u_char; +typedef unsigned short int __u_short; +typedef unsigned int __u_int; +typedef unsigned long int __u_long; + + +typedef signed char __int8_t; +typedef unsigned char __uint8_t; +typedef signed short int __int16_t; +typedef unsigned short int __uint16_t; +typedef signed int __int32_t; +typedef unsigned int __uint32_t; + +typedef signed long int __int64_t; +typedef unsigned long int __uint64_t; + + + + + + +typedef __int8_t __int_least8_t; +typedef __uint8_t __uint_least8_t; +typedef __int16_t __int_least16_t; +typedef __uint16_t __uint_least16_t; +typedef __int32_t __int_least32_t; +typedef __uint32_t __uint_least32_t; +typedef __int64_t __int_least64_t; +typedef __uint64_t __uint_least64_t; + + + +typedef long int __quad_t; +typedef unsigned long int __u_quad_t; + + + + + + + +typedef long int __intmax_t; +typedef unsigned long int __uintmax_t; +# 141 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/types.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/typesizes.h" 1 3 +# 142 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/types.h" 2 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/time64.h" 1 3 +# 143 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/types.h" 2 3 + + +typedef unsigned long int __dev_t; +typedef unsigned int __uid_t; +typedef unsigned int __gid_t; +typedef unsigned long int __ino_t; +typedef unsigned long int __ino64_t; +typedef unsigned int __mode_t; +typedef unsigned long int __nlink_t; +typedef long int __off_t; +typedef long int __off64_t; +typedef int __pid_t; +typedef struct { int __val[2]; } __fsid_t; +typedef long int __clock_t; +typedef unsigned long int __rlim_t; +typedef unsigned long int __rlim64_t; +typedef unsigned int __id_t; +typedef long int __time_t; +typedef unsigned int __useconds_t; +typedef long int __suseconds_t; +typedef long int __suseconds64_t; + +typedef int __daddr_t; +typedef int __key_t; + + +typedef int __clockid_t; + + +typedef void * __timer_t; + + +typedef long int __blksize_t; + + + + +typedef long int __blkcnt_t; +typedef long int __blkcnt64_t; + + +typedef unsigned long int __fsblkcnt_t; +typedef unsigned long int __fsblkcnt64_t; + + +typedef unsigned long int __fsfilcnt_t; +typedef unsigned long int __fsfilcnt64_t; + + +typedef long int __fsword_t; + +typedef long int __ssize_t; + + +typedef long int __syscall_slong_t; + +typedef unsigned long int __syscall_ulong_t; + + + +typedef __off64_t __loff_t; +typedef char *__caddr_t; + + +typedef long int __intptr_t; + + +typedef unsigned int __socklen_t; + + + + +typedef int __sig_atomic_t; +# 28 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/stdint.h" 2 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/wchar.h" 1 3 +# 29 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/stdint.h" 2 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/wordsize.h" 1 3 +# 30 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/stdint.h" 2 3 + + + + +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/stdint-intn.h" 1 3 +# 24 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/stdint-intn.h" 3 +typedef __int8_t int8_t; +typedef __int16_t int16_t; +typedef __int32_t int32_t; +typedef __int64_t int64_t; +# 35 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/stdint.h" 2 3 + + +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/stdint-uintn.h" 1 3 +# 24 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/stdint-uintn.h" 3 +typedef __uint8_t uint8_t; +typedef __uint16_t uint16_t; +typedef __uint32_t uint32_t; +typedef __uint64_t uint64_t; +# 38 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/stdint.h" 2 3 + + + +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/stdint-least.h" 1 3 +# 25 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/stdint-least.h" 3 +typedef __int_least8_t int_least8_t; +typedef __int_least16_t int_least16_t; +typedef __int_least32_t int_least32_t; +typedef __int_least64_t int_least64_t; + + +typedef __uint_least8_t uint_least8_t; +typedef __uint_least16_t uint_least16_t; +typedef __uint_least32_t uint_least32_t; +typedef __uint_least64_t uint_least64_t; +# 42 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/stdint.h" 2 3 + + + + + +typedef signed char int_fast8_t; + +typedef long int int_fast16_t; +typedef long int int_fast32_t; +typedef long int int_fast64_t; +# 60 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/stdint.h" 3 +typedef unsigned char uint_fast8_t; + +typedef unsigned long int uint_fast16_t; +typedef unsigned long int uint_fast32_t; +typedef unsigned long int uint_fast64_t; +# 76 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/stdint.h" 3 +typedef long int intptr_t; + + +typedef unsigned long int uintptr_t; +# 90 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/stdint.h" 3 +typedef __intmax_t intmax_t; +typedef __uintmax_t uintmax_t; +# 57 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/include/stdint.h" 2 3 +# 96 "./../int_lib.h" 2 + + + +# 1 "./../int_types.h" 1 +# 19 "./../int_types.h" +# 1 "./../int_endianness.h" 1 +# 20 "./../int_types.h" 2 + + + + + +typedef int32_t si_int; +typedef uint32_t su_int; +# 37 "./../int_types.h" +typedef int64_t di_int; +typedef uint64_t du_int; + +typedef union { + di_int all; + struct { + + su_int low; + si_int high; + + + + + } s; +} dwords; + +typedef union { + du_int all; + struct { + + su_int low; + su_int high; + + + + + } s; +} udwords; +# 79 "./../int_types.h" +typedef int ti_int __attribute__((mode(TI))); +typedef unsigned tu_int __attribute__((mode(TI))); + +typedef union { + ti_int all; + struct { + + du_int low; + di_int high; + + + + + } s; +} twords; + +typedef union { + tu_int all; + struct { + + du_int low; + du_int high; + + + + + } s; +} utwords; + +static __inline ti_int make_ti(di_int h, di_int l) { + twords r; + r.s.high = (du_int)h; + r.s.low = (du_int)l; + return r.all; +} + +static __inline tu_int make_tu(du_int h, du_int l) { + utwords r; + r.s.high = h; + r.s.low = l; + return r.all; +} +# 133 "./../int_types.h" +typedef union { + su_int u; + float f; +} float_bits; + +typedef union { + udwords u; + double f; +} double_bits; + +typedef struct { + + udwords low; + udwords high; + + + + +} uqwords; +# 184 "./../int_types.h" +typedef long double tf_float; +# 214 "./../int_types.h" +typedef union { + uqwords u; + tf_float f; +} tf_bits; +# 227 "./../int_types.h" +typedef float _Complex Fcomplex; +typedef double _Complex Dcomplex; +typedef long double _Complex Lcomplex; + +typedef Lcomplex Qcomplex; +# 100 "./../int_lib.h" 2 + + +# 1 "./../int_util.h" 1 +# 23 "./../int_util.h" +__attribute__((noreturn)) void __compilerrt_abort_impl(const char *file, int line, + const char *function); +# 103 "./../int_lib.h" 2 + + int __paritysi2(si_int a); + int __paritydi2(di_int a); + + di_int __divdi3(di_int a, di_int b); + si_int __divsi3(si_int a, si_int b); + su_int __udivsi3(su_int n, su_int d); + + su_int __udivmodsi4(su_int a, su_int b, su_int *rem); + du_int __udivmoddi4(du_int a, du_int b, du_int *rem); + + int __clzti2(ti_int a); + tu_int __udivmodti4(tu_int a, tu_int b, tu_int *rem); +# 5 "./DD.h" 2 + +typedef union { + long double ld; + struct { + double hi; + double lo; + } s; +} DD; + +typedef union { + double d; + uint64_t x; +} doublebits; + + + + +static __inline __attribute__((always_inline)) double local_fabs(double x) { + doublebits result = {.d = x}; + result.x &= 0x7fffffffffffffffUL; + return result.d; +} + +static __inline __attribute__((always_inline)) double high26bits(double x) { + doublebits result = {.d = x}; + result.x &= 0xfffffffff8000000UL; + return result.d; +} + +static __inline __attribute__((always_inline)) int different_sign(double x, double y) { + doublebits xsignbit = {.d = x}, ysignbit = {.d = y}; + int result = (int)(xsignbit.x >> 63) ^ (int)(ysignbit.x >> 63); + return result; +} + +long double __gcc_qadd(long double, long double); +long double __gcc_qsub(long double, long double); +long double __gcc_qmul(long double, long double); +long double __gcc_qdiv(long double, long double); +# 10 "gcc_qmul.c" 2 + +long double __gcc_qmul(long double x, long double y) { + static const uint32_t infinityHi = 0x7ff00000U; + DD dst = {.ld = x}, src = {.ld = y}; + + register double A = dst.s.hi, a = dst.s.lo, B = src.s.hi, b = src.s.lo; + + double aHi, aLo, bHi, bLo; + double ab, tmp, tau; + + ab = A * B; + + + if (ab == 0.0) { + dst.s.hi = ab; + dst.s.lo = 0.0; + return dst.ld; + } + + const doublebits abBits = {.d = ab}; + if (((uint32_t)(abBits.x >> 32) & infinityHi) == infinityHi) { + dst.s.hi = ab; + dst.s.lo = 0.0; + return dst.ld; + } + + + aHi = high26bits(A); + bHi = high26bits(B); + aLo = A - aHi; + bLo = B - bHi; + + tmp = (((((aHi) * (bHi) - (ab)) + (aHi) * (bLo)) + (aLo) * (bHi)) + (aLo) * (bLo)); + tmp += (A * b + a * B); + tau = ab + tmp; + + dst.s.lo = (ab - tau) + tmp; + dst.s.hi = tau; + + return dst.ld; +} diff --git a/zigshim/gcc_qsub.c b/zigshim/gcc_qsub.c new file mode 100755 index 00000000..b0f00efa --- /dev/null +++ b/zigshim/gcc_qsub.c @@ -0,0 +1,551 @@ +# 1 "gcc_qsub.c" +# 1 "" 1 +# 1 "" 3 +# 563 "" 3 +# 1 "" 1 +# 1 "" 2 +# 1 "gcc_qsub.c" 2 + + + + + + + + +# 1 "./DD.h" 1 + + + +# 1 "./../int_lib.h" 1 +# 92 "./../int_lib.h" +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/include/float.h" 1 3 +# 93 "./../int_lib.h" 2 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/include/limits.h" 1 3 +# 25 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/include/limits.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/limits.h" 1 3 +# 26 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/limits.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/libc-header-start.h" 1 3 +# 33 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/libc-header-start.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/features.h" 1 3 +# 415 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/features.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/features-time64.h" 1 3 +# 20 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/features-time64.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/wordsize.h" 1 3 +# 21 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/features-time64.h" 2 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/timesize.h" 1 3 +# 19 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/timesize.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/wordsize.h" 1 3 +# 20 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/timesize.h" 2 3 +# 22 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/features-time64.h" 2 3 +# 416 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/features.h" 2 3 +# 513 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/features.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/stdc-predef.h" 1 3 +# 514 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/features.h" 2 3 +# 527 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/features.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/sys/cdefs.h" 1 3 +# 730 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/sys/cdefs.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/wordsize.h" 1 3 +# 731 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/sys/cdefs.h" 2 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/long-double.h" 1 3 +# 732 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/sys/cdefs.h" 2 3 +# 528 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/features.h" 2 3 +# 551 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/features.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/gnu/stubs.h" 1 3 + + + + +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/wordsize.h" 1 3 +# 6 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/gnu/stubs.h" 2 3 + + + + + + + + +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/gnu/stubs-64-v2.h" 1 3 +# 15 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/gnu/stubs.h" 2 3 +# 552 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/features.h" 2 3 +# 34 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/libc-header-start.h" 2 3 +# 27 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/limits.h" 2 3 +# 195 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/limits.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/posix1_lim.h" 1 3 +# 27 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/posix1_lim.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/wordsize.h" 1 3 +# 28 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/posix1_lim.h" 2 3 +# 161 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/posix1_lim.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/local_lim.h" 1 3 +# 38 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/local_lim.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/any-linux-any/linux/limits.h" 1 3 +# 39 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/local_lim.h" 2 3 +# 81 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/local_lim.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/pthread_stack_min-dynamic.h" 1 3 +# 29 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/pthread_stack_min-dynamic.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/pthread_stack_min.h" 1 3 +# 30 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/pthread_stack_min-dynamic.h" 2 3 +# 82 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/local_lim.h" 2 3 +# 162 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/posix1_lim.h" 2 3 +# 196 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/limits.h" 2 3 + + + +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/posix2_lim.h" 1 3 +# 200 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/limits.h" 2 3 +# 26 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/include/limits.h" 2 3 +# 94 "./../int_lib.h" 2 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/include/stdbool.h" 1 3 +# 95 "./../int_lib.h" 2 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/include/stdint.h" 1 3 +# 56 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/include/stdint.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/stdint.h" 1 3 +# 26 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/stdint.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/libc-header-start.h" 1 3 +# 27 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/stdint.h" 2 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/types.h" 1 3 +# 27 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/types.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/wordsize.h" 1 3 +# 28 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/types.h" 2 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/timesize.h" 1 3 +# 19 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/timesize.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/wordsize.h" 1 3 +# 20 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/timesize.h" 2 3 +# 29 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/types.h" 2 3 + + +typedef unsigned char __u_char; +typedef unsigned short int __u_short; +typedef unsigned int __u_int; +typedef unsigned long int __u_long; + + +typedef signed char __int8_t; +typedef unsigned char __uint8_t; +typedef signed short int __int16_t; +typedef unsigned short int __uint16_t; +typedef signed int __int32_t; +typedef unsigned int __uint32_t; + +typedef signed long int __int64_t; +typedef unsigned long int __uint64_t; + + + + + + +typedef __int8_t __int_least8_t; +typedef __uint8_t __uint_least8_t; +typedef __int16_t __int_least16_t; +typedef __uint16_t __uint_least16_t; +typedef __int32_t __int_least32_t; +typedef __uint32_t __uint_least32_t; +typedef __int64_t __int_least64_t; +typedef __uint64_t __uint_least64_t; + + + +typedef long int __quad_t; +typedef unsigned long int __u_quad_t; + + + + + + + +typedef long int __intmax_t; +typedef unsigned long int __uintmax_t; +# 141 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/types.h" 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/typesizes.h" 1 3 +# 142 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/types.h" 2 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/time64.h" 1 3 +# 143 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/types.h" 2 3 + + +typedef unsigned long int __dev_t; +typedef unsigned int __uid_t; +typedef unsigned int __gid_t; +typedef unsigned long int __ino_t; +typedef unsigned long int __ino64_t; +typedef unsigned int __mode_t; +typedef unsigned long int __nlink_t; +typedef long int __off_t; +typedef long int __off64_t; +typedef int __pid_t; +typedef struct { int __val[2]; } __fsid_t; +typedef long int __clock_t; +typedef unsigned long int __rlim_t; +typedef unsigned long int __rlim64_t; +typedef unsigned int __id_t; +typedef long int __time_t; +typedef unsigned int __useconds_t; +typedef long int __suseconds_t; +typedef long int __suseconds64_t; + +typedef int __daddr_t; +typedef int __key_t; + + +typedef int __clockid_t; + + +typedef void * __timer_t; + + +typedef long int __blksize_t; + + + + +typedef long int __blkcnt_t; +typedef long int __blkcnt64_t; + + +typedef unsigned long int __fsblkcnt_t; +typedef unsigned long int __fsblkcnt64_t; + + +typedef unsigned long int __fsfilcnt_t; +typedef unsigned long int __fsfilcnt64_t; + + +typedef long int __fsword_t; + +typedef long int __ssize_t; + + +typedef long int __syscall_slong_t; + +typedef unsigned long int __syscall_ulong_t; + + + +typedef __off64_t __loff_t; +typedef char *__caddr_t; + + +typedef long int __intptr_t; + + +typedef unsigned int __socklen_t; + + + + +typedef int __sig_atomic_t; +# 28 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/stdint.h" 2 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/wchar.h" 1 3 +# 29 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/stdint.h" 2 3 +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/powerpc64le-linux-gnu/bits/wordsize.h" 1 3 +# 30 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/stdint.h" 2 3 + + + + +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/stdint-intn.h" 1 3 +# 24 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/stdint-intn.h" 3 +typedef __int8_t int8_t; +typedef __int16_t int16_t; +typedef __int32_t int32_t; +typedef __int64_t int64_t; +# 35 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/stdint.h" 2 3 + + +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/stdint-uintn.h" 1 3 +# 24 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/stdint-uintn.h" 3 +typedef __uint8_t uint8_t; +typedef __uint16_t uint16_t; +typedef __uint32_t uint32_t; +typedef __uint64_t uint64_t; +# 38 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/stdint.h" 2 3 + + + +# 1 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/stdint-least.h" 1 3 +# 25 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/bits/stdint-least.h" 3 +typedef __int_least8_t int_least8_t; +typedef __int_least16_t int_least16_t; +typedef __int_least32_t int_least32_t; +typedef __int_least64_t int_least64_t; + + +typedef __uint_least8_t uint_least8_t; +typedef __uint_least16_t uint_least16_t; +typedef __uint_least32_t uint_least32_t; +typedef __uint_least64_t uint_least64_t; +# 42 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/stdint.h" 2 3 + + + + + +typedef signed char int_fast8_t; + +typedef long int int_fast16_t; +typedef long int int_fast32_t; +typedef long int int_fast64_t; +# 60 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/stdint.h" 3 +typedef unsigned char uint_fast8_t; + +typedef unsigned long int uint_fast16_t; +typedef unsigned long int uint_fast32_t; +typedef unsigned long int uint_fast64_t; +# 76 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/stdint.h" 3 +typedef long int intptr_t; + + +typedef unsigned long int uintptr_t; +# 90 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/libc/include/generic-glibc/stdint.h" 3 +typedef __intmax_t intmax_t; +typedef __uintmax_t uintmax_t; +# 57 "/tmp/zig-linux-x86_64-0.14.0-dev.2310+b0dcce93f/lib/include/stdint.h" 2 3 +# 96 "./../int_lib.h" 2 + + + +# 1 "./../int_types.h" 1 +# 19 "./../int_types.h" +# 1 "./../int_endianness.h" 1 +# 20 "./../int_types.h" 2 + + + + + +typedef int32_t si_int; +typedef uint32_t su_int; +# 37 "./../int_types.h" +typedef int64_t di_int; +typedef uint64_t du_int; + +typedef union { + di_int all; + struct { + + su_int low; + si_int high; + + + + + } s; +} dwords; + +typedef union { + du_int all; + struct { + + su_int low; + su_int high; + + + + + } s; +} udwords; +# 79 "./../int_types.h" +typedef int ti_int __attribute__((mode(TI))); +typedef unsigned tu_int __attribute__((mode(TI))); + +typedef union { + ti_int all; + struct { + + du_int low; + di_int high; + + + + + } s; +} twords; + +typedef union { + tu_int all; + struct { + + du_int low; + du_int high; + + + + + } s; +} utwords; + +static __inline ti_int make_ti(di_int h, di_int l) { + twords r; + r.s.high = (du_int)h; + r.s.low = (du_int)l; + return r.all; +} + +static __inline tu_int make_tu(du_int h, du_int l) { + utwords r; + r.s.high = h; + r.s.low = l; + return r.all; +} +# 133 "./../int_types.h" +typedef union { + su_int u; + float f; +} float_bits; + +typedef union { + udwords u; + double f; +} double_bits; + +typedef struct { + + udwords low; + udwords high; + + + + +} uqwords; +# 184 "./../int_types.h" +typedef long double tf_float; +# 214 "./../int_types.h" +typedef union { + uqwords u; + tf_float f; +} tf_bits; +# 227 "./../int_types.h" +typedef float _Complex Fcomplex; +typedef double _Complex Dcomplex; +typedef long double _Complex Lcomplex; + +typedef Lcomplex Qcomplex; +# 100 "./../int_lib.h" 2 + + +# 1 "./../int_util.h" 1 +# 23 "./../int_util.h" +__attribute__((noreturn)) void __compilerrt_abort_impl(const char *file, int line, + const char *function); +# 103 "./../int_lib.h" 2 + + int __paritysi2(si_int a); + int __paritydi2(di_int a); + + di_int __divdi3(di_int a, di_int b); + si_int __divsi3(si_int a, si_int b); + su_int __udivsi3(su_int n, su_int d); + + su_int __udivmodsi4(su_int a, su_int b, su_int *rem); + du_int __udivmoddi4(du_int a, du_int b, du_int *rem); + + int __clzti2(ti_int a); + tu_int __udivmodti4(tu_int a, tu_int b, tu_int *rem); +# 5 "./DD.h" 2 + +typedef union { + long double ld; + struct { + double hi; + double lo; + } s; +} DD; + +typedef union { + double d; + uint64_t x; +} doublebits; + + + + +static __inline __attribute__((always_inline)) double local_fabs(double x) { + doublebits result = {.d = x}; + result.x &= 0x7fffffffffffffffUL; + return result.d; +} + +static __inline __attribute__((always_inline)) double high26bits(double x) { + doublebits result = {.d = x}; + result.x &= 0xfffffffff8000000UL; + return result.d; +} + +static __inline __attribute__((always_inline)) int different_sign(double x, double y) { + doublebits xsignbit = {.d = x}, ysignbit = {.d = y}; + int result = (int)(xsignbit.x >> 63) ^ (int)(ysignbit.x >> 63); + return result; +} + +long double __gcc_qadd(long double, long double); +long double __gcc_qsub(long double, long double); +long double __gcc_qmul(long double, long double); +long double __gcc_qdiv(long double, long double); +# 10 "gcc_qsub.c" 2 + +long double __gcc_qsub(long double x, long double y) { + static const uint32_t infinityHi = 0x7ff00000U; + + DD dst = {.ld = x}, src = {.ld = y}; + + register double A = dst.s.hi, a = dst.s.lo, B = -src.s.hi, b = -src.s.lo; + + + if ((A == 0.0) && (B == 0.0)) { + dst.s.hi = A + B; + dst.s.lo = 0.0; + return dst.ld; + } + + + const doublebits abits = {.d = A}; + const doublebits bbits = {.d = B}; + if ((((uint32_t)(abits.x >> 32) & infinityHi) == infinityHi) || + (((uint32_t)(bbits.x >> 32) & infinityHi) == infinityHi)) { + dst.s.hi = A + B; + dst.s.lo = 0.0; + return dst.ld; + } + + + + + const double testForOverflow = A + (B + (a + b)); + const doublebits testbits = {.d = testForOverflow}; + if (((uint32_t)(testbits.x >> 32) & infinityHi) == infinityHi) { + dst.s.hi = testForOverflow; + dst.s.lo = 0.0; + return dst.ld; + } + + double H, h; + double T, t; + double W, w; + double Y; + + H = B + (A - (A + B)); + T = b + (a - (a + b)); + h = A + (B - (A + B)); + t = a + (b - (a + b)); + + if (local_fabs(A) <= local_fabs(B)) + w = (a + b) + h; + else + w = (a + b) + H; + + W = (A + B) + w; + Y = (A + B) - W; + Y += w; + + if (local_fabs(a) <= local_fabs(b)) + w = t + Y; + else + w = T + Y; + + dst.s.hi = Y = W + w; + dst.s.lo = (W - Y) + w; + + return dst.ld; +}