1 /* Copyright (C) 2012-2024 Free Software Foundation, Inc.
3 This file is part of GCC.
5 GCC is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3, or (at your option)
10 GCC is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 Under Section 7 of GPL version 3, you are granted additional
16 permissions described in the GCC Runtime Library Exception, version
17 3.1, as published by the Free Software Foundation.
19 You should have received a copy of the GNU General Public License and
20 a copy of the GCC Runtime Library Exception along with this program;
21 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
22 <http://www.gnu.org/licenses/>. */
24 #ifndef _X86GPRINTRIN_H_INCLUDED
25 #error "Never use <cmpccxaddintrin.h> directly; include <x86gprintrin.h> instead."
28 #ifndef _CMPCCXADDINTRIN_H_INCLUDED
29 #define _CMPCCXADDINTRIN_H_INCLUDED
34 #pragma GCC push_options
35 #pragma GCC target("cmpccxadd")
36 #define __DISABLE_CMPCCXADD__
37 #endif /* __CMPCCXADD__ */
40 _CMPCCX_O
, /* Overflow. */
41 _CMPCCX_NO
, /* No overflow. */
42 _CMPCCX_B
, /* Below. */
43 _CMPCCX_NB
, /* Not below. */
44 _CMPCCX_Z
, /* Zero. */
45 _CMPCCX_NZ
, /* Not zero. */
46 _CMPCCX_BE
, /* Below or equal. */
47 _CMPCCX_NBE
, /* Neither below nor equal. */
48 _CMPCCX_S
, /* Sign. */
49 _CMPCCX_NS
, /* No sign. */
50 _CMPCCX_P
, /* Parity. */
51 _CMPCCX_NP
, /* No parity. */
52 _CMPCCX_L
, /* Less. */
53 _CMPCCX_NL
, /* Not less. */
54 _CMPCCX_LE
, /* Less or equal. */
55 _CMPCCX_NLE
, /* Neither less nor equal. */
60 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
61 _cmpccxadd_epi32 (int *__A
, int __B
, int __C
, const _CMPCCX_ENUM __D
)
63 return __builtin_ia32_cmpccxadd (__A
, __B
, __C
, __D
);
66 extern __inline
long long
67 __attribute__ ((__gnu_inline__
, __always_inline__
, __artificial__
))
68 _cmpccxadd_epi64 (long long *__A
, long long __B
, long long __C
,
69 const _CMPCCX_ENUM __D
)
71 return __builtin_ia32_cmpccxadd64 (__A
, __B
, __C
, __D
);
74 #define _cmpccxadd_epi32(A,B,C,D) \
75 __builtin_ia32_cmpccxadd ((int *) (A), (int) (B), (int) (C), \
77 #define _cmpccxadd_epi64(A,B,C,D) \
78 __builtin_ia32_cmpccxadd64 ((long long *) (A), (long long) (B), \
79 (long long) (C), (_CMPCCX_ENUM) (D))
82 #ifdef __DISABLE_CMPCCXADD__
83 #undef __DISABLE_CMPCCXADD__
84 #pragma GCC pop_options
85 #endif /* __DISABLE_CMPCCXADD__ */
89 #endif /* _CMPCCXADDINTRIN_H_INCLUDED */