From 8dd16259287f58f9273002717ec4d27e97127719 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 12 Jun 2024 07:43:14 +0200 Subject: Merging upstream version 127.0. Signed-off-by: Daniel Baumann --- js/src/jit/shared/AtomicOperations-shared-jit.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'js/src/jit/shared/AtomicOperations-shared-jit.h') diff --git a/js/src/jit/shared/AtomicOperations-shared-jit.h b/js/src/jit/shared/AtomicOperations-shared-jit.h index ca66a6f9b9..d5303b2c60 100644 --- a/js/src/jit/shared/AtomicOperations-shared-jit.h +++ b/js/src/jit/shared/AtomicOperations-shared-jit.h @@ -23,6 +23,7 @@ #include #include "jit/AtomicOperationsGenerated.h" +#include "vm/Float16.h" #include "vm/Uint8Clamped.h" namespace js { @@ -405,6 +406,14 @@ inline uint8_clamped js::jit::AtomicOperations::loadSafeWhenRacy( return uint8_clamped(loadSafeWhenRacy((uint8_t*)addr)); } +// Clang requires a specialization for float16. +template <> +inline float16 js::jit::AtomicOperations::loadSafeWhenRacy(float16* addr) { + float16 f16; + f16.val = loadSafeWhenRacy((uint16_t*)addr); + return f16; +} + } // namespace jit } // namespace js @@ -464,6 +473,13 @@ inline void js::jit::AtomicOperations::storeSafeWhenRacy(uint8_clamped* addr, storeSafeWhenRacy((uint8_t*)addr, (uint8_t)val); } +// Clang requires a specialization for float16. +template <> +inline void js::jit::AtomicOperations::storeSafeWhenRacy(float16* addr, + float16 val) { + storeSafeWhenRacy((uint16_t*)addr, val.val); +} + } // namespace jit } // namespace js -- cgit v1.2.3