[PR testsuite/116860] Testsuite adjustment for recently added tests
[official-gcc.git] / gcc / config / aarch64 / arm_private_fp8.h
blob3f60294a7689157aafe05ce3bee4475fee11b882
1 /* AArch64 FP8 helper functions.
2 Do not include this file directly. Use one of arm_neon.h
3 arm_sme.h arm_sve.h instead.
5 Copyright (C) 2024-2025 Free Software Foundation, Inc.
6 Contributed by ARM Ltd.
8 This file is part of GCC.
10 GCC is free software; you can redistribute it and/or modify it
11 under the terms of the GNU General Public License as published
12 by the Free Software Foundation; either version 3, or (at your
13 option) any later version.
15 GCC is distributed in the hope that it will be useful, but WITHOUT
16 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
17 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
18 License for more details.
20 Under Section 7 of GPL version 3, you are granted additional
21 permissions described in the GCC Runtime Library Exception, version
22 3.1, as published by the Free Software Foundation.
24 You should have received a copy of the GNU General Public License and
25 a copy of the GCC Runtime Library Exception along with this program;
26 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
27 <http://www.gnu.org/licenses/>. */
29 #ifndef _GCC_ARM_PRIVATE_FP8_H
30 #define _GCC_ARM_PRIVATE_FP8_H
32 #if !defined(_AARCH64_NEON_H_) && !defined(_ARM_SVE_H_)
33 #error "This file should not be used standalone. Please include one of arm_neon.h arm_sve.h arm_sme.h instead."
34 #endif
36 #include <stdint.h>
38 #ifdef __cplusplus
39 extern "C"
41 #endif
43 typedef __mfp8 mfloat8_t;
45 typedef uint64_t fpm_t;
47 enum __ARM_FPM_FORMAT
49 __ARM_FPM_E5M2,
50 __ARM_FPM_E4M3,
53 enum __ARM_FPM_OVERFLOW
55 __ARM_FPM_INFNAN,
56 __ARM_FPM_SATURATE,
59 #define __arm_fpm_init() (0)
61 #define __arm_set_fpm_src1_format(__fpm, __format) \
62 ((__fpm & ~(uint64_t)0x7) | (__format & (uint64_t)0x7))
63 #define __arm_set_fpm_src2_format(__fpm, __format) \
64 ((__fpm & ~((uint64_t)0x7 << 3)) | ((__format & (uint64_t)0x7) << 3))
65 #define __arm_set_fpm_dst_format(__fpm, __format) \
66 ((__fpm & ~((uint64_t)0x7 << 6)) | ((__format & (uint64_t)0x7) << 6))
67 #define __arm_set_fpm_overflow_cvt(__fpm, __behaviour) \
68 ((__fpm & ~((uint64_t)0x1 << 15)) | ((__behaviour & (uint64_t)0x1) << 15))
69 #define __arm_set_fpm_overflow_mul(__fpm, __behaviour) \
70 ((__fpm & ~((uint64_t)0x1 << 14)) | ((__behaviour & (uint64_t)0x1) << 14))
71 #define __arm_set_fpm_lscale(__fpm, __scale) \
72 ((__fpm & ~((uint64_t)0x7f << 16)) | ((__scale & (uint64_t)0x7f) << 16))
73 #define __arm_set_fpm_lscale2(__fpm, __scale) \
74 ((__fpm & ~((uint64_t)0x3f << 32)) | ((__scale & (uint64_t)0x3f) << 32))
75 #define __arm_set_fpm_nscale(__fpm, __scale) \
76 ((__fpm & ~((uint64_t)0xff << 24)) | ((__scale & (uint64_t)0xff) << 24))
78 #ifdef __cplusplus
80 #endif
82 #endif