From fe690587bedb23dec2753549d4216059a7f894a1 Mon Sep 17 00:00:00 2001 From: Sven van Haastregt Date: Wed, 9 Feb 2022 10:47:45 +0000 Subject: [PATCH] [OpenCL] Fix atomic_fetch_add/sub with half type An error in the tablegen description affects the declarations provided by `-fdeclare-opencl-builtins` for `atomic_fetch_add` and `atomic_fetch_sub`. The atomic argument should be an atomic_half, not an atomic_float. --- clang/lib/Sema/OpenCLBuiltins.td | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/clang/lib/Sema/OpenCLBuiltins.td b/clang/lib/Sema/OpenCLBuiltins.td index 08f8630..60a05f9 100644 --- a/clang/lib/Sema/OpenCLBuiltins.td +++ b/clang/lib/Sema/OpenCLBuiltins.td @@ -1138,7 +1138,7 @@ let MinVersion = CL20 in { foreach ModOp = ["add", "sub"] in { let Extension = FuncExtFloatAtomicsFp16GlobalAdd in { defm : BuiltinAtomicExplicit<"atomic_fetch_" # ModOp, - [Half, PointerType, GlobalAS>, Half]>; + [Half, PointerType, GlobalAS>, Half]>; } let Extension = FuncExtFloatAtomicsFp32GlobalAdd in { defm : BuiltinAtomicExplicit<"atomic_fetch_" # ModOp, @@ -1150,7 +1150,7 @@ let MinVersion = CL20 in { } let Extension = FuncExtFloatAtomicsFp16LocalAdd in { defm : BuiltinAtomicExplicit<"atomic_fetch_" # ModOp, - [Half, PointerType, LocalAS>, Half]>; + [Half, PointerType, LocalAS>, Half]>; } let Extension = FuncExtFloatAtomicsFp32LocalAdd in { defm : BuiltinAtomicExplicit<"atomic_fetch_" # ModOp, @@ -1162,7 +1162,7 @@ let MinVersion = CL20 in { } let Extension = FuncExtFloatAtomicsFp16GenericAdd in { defm : BuiltinAtomicExplicit<"atomic_fetch_" # ModOp, - [Half, PointerType, GenericAS>, Half]>; + [Half, PointerType, GenericAS>, Half]>; } let Extension = FuncExtFloatAtomicsFp32GenericAdd in { defm : BuiltinAtomicExplicit<"atomic_fetch_" # ModOp, -- 2.7.4