From f215e02bf85f68d3a6106c2a1f4f7f063f819064 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 11 Apr 2024 10:17:27 +0200 Subject: Adding upstream version 7.0.14-dfsg. Signed-off-by: Daniel Baumann --- src/libs/softfloat-3e/build/vbox/platform.h | 107 ++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 src/libs/softfloat-3e/build/vbox/platform.h (limited to 'src/libs/softfloat-3e/build/vbox/platform.h') diff --git a/src/libs/softfloat-3e/build/vbox/platform.h b/src/libs/softfloat-3e/build/vbox/platform.h new file mode 100644 index 00000000..41aff514 --- /dev/null +++ b/src/libs/softfloat-3e/build/vbox/platform.h @@ -0,0 +1,107 @@ +/* $Id: platform.h $ */ +/** @file + * Platform Header for all VirtualBox targets. + */ + +/* + * Copyright (C) 2022-2023 Oracle and/or its affiliates. + * + * This file is part of VirtualBox base platform packages, as + * available from https://www.virtualbox.org. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation, in version 3 of the + * License. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + * + * SPDX-License-Identifier: GPL-3.0-only + */ + +#ifndef VBOX_INCLUDED_SRC_vbox_platform_h +#define VBOX_INCLUDED_SRC_vbox_platform_h +#ifndef RT_WITHOUT_PRAGMA_ONCE +# pragma once +#endif + +/* For RT_LITTLE_ENDIAN, RT_ARCH_XXX and more: */ +#include + +/* Build config: */ +#define SOFTFLOAT_FAST_INT64 /**< We use functions guarded by this, so must be defined regardless of truthiness. */ +#define SOFTFLOAT_ROUND_ODD /** @todo Skip this? */ + +/* IPRT should detect endianness correctly: */ +#ifdef RT_LITTLE_ENDIAN +# define LITTLEENDIAN 1 +#endif + +/* Compiler/host configuration bits: */ +#define SOFTFLOAT_FAST_DIV32TO16 +#if ARCH_BITS > 32 || defined(RT_ARCH_X86) +# define SOFTFLOAT_FAST_DIV64TO32 +#endif + +/* See DECLINLINE for guidance: */ +#ifdef __GNUC__ +# define INLINE static __inline__ +#elif defined(__cplusplus) +# define INLINE static inline +#elif defined(_MSC_VER) +# define INLINE static _inline +#else +# error "Port me!" +#endif + +/* Generic IPRT asm.h based optimizations: */ +#if !defined(__GNUC__) +# include +# define softfloat_countLeadingZeros16 softfloat_iprt_countLeadingZeros16 +DECLINLINE(uint_fast8_t) softfloat_iprt_countLeadingZeros16(uint16_t uVal) +{ + return 16 - ASMBitLastSetU16(uVal); +} +# define softfloat_countLeadingZeros32 softfloat_iprt_countLeadingZeros32 +DECLINLINE(uint_fast8_t) softfloat_iprt_countLeadingZeros32(uint32_t uVal) +{ + return 32 - ASMBitLastSetU32(uVal); +} +# define softfloat_countLeadingZeros64 softfloat_iprt_countLeadingZeros64 +DECLINLINE(uint_fast8_t) softfloat_iprt_countLeadingZeros64(uint64_t uVal) +{ + return 64 - ASMBitLastSetU64(uVal); +} +#endif + +/* Include GCC optimizations: */ +#ifdef __GNUC__ +# ifndef softfloat_countLeadingZeros16 +# define SOFTFLOAT_BUILTIN_CLZ 1 +# endif +# if ARCH_BITS > 32 && defined(__SIZEOF_INT128__) +# define SOFTFLOAT_INTRINSIC_INT128 1 +# endif +# include "opts-GCC.h" +#endif + +/* We've eliminated the global variables and need no TLS variable tricks. */ +#ifndef THREAD_LOCAL +# if 1 +# define THREAD_LOCAL +# else +# ifdef _MSC_VER +# define THREAD_LOCAL __declspec(thread) +# else +# define THREAD_LOCAL __thread +# endif +# endif +#endif + +#endif /* !VBOX_INCLUDED_SRC_vbox_platform_h */ -- cgit v1.2.3