CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
54 lines
1.6 KiB
C
54 lines
1.6 KiB
C
//===-- Definition of macros to be used with complex functions ------------===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef __LLVM_LIBC_MACROS_COMPLEX_MACROS_H
|
|
#define __LLVM_LIBC_MACROS_COMPLEX_MACROS_H
|
|
|
|
#include "cfloat128-macros.h"
|
|
#include "cfloat16-macros.h"
|
|
|
|
#ifndef __STDC_NO_COMPLEX__
|
|
|
|
#define __STDC_VERSION_COMPLEX_H__ 202311L
|
|
|
|
#define complex _Complex
|
|
#define _Complex_I ((_Complex float)1.0fi)
|
|
#define I _Complex_I
|
|
|
|
// TODO: Add imaginary macros once GCC or Clang support _Imaginary builtin-type.
|
|
|
|
#if __has_builtin(__builtin_complex)
|
|
#define __CMPLX(r, i, t) (__builtin_complex((t)(r), (t)(i)))
|
|
#else
|
|
#define __CMPLX(r, i, t) ((_Complex t){(t)(r), (t)(i)})
|
|
#endif
|
|
|
|
#define CMPLX(r, i) __CMPLX(r, i, double)
|
|
#define CMPLXF(r, i) __CMPLX(r, i, float)
|
|
#define CMPLXL(r, i) __CMPLX(r, i, long double)
|
|
|
|
#ifdef LIBC_TYPES_HAS_CFLOAT16
|
|
#if !defined(__clang__) || (__clang_major__ >= 22 && __clang_minor__ > 0)
|
|
#define CMPLXF16(r, i) __CMPLX(r, i, _Float16)
|
|
#else
|
|
#define CMPLXF16(r, i) ((complex _Float16)(__CMPLX(r, i, float)))
|
|
#endif
|
|
#endif // LIBC_TYPES_HAS_CFLOAT16
|
|
|
|
#ifdef LIBC_TYPES_HAS_CFLOAT128
|
|
#ifdef LIBC_TYPES_CFLOAT128_IS_COMPLEX_LONG_DOUBLE
|
|
#define CMPLXF128(r, i) __CMPLX(r, i, long double)
|
|
#else
|
|
#define CMPLXF128(r, i) __CMPLX(r, i, float128)
|
|
#endif // LIBC_TYPES_CFLOAT128_IS_COMPLEX_LONG_DOUBLE
|
|
#endif // LIBC_TYPES_HAS_CFLOAT128
|
|
|
|
#endif // __STDC_NO_COMPLEX__
|
|
|
|
#endif // __LLVM_LIBC_MACROS_COMPLEX_MACROS_H
|