Skip to content

Commit

Permalink
[libc][NFC] Move __has_builtin to LIBC_HAS_BUILTIN
Browse files Browse the repository at this point in the history
Summary:
These should use the common `LIBC_HAS_BUILTIN` even if we will only
compile this with `clang`.
  • Loading branch information
jhuber6 committed Jun 21, 2023
1 parent bb86496 commit 1f99526
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions libc/src/__support/FPUtil/gpu/FMA.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@
#ifndef LLVM_LIBC_SRC_SUPPORT_FPUTIL_GPU_FMA_H
#define LLVM_LIBC_SRC_SUPPORT_FPUTIL_GPU_FMA_H

#include "src/__support/CPP/type_traits.h"
#include "src/__support/macros/config.h"

// These intrinsics map to the FMA instrunctions in the target ISA for the GPU.
// The default rounding mode generated from these will be to the nearest even.
static_assert(__has_builtin(__builtin_fma), "FMA builtins must be defined");
static_assert(__has_builtin(__builtin_fmaf), "FMA builtins must be defined");

#include "src/__support/CPP/type_traits.h"
static_assert(LIBC_HAS_BUILTIN(__builtin_fma), "FMA builtins must be defined");
static_assert(LIBC_HAS_BUILTIN(__builtin_fmaf), "FMA builtins must be defined");

namespace __llvm_libc {
namespace fputil {
Expand Down

0 comments on commit 1f99526

Please sign in to comment.