1
0
mirror of https://github.com/intel/tinycbor.git synced 2025-10-16 22:26:08 +08:00
Florian Larysch 48a22bddfc fix build on i386 without SSE2
Commit 3cba6b1 ("Use _Float16 for half conversions if available") added
support for using half-width float support in the compiler to perform
encoding operations, using the FLT16_MANT_DIG macro to check for
support on the given target.

However, on x86 GCC only supports this when SSE2 is enabled[1]. Unlike
clang and the other architectures where support for this is conditional,
GCC *does* define those macros even without SSE2 support, causing a
build failure:

  In file included from cborencoder_float.c:29:
  cborinternal_p.h: In function ‘encode_half’:
  cborinternal_p.h:56:5: error: invalid conversion to type ‘_Float16’ without option ‘-msse2’
     56 |     _Float16 f = (_Float16)x;
        |     ^~~~~~~~
  cborinternal_p.h: In function ‘decode_half’:
  cborinternal_p.h:65:5: error: invalid conversion from type ‘_Float16’ without option ‘-msse2’
     65 |     return (float)f;
        |

Work around this by additionally checking for this specific condition.

[1] https://gcc.gnu.org/onlinedocs/gcc/Half-Precision.html

Signed-off-by: Florian Larysch <fl@n621.de>
2025-08-19 13:46:12 -07:00
2025-08-12 10:02:40 -07:00
2025-08-19 13:46:12 -07:00
2016-08-04 14:25:32 -07:00
2025-04-21 08:56:30 -07:00
2018-02-07 10:40:52 -08:00
2017-07-26 10:29:17 -07:00
2017-12-06 18:25:51 -08:00
2025-03-18 16:43:48 -07:00

Concise Binary Object Representation (CBOR) Library
---------------------------------------------------

To build TinyCBOR:

  make

If you want to change the compiler or pass extra compiler flags:

  make CC=clang CFLAGS="-m32 -Oz" LDFLAGS="-m32"

Documentation: https://intel.github.io/tinycbor/current/

Description
No description provided
Readme MIT 2 MiB
Languages
C 50.4%
C++ 45.9%
CMake 2%
Perl 1.3%
Shell 0.3%
Other 0.1%