Skip to content

Commit 0f4830f

Browse files
asaezpercodebot
authored andcommitted
all: fix ARM_NEON macro
1 parent 8959683 commit 0f4830f

File tree

14 files changed

+251
-251
lines changed

14 files changed

+251
-251
lines changed

lib/ofh/compression/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64")
3030
COMPILE_OPTIONS "-mavx512f;-mavx512bw;-mavx512vl;-mavx512dq;")
3131
endif (${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64")
3232

33-
if (HAVE_NEON)
33+
if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64")
3434
list(APPEND SOURCES iq_compression_bfp_neon.cpp)
3535
list(APPEND SOURCES iq_compression_none_neon.cpp)
36-
endif (HAVE_NEON)
36+
endif (${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64")
3737

3838
add_library(srsran_ofh_compression STATIC ${SOURCES})
3939
target_link_libraries(srsran_ofh_compression srsvec)

lib/ofh/compression/compression_factory.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424
#include "iq_compression_none_avx512.h"
2525
#endif
2626

27-
#ifdef __ARM_NEON__
27+
#ifdef __ARM_NEON
2828
#include "iq_compression_bfp_neon.h"
2929
#include "iq_compression_none_neon.h"
30-
#endif // __ARM_NEON__
30+
#endif // __ARM_NEON
3131

3232
using namespace srsran;
3333
using namespace ofh;
@@ -52,11 +52,11 @@ std::unique_ptr<iq_compressor> srsran::ofh::create_iq_compressor(compression_typ
5252
}
5353
}
5454
#endif
55-
#ifdef __ARM_NEON__
55+
#ifdef __ARM_NEON
5656
if ((impl_type == "neon") || (impl_type == "auto")) {
5757
return std::make_unique<iq_compression_none_neon>(logger, iq_scaling);
5858
}
59-
#endif // __ARM_NEON__
59+
#endif // __ARM_NEON
6060
return std::make_unique<iq_compression_none_impl>(logger, iq_scaling);
6161
case compression_type::BFP:
6262
#ifdef __x86_64__
@@ -74,11 +74,11 @@ std::unique_ptr<iq_compressor> srsran::ofh::create_iq_compressor(compression_typ
7474
}
7575
}
7676
#endif
77-
#ifdef __ARM_NEON__
77+
#ifdef __ARM_NEON
7878
if ((impl_type == "neon") || (impl_type == "auto")) {
7979
return std::make_unique<iq_compression_bfp_neon>(logger, iq_scaling);
8080
}
81-
#endif // __ARM_NEON__
81+
#endif // __ARM_NEON
8282
return std::make_unique<iq_compression_bfp_impl>(logger, iq_scaling);
8383
case compression_type::block_scaling:
8484
return std::make_unique<iq_compression_death_impl>();
@@ -113,11 +113,11 @@ srsran::ofh::create_iq_decompressor(compression_type type, srslog::basic_logger&
113113
}
114114
}
115115
#endif
116-
#ifdef __ARM_NEON__
116+
#ifdef __ARM_NEON
117117
if ((impl_type == "neon") || (impl_type == "auto")) {
118118
return std::make_unique<iq_compression_none_neon>(logger);
119119
}
120-
#endif // __ARM_NEON__
120+
#endif // __ARM_NEON
121121
return std::make_unique<iq_compression_none_impl>(logger);
122122
case compression_type::BFP:
123123
#ifdef __x86_64__
@@ -133,11 +133,11 @@ srsran::ofh::create_iq_decompressor(compression_type type, srslog::basic_logger&
133133
}
134134
}
135135
#endif
136-
#ifdef __ARM_NEON__
136+
#ifdef __ARM_NEON
137137
if ((impl_type == "neon") || (impl_type == "auto")) {
138138
return std::make_unique<iq_compression_bfp_neon>(logger);
139139
}
140-
#endif // __ARM_NEON__
140+
#endif // __ARM_NEON
141141
return std::make_unique<iq_compression_bfp_impl>(logger);
142142
case compression_type::block_scaling:
143143
return std::make_unique<iq_compression_death_impl>();

lib/phy/upper/channel_coding/ldpc/simd_types.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
#if defined(__ARM_NEON)
2323
#include <arm_neon.h>
24-
#endif // defined(__ARM_NEON__)
24+
#endif // defined(__ARM_NEON)
2525

2626
namespace srsran {
2727
namespace detail {
@@ -42,7 +42,7 @@ using simd256_type = struct {
4242
using simd512_type = struct {
4343
// Just for compatibility with the x86 implementation, not used in ARM.
4444
};
45-
#endif // defined(__ARM_NEON__)
45+
#endif // defined(__ARM_NEON)
4646

4747
struct simd128_wrapper {
4848
using simdType = simd128_type;

lib/phy/upper/channel_modulation/demodulation_mapper_qam16.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
#include "avx2_helpers.h"
1515
#endif // __AVX2__
1616

17-
#ifdef __ARM_NEON__
17+
#ifdef __ARM_NEON
1818
#include "neon_helpers.h"
19-
#endif // __ARM_NEON__
19+
#endif // __ARM_NEON
2020

2121
using namespace srsran;
2222

@@ -107,7 +107,7 @@ static void demod_QAM16_avx2(log_likelihood_ratio* llr, const cf_t* symbol, cons
107107
}
108108
#endif // __AVX2__
109109

110-
#ifdef __ARM_NEON__
110+
#ifdef __ARM_NEON
111111
static void demod_QAM16_neon(log_likelihood_ratio* llr, const cf_t* symbol, const float* noise_var)
112112
{
113113
// Load symbols.
@@ -179,7 +179,7 @@ static void demod_QAM16_neon(log_likelihood_ratio* llr, const cf_t* symbol, cons
179179
vst1q_s8(reinterpret_cast<int8_t*>(llr),
180180
neon::quantize_f32(l_value_0, l_value_1, l_value_2, l_value_3, RANGE_LIMIT_FLOAT));
181181
}
182-
#endif // __ARM_NEON__
182+
#endif // __ARM_NEON
183183

184184
static log_likelihood_ratio demod_16QAM_symbol_01(float x, float noise_var)
185185
{
@@ -230,7 +230,7 @@ void srsran::demodulate_soft_QAM16(span<log_likelihood_ratio> llrs,
230230
}
231231
#endif // __AVX2__
232232

233-
#ifdef __ARM_NEON__
233+
#ifdef __ARM_NEON
234234
// For NEON, it generates 16 LLRs simultaneously. The input is read in batches of 4 symbols.
235235
for (std::size_t symbol_index_end = (symbols.size() / 4) * 4; symbol_index != symbol_index_end; symbol_index += 4) {
236236
demod_QAM16_neon(llr_it, symbols_it, noise_it);
@@ -239,7 +239,7 @@ void srsran::demodulate_soft_QAM16(span<log_likelihood_ratio> llrs,
239239
symbols_it += 4;
240240
noise_it += 4;
241241
}
242-
#endif // __ARM_NEON__
242+
#endif // __ARM_NEON
243243

244244
for (std::size_t symbol_index_end = symbols.size(); symbol_index != symbol_index_end; ++symbol_index) {
245245
// Set all LLR to zero if the symbol is near zero.

lib/phy/upper/channel_modulation/demodulation_mapper_qam256.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
#include "avx2_helpers.h"
1616
#endif // __AVX2__
1717

18-
#ifdef __ARM_NEON__
18+
#ifdef __ARM_NEON
1919
#include "neon_helpers.h"
20-
#endif // __ARM_NEON__
20+
#endif // __ARM_NEON
2121

2222
using namespace srsran;
2323

@@ -194,7 +194,7 @@ static void demod_QAM256_avx2(log_likelihood_ratio* llr, const cf_t* symbol, con
194194
}
195195
#endif // __AVX2__
196196

197-
#ifdef __ARM_NEON__
197+
#ifdef __ARM_NEON
198198
static void demod_QAM256_neon(log_likelihood_ratio* llr, const cf_t* symbol, const float* noise_var)
199199
{
200200
// Load symbols.
@@ -261,7 +261,7 @@ static void demod_QAM256_neon(log_likelihood_ratio* llr, const cf_t* symbol, con
261261
vst1q_s8(reinterpret_cast<int8_t*>(llr + 16),
262262
neon::quantize_f32(l_value_4, l_value_5, l_value_6, l_value_7, RANGE_LIMIT_FLOAT));
263263
}
264-
#endif // __ARM_NEON__
264+
#endif // __ARM_NEON
265265

266266
static log_likelihood_ratio demod_256QAM_symbol_01(float value, float rcp_noise_var)
267267
{
@@ -307,7 +307,7 @@ void srsran::demodulate_soft_QAM256(span<log_likelihood_ratio> llrs,
307307
}
308308
#endif // __AVX2__
309309

310-
#ifdef __ARM_NEON__
310+
#ifdef __ARM_NEON
311311
// For NEON, it generates 32 LLRs simultaneously. The input is read in batches of 4 symbols.
312312
for (std::size_t symbol_index_end = (symbols.size() / 4) * 4; symbol_index != symbol_index_end; symbol_index += 4) {
313313
demod_QAM256_neon(llr_it, symbols_it, noise_it);
@@ -316,7 +316,7 @@ void srsran::demodulate_soft_QAM256(span<log_likelihood_ratio> llrs,
316316
symbols_it += 4;
317317
noise_it += 4;
318318
}
319-
#endif // __ARM_NEON__
319+
#endif // __ARM_NEON
320320

321321
for (std::size_t symbol_index_end = symbols.size(); symbol_index != symbol_index_end; ++symbol_index) {
322322
// Set all LLR to zero if the symbol is near zero.

lib/phy/upper/channel_modulation/demodulation_mapper_qam64.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
#include "avx2_helpers.h"
1616
#endif // __AVX2__
1717

18-
#ifdef __ARM_NEON__
18+
#ifdef __ARM_NEON
1919
#include "neon_helpers.h"
20-
#endif // __ARM_NEON__
20+
#endif // __ARM_NEON
2121

2222
using namespace srsran;
2323

@@ -157,7 +157,7 @@ static void demod_QAM64_avx2(log_likelihood_ratio* llr, const cf_t* symbol, cons
157157
}
158158
#endif // __AVX2__
159159

160-
#ifdef __ARM_NEON__
160+
#ifdef __ARM_NEON
161161

162162
static void demod_QAM64_neon(log_likelihood_ratio* llr, const cf_t* symbol, const float* noise_var)
163163
{
@@ -250,7 +250,7 @@ static void demod_QAM64_neon(log_likelihood_ratio* llr, const cf_t* symbol, cons
250250
vst1q_s8(reinterpret_cast<int8_t*>(llr + 32),
251251
neon::quantize_f32(l_value_8, l_value_9, l_value_10, l_value_11, RANGE_LIMIT_FLOAT));
252252
}
253-
#endif // __ARM_NEON__
253+
#endif // __ARM_NEON
254254

255255
static log_likelihood_ratio demod_64QAM_symbol_01(float value, float rcp_noise_var)
256256
{
@@ -291,7 +291,7 @@ void srsran::demodulate_soft_QAM64(span<log_likelihood_ratio> llrs,
291291
}
292292
#endif // __AVX2__
293293

294-
#ifdef __ARM_NEON__
294+
#ifdef __ARM_NEON
295295
// For NEON, it generates 48 LLRs simultaneously. The input is read in batches of 8 symbols.
296296
for (std::size_t symbol_index_end = (symbols.size() / 8) * 8; symbol_index != symbol_index_end; symbol_index += 8) {
297297
demod_QAM64_neon(llr_it, symbols_it, noise_it);
@@ -300,7 +300,7 @@ void srsran::demodulate_soft_QAM64(span<log_likelihood_ratio> llrs,
300300
symbols_it += 8;
301301
noise_it += 8;
302302
}
303-
#endif // __ARM_NEON__
303+
#endif // __ARM_NEON
304304

305305
for (std::size_t symbol_index_end = symbols.size(); symbol_index != symbol_index_end; ++symbol_index) {
306306
// Set all LLR to zero if the symbol is near zero.

lib/phy/upper/channel_modulation/demodulation_mapper_qpsk.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
#include "avx2_helpers.h"
1414
#endif // __AVX2__
1515

16-
#ifdef __ARM_NEON__
16+
#ifdef __ARM_NEON
1717
#include "neon_helpers.h"
18-
#endif // __ARM_NEON__
18+
#endif // __ARM_NEON
1919

2020
using namespace srsran;
2121

@@ -66,7 +66,7 @@ static void demod_QPSK_avx2(log_likelihood_ratio* llr, const cf_t* symbol, const
6666

6767
#endif // __AVX2__
6868

69-
#ifdef __ARM_NEON__
69+
#ifdef __ARM_NEON
7070

7171
static void demod_QPSK_neon(log_likelihood_ratio* llr, const cf_t* symbol, const float* noise_var)
7272
{
@@ -104,7 +104,7 @@ static void demod_QPSK_neon(log_likelihood_ratio* llr, const cf_t* symbol, const
104104
neon::quantize_f32(l_value_0, l_value_1, l_value_2, l_value_3, RANGE_LIMIT_FLOAT));
105105
}
106106

107-
#endif // __ARM_NEON__
107+
#endif // __ARM_NEON
108108

109109
static log_likelihood_ratio demod_QPSK_symbol(float x, float noise_var)
110110
{
@@ -137,7 +137,7 @@ void srsran::demodulate_soft_QPSK(span<log_likelihood_ratio> llrs,
137137
}
138138
#endif // __AVX2__
139139

140-
#ifdef __ARM_NEON__
140+
#ifdef __ARM_NEON
141141
// For NEON, it generates 16 LLRs simultaneously. The input is read in batches of 8 symbols.
142142
for (std::size_t symbol_index_end = (symbols.size() / 8) * 8; symbol_index != symbol_index_end; symbol_index += 8) {
143143
demod_QPSK_neon(llr_it, symbols_it, noise_it);
@@ -146,7 +146,7 @@ void srsran::demodulate_soft_QPSK(span<log_likelihood_ratio> llrs,
146146
symbols_it += 8;
147147
noise_it += 8;
148148
}
149-
#endif // __ARM_NEON__
149+
#endif // __ARM_NEON
150150

151151
// Process remainder symbols with the generic algorithm.
152152
for (std::size_t symbol_index_end = symbols.size(); symbol_index != symbol_index_end; ++symbol_index) {

lib/phy/upper/equalization/equalize_zf_1xn.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ void equalize_zf_1xn(span<cf_t> symbols_out,
4141

4242
unsigned i_re = 0;
4343

44-
#if defined(__AVX2__) || defined(__ARM_NEON__)
44+
#if defined(__AVX2__) || defined(__ARM_NEON)
4545
// Views over the input data.
4646
std::array<span<const cf_t>, MAX_PORTS> port_symbols;
4747
std::array<span<const cf_t>, MAX_PORTS> port_ests;
@@ -120,7 +120,7 @@ void equalize_zf_1xn(span<cf_t> symbols_out,
120120
// If abnormal calculation parameters are detected, the equalized symbols are set to zero.
121121
srsran_simd_cfi_storeu(symbols_out.data() + i_re, srsran_simd_cf_select(cf_zero, re_out, isnormal_mask));
122122
}
123-
#endif // __AVX2__ || __ARM_NEON__
123+
#endif // __AVX2__ || __ARM_NEON
124124

125125
for (; i_re != nof_re; ++i_re) {
126126
float ch_mod_sq = 0.0F;

lib/phy/upper/log_likelihood_ratio.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
#ifdef __AVX2__
1717
#include <immintrin.h>
1818
#endif // __AVX2__
19-
#ifdef __ARM_NEON__
19+
#ifdef __ARM_NEON
2020
#include <arm_neon.h>
21-
#endif // __ARM_NEON__
21+
#endif // __ARM_NEON
2222

2323
using namespace srsran;
2424

@@ -160,7 +160,7 @@ static void hard_decision_simd(bit_buffer& hard_bits, const int8_t* soft_bits, u
160160
}
161161
#endif // __AVX2__
162162

163-
#ifdef __ARM_NEON__
163+
#ifdef __ARM_NEON
164164
static void hard_decision_simd(bit_buffer& hard_bits, const int8_t* soft_bits, unsigned len)
165165
{
166166
const uint8x16_t mask_msb_u8 = vdupq_n_u8(0x80);
@@ -209,7 +209,7 @@ static void hard_decision_simd(bit_buffer& hard_bits, const int8_t* soft_bits, u
209209
hard_bits.insert(hard_bit, i_bit, 1);
210210
}
211211
}
212-
#endif // __ARM_NEON__
212+
#endif // __ARM_NEON
213213

214214
bool srsran::hard_decision(bit_buffer& hard_bits, span<const log_likelihood_ratio> soft_bits)
215215
{
@@ -221,7 +221,7 @@ bool srsran::hard_decision(bit_buffer& hard_bits, span<const log_likelihood_rati
221221

222222
unsigned nof_bits = soft_bits.size();
223223

224-
#if defined(__AVX2__) || defined(__ARM_NEON__)
224+
#if defined(__AVX2__) || defined(__ARM_NEON)
225225

226226
hard_decision_simd(hard_bits, reinterpret_cast<const int8_t*>(soft_bits.data()), nof_bits);
227227

@@ -233,7 +233,7 @@ bool srsran::hard_decision(bit_buffer& hard_bits, span<const log_likelihood_rati
233233
// Insert into the bit buffer.
234234
hard_bits.insert(hard_bit, i_bit, 1);
235235
}
236-
#endif // __AVX2__ or __ARM_NEON__
236+
#endif // __AVX2__ or __ARM_NEON
237237

238238
// Return false if it finds a zero in the soft bits.
239239
return srsvec::find(soft_bits, log_likelihood_ratio(0)) == soft_bits.end();

lib/srsvec/compare.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const char* srsran::srsvec::detail::find(span<const char> input, const char* val
3838
}
3939
#endif // __AVX2__
4040

41-
#ifdef __ARM_NEON__
41+
#ifdef __ARM_NEON
4242
bool found = false;
4343
// Advances the input index to either the first SIMD word that contains value or the last index rounded to 16.
4444
for (unsigned simd_index_end = 16 * (input.size() / 16); index != simd_index_end; index += 16) {
@@ -63,7 +63,7 @@ const char* srsran::srsvec::detail::find(span<const char> input, const char* val
6363
break;
6464
}
6565
}
66-
#endif // __ARM_NEON__
66+
#endif // __ARM_NEON
6767

6868
// Keeps iterating from the current index to the end.
6969
for (; index != input.size(); ++index) {

0 commit comments

Comments
 (0)