BRL-CAD
simd.h
Go to the documentation of this file.
1/* S I M D . H
2 * BRL-CAD
3 *
4 * Copyright (c) 2004-2023 United States Government as represented by
5 * the U.S. Army Research Laboratory.
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public License
9 * version 2.1 as published by the Free Software Foundation.
10 *
11 * This library is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this file; see the file named COPYING for more
18 * information.
19 */
20
21#ifndef BU_SIMD_H
22#define BU_SIMD_H
23
24#include "common.h"
25
26#include "bu/defines.h"
27
28__BEGIN_DECLS
29
30/** @addtogroup bu_simd
31 * @brief
32 * Single Instruction Multiple Data support.
33 */
34/** @{ */
35/** @file bu/simd.h */
36
37#define BU_SIMD_SSE4_2 7
38#define BU_SIMD_SSE4_1 6
39#define BU_SIMD_SSE3 5
40#define BU_SIMD_ALTIVEC 4
41#define BU_SIMD_SSE2 3
42#define BU_SIMD_SSE 2
43#define BU_SIMD_MMX 1
44#define BU_SIMD_NONE 0
45/**
46 * Detect SIMD capabilities at runtime.
47 */
48BU_EXPORT extern int bu_simd_level(void);
49
50/**
51 * Detect if requested SIMD capabilities are available at runtime.
52 * Returns 1 if they are, 0 if they are not.
53 */
54BU_EXPORT extern int bu_simd_supported(int level);
55
56/** @} */
57
58__END_DECLS
59
60#endif /* BU_SIMD_H */
61
62/*
63 * Local Variables:
64 * mode: C
65 * tab-width: 8
66 * indent-tabs-mode: t
67 * c-file-style: "stroustrup"
68 * End:
69 * ex: shiftwidth=4 tabstop=8
70 */
Header file for the BRL-CAD common definitions.
int bu_simd_supported(int level)
int bu_simd_level(void)