Skip to content

Commit d6a69dc

Browse files
committed
Initial work on adding new simd support
Signed-off-by: Ian <[email protected]>
1 parent 9932c02 commit d6a69dc

File tree

15 files changed

+1138
-87
lines changed

15 files changed

+1138
-87
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
add_subdirectory(func)
2-
add_subdirectory(pp)
2+
#add_subdirectory(pp)
33
add_subdirectory(simd)
Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
11
ccm_add_headers(
2-
simd_old.hpp
2+
simd.hpp
3+
const_eval.hpp
4+
debug_print.hpp
5+
detail.hpp
6+
may_alias.hpp
7+
simd_intrinsic.hpp
8+
trap.hpp
9+
constexpr_wrapper.hpp
10+
fwddecl.hpp
11+
simd_meta.hpp
12+
x86_include.hpp
313
)
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/*
2+
* Copyright (c) Ian Pike
3+
* Copyright (c) CCMath contributors
4+
*
5+
* CCMath is provided under the Apache-2.0 License WITH LLVM-exception.
6+
* See LICENSE for more information.
7+
*
8+
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
9+
*/
10+
11+
#pragma once
12+
13+
#if __cplusplus >= 202002L
14+
#define CCM_CONSTEVAL consteval
15+
#else
16+
#define CCM_CONSTEVAL constexpr
17+
#endif
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
#pragma once
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* Copyright (c) Ian Pike
3+
* Copyright (c) CCMath contributors
4+
*
5+
* CCMath is provided under the Apache-2.0 License WITH LLVM-exception.
6+
* See LICENSE for more information.
7+
*
8+
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
9+
*/
10+
11+
/*
12+
* Enables the ability to print debug messages to stderr for internal ccmath debugging.
13+
* Note: This will always be disabled if the cmake does not enable it.
14+
* ATTENTION: This code here is EXTREMELY finicky and might not work on every compiler.
15+
* It should NEVER be used outside of internal CCMath debugging and should always be wrapped.
16+
*/
17+
18+
#pragma once
19+
20+
#if defined(CCMATH_CONFIG_ENABLE_DEBUG_PRINT)
21+
#if defined(__GNUC__) && !defined(__clang__)
22+
extern "C" struct _IO_FILE; // Forward declaration allows us to avoid including cstdio.
23+
extern "C" _IO_FILE * stderr; // Forward declaration allows us to avoid including cstdio.
24+
#define CCM_DEBUG_PRINT(msg, ...) __builtin_fprintf(stderr, msg, __VA_ARGS__)
25+
#elif defined(__clang__) && !defined(_MSC_VER)
26+
#define CCM_DEBUG_PRINT(...) __builtin_printf(__VA_ARGS__)
27+
#else
28+
#define CCM_DEBUG_PRINT(...) (-1)
29+
#endif
30+
#else
31+
#define CCM_DEBUG_PRINT(...)
32+
#endif

0 commit comments

Comments
 (0)