-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdsp.h
29 lines (24 loc) · 1009 Bytes
/
dsp.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
* SPDX-License-Identifier: MIT
* Copyright (C) 2021-2022 Sergey Bolshakov <beefdeadbeef@gmail.com>
*/
#include <stdint.h>
#if defined (__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__)
#define __ssat(val, sat) \
({ \
int32_t out; \
__asm__ volatile ("ssat %0, %1, %2" \
: "=r" (out) \
: "I" (sat), "r" (val) \
: "cc"); \
out; \
})
#define __vsqrt(in) \
({ \
float out; \
__asm__ ("vsqrt.f32 %0, %1" \
: "=t" (out) \
: "t" (in)); \
out; \
})
#endif