Skip to content

Commit e5b732d

Browse files
authored
Merge pull request #84221 from allevato/float16-fix
[Runtime] Fix overload resolution when targeting Haswell.
2 parents 43ab8dc + 4578d0b commit e5b732d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

stdlib/public/runtime/Float16Support.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@ static _Float16 fromEncoding(unsigned short s) {
7171
// but who knows what could go wrong, and they're tiny functions.
7272
# include <immintrin.h>
7373

74-
SWIFT_RUNTIME_EXPORT float __gnu_h2f_ieee(short h) {
74+
SWIFT_RUNTIME_EXPORT float __gnu_h2f_ieee(unsigned short h) {
7575
return _mm_cvtss_f32(_mm_cvtph_ps(_mm_set_epi64x(0,h)));
7676
}
7777

78-
SWIFT_RUNTIME_EXPORT short __gnu_f2h_ieee(float f) {
78+
SWIFT_RUNTIME_EXPORT unsigned short __gnu_f2h_ieee(float f) {
7979
return (unsigned short)_mm_cvtsi128_si32(
8080
_mm_cvtps_ph(_mm_set_ss(f), _MM_FROUND_CUR_DIRECTION)
8181
);

0 commit comments

Comments
 (0)