First-level of support for new aarch64 machines
Testing on Neoverse N1 (Ampere 3GHz). Tested only on a subset of phy-simulators. - Changes: - use SIMDE consistently - adaptations of LDPC decoder generator for ARMv8 performance - SIMDe modifications of Intel CRC to allow for aarch64 build. optimizations for 128-bit to improve performance of LDPC encode/decode on aarch64 (Neoverse 1) - added BG2 files for 128-bit ldpc encoder (aarch64) - testing on Xeon - testing on x86 - minor changes to build/run on x86 - change in crc.h after returning to aarch64 - removed some warning in ldpc decoder generator for x86_64 - char - Delete irrelevant constants - Correctly declare variables - Define stdbool for all architectures - Remove definition of _MM_SHUFFLE and use SIMDE_MM_SHUFFLE - Remove commented code - Fix CMakeLists.txt - Include SIMDE avx2 functions in tools_defs.h
This commit is contained in:
committed by
Robert Schmidt
parent
79fd37b489
commit
a7bc282302
@@ -588,24 +588,7 @@ int main(int argc, char **argv) {
|
||||
nfapi_tx_request_t TX_req;
|
||||
Sched_Rsp_t sched_resp;
|
||||
int pa=dB0;
|
||||
#if defined(__arm__) || defined(__aarch64__)
|
||||
FILE *proc_fd = NULL;
|
||||
char buf[64];
|
||||
memset(buf,0,sizeof(buf));
|
||||
proc_fd = fopen("/sys/devices/system/cpu/cpu4/cpufreq/cpuinfo_cur_freq", "r");
|
||||
|
||||
if(!proc_fd)
|
||||
printf("cannot open /sys/devices/system/cpu/cpu4/cpufreq/cpuinfo_cur_freq");
|
||||
else {
|
||||
while(fgets(buf, 63, proc_fd))
|
||||
printf("%s", buf);
|
||||
}
|
||||
|
||||
fclose(proc_fd);
|
||||
cpu_freq_GHz = ((double)atof(buf))/1e6;
|
||||
#else
|
||||
cpu_freq_GHz = get_cpu_freq_GHz();
|
||||
#endif
|
||||
printf("Detected cpu_freq %f GHz\n",cpu_freq_GHz);
|
||||
memset((void *)&sched_resp,0,sizeof(sched_resp));
|
||||
sched_resp.DL_req = &DL_req;
|
||||
|
||||
@@ -276,7 +276,7 @@ int NB_UE_INST = 1;
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
setbuf(stdout, NULL);
|
||||
char c;
|
||||
int c;
|
||||
int i,aa;//,l;
|
||||
double sigma2, sigma2_dB=10, SNR, snr0=-2.0, snr1=2.0;
|
||||
uint8_t snr1set=0;
|
||||
|
||||
@@ -151,10 +151,10 @@ openair0_config_t openair0_cfg[MAX_CARDS];
|
||||
channel_desc_t *UE2gNB[NUMBER_OF_UE_MAX][NUMBER_OF_gNB_MAX];
|
||||
int NB_UE_INST = 1;
|
||||
|
||||
int main(int argc, char **argv)
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
|
||||
char c;
|
||||
int c;
|
||||
int i;
|
||||
double SNR, snr0 = -2.0, snr1 = 2.0;
|
||||
double sigma, sigma_dB;
|
||||
@@ -233,7 +233,7 @@ int main(int argc, char **argv)
|
||||
randominit(0);
|
||||
|
||||
/* initialize the sin-cos table */
|
||||
InitSinLUT();
|
||||
InitSinLUT();
|
||||
|
||||
while ((c = getopt(argc, argv, "a:b:c:d:ef:g:h:i:kl:m:n:op:q:r:s:t:u:v:w:y:z:C:F:G:H:I:M:N:PR:S:T:U:L:ZW:E:")) != -1) {
|
||||
printf("handling optarg %c\n",c);
|
||||
|
||||
@@ -51,12 +51,13 @@ void __attribute__ ((no_sanitize_address)) multipath_channel(channel_desc_t *des
|
||||
|
||||
int i,ii,j,l;
|
||||
int length1, length2, tail;
|
||||
__m128d rx_tmp128_re_f,rx_tmp128_im_f,rx_tmp128_re,rx_tmp128_im, rx_tmp128_1,rx_tmp128_2,rx_tmp128_3,rx_tmp128_4,tx128_re,tx128_im,ch128_x,ch128_y,pathloss128;
|
||||
simde__m128d rx_tmp128_re_f, rx_tmp128_im_f, rx_tmp128_re, rx_tmp128_im, rx_tmp128_1, rx_tmp128_2, rx_tmp128_3, rx_tmp128_4,
|
||||
tx128_re, tx128_im, ch128_x, ch128_y, pathloss128;
|
||||
|
||||
double path_loss = pow(10,desc->path_loss_dB/20);
|
||||
int dd = abs(desc->channel_offset);
|
||||
|
||||
pathloss128 = _mm_set1_pd(path_loss);
|
||||
pathloss128 = simde_mm_set1_pd(path_loss);
|
||||
|
||||
#ifdef DEBUG_CH
|
||||
printf("[CHANNEL] keep = %d : path_loss = %g (%f), nb_rx %d, nb_tx %d, dd %d, len %d \n",keep_channel,path_loss,desc->path_loss_dB,desc->nb_rx,desc->nb_tx,dd,desc->channel_length);
|
||||
@@ -92,44 +93,44 @@ void __attribute__ ((no_sanitize_address)) multipath_channel(channel_desc_t *des
|
||||
for (ii=0; ii<desc->nb_rx; ii++) {
|
||||
// rx_tmp.x = 0;
|
||||
// rx_tmp.y = 0;
|
||||
rx_tmp128_re_f = _mm_setzero_pd();
|
||||
rx_tmp128_im_f = _mm_setzero_pd();
|
||||
rx_tmp128_re_f = simde_mm_setzero_pd();
|
||||
rx_tmp128_im_f = simde_mm_setzero_pd();
|
||||
|
||||
for (j=0; j<desc->nb_tx; j++) {
|
||||
for (l = 0; l<(int)desc->channel_length; l++) {
|
||||
if ((i>=0) && (i-l)>=0) { //SIMD correct only if length1 > 2*channel_length...which is almost always satisfied
|
||||
// tx.x = tx_sig_re[j][i-l];
|
||||
// tx.y = tx_sig_im[j][i-l];
|
||||
tx128_re = _mm_loadu_pd(&tx_sig_re[j][2*i-l]); // tx_sig_re[j][i-l+1], tx_sig_re[j][i-l]
|
||||
tx128_im = _mm_loadu_pd(&tx_sig_im[j][2*i-l]);
|
||||
tx128_re = simde_mm_loadu_pd(&tx_sig_re[j][2 * i - l]); // tx_sig_re[j][i-l+1], tx_sig_re[j][i-l]
|
||||
tx128_im = simde_mm_loadu_pd(&tx_sig_im[j][2 * i - l]);
|
||||
} else {
|
||||
//tx.x =0;
|
||||
//tx.y =0;
|
||||
tx128_re = _mm_setzero_pd();
|
||||
tx128_im = _mm_setzero_pd();
|
||||
tx128_re = simde_mm_setzero_pd();
|
||||
tx128_im = simde_mm_setzero_pd();
|
||||
}
|
||||
|
||||
ch128_x = _mm_set1_pd(desc->ch[ii+(j*desc->nb_rx)][l].x);
|
||||
ch128_y = _mm_set1_pd(desc->ch[ii+(j*desc->nb_rx)][l].y);
|
||||
ch128_x = simde_mm_set1_pd(desc->ch[ii + (j * desc->nb_rx)][l].x);
|
||||
ch128_y = simde_mm_set1_pd(desc->ch[ii + (j * desc->nb_rx)][l].y);
|
||||
// rx_tmp.x += (tx.x * desc->ch[ii+(j*desc->nb_rx)][l].x) - (tx.y * desc->ch[ii+(j*desc->nb_rx)][l].y);
|
||||
// rx_tmp.y += (tx.y * desc->ch[ii+(j*desc->nb_rx)][l].x) + (tx.x * desc->ch[ii+(j*desc->nb_rx)][l].y);
|
||||
rx_tmp128_1 = _mm_mul_pd(tx128_re,ch128_x);
|
||||
rx_tmp128_2 = _mm_mul_pd(tx128_re,ch128_y);
|
||||
rx_tmp128_3 = _mm_mul_pd(tx128_im,ch128_x);
|
||||
rx_tmp128_4 = _mm_mul_pd(tx128_im,ch128_y);
|
||||
rx_tmp128_re = _mm_sub_pd(rx_tmp128_1,rx_tmp128_4);
|
||||
rx_tmp128_im = _mm_add_pd(rx_tmp128_2,rx_tmp128_3);
|
||||
rx_tmp128_re_f = _mm_add_pd(rx_tmp128_re_f,rx_tmp128_re);
|
||||
rx_tmp128_im_f = _mm_add_pd(rx_tmp128_im_f,rx_tmp128_im);
|
||||
rx_tmp128_1 = simde_mm_mul_pd(tx128_re, ch128_x);
|
||||
rx_tmp128_2 = simde_mm_mul_pd(tx128_re, ch128_y);
|
||||
rx_tmp128_3 = simde_mm_mul_pd(tx128_im, ch128_x);
|
||||
rx_tmp128_4 = simde_mm_mul_pd(tx128_im, ch128_y);
|
||||
rx_tmp128_re = simde_mm_sub_pd(rx_tmp128_1, rx_tmp128_4);
|
||||
rx_tmp128_im = simde_mm_add_pd(rx_tmp128_2, rx_tmp128_3);
|
||||
rx_tmp128_re_f = simde_mm_add_pd(rx_tmp128_re_f, rx_tmp128_re);
|
||||
rx_tmp128_im_f = simde_mm_add_pd(rx_tmp128_im_f, rx_tmp128_im);
|
||||
} //l
|
||||
} // j
|
||||
|
||||
//rx_sig_re[ii][i+dd] = rx_tmp.x*path_loss;
|
||||
//rx_sig_im[ii][i+dd] = rx_tmp.y*path_loss;
|
||||
rx_tmp128_re_f = _mm_mul_pd(rx_tmp128_re_f,pathloss128);
|
||||
rx_tmp128_im_f = _mm_mul_pd(rx_tmp128_im_f,pathloss128);
|
||||
_mm_storeu_pd(&rx_sig_re[ii][2*i+dd],rx_tmp128_re_f); // max index: length-dd -1 + dd = length -1
|
||||
_mm_storeu_pd(&rx_sig_im[ii][2*i+dd],rx_tmp128_im_f);
|
||||
rx_tmp128_re_f = simde_mm_mul_pd(rx_tmp128_re_f, pathloss128);
|
||||
rx_tmp128_im_f = simde_mm_mul_pd(rx_tmp128_im_f, pathloss128);
|
||||
simde_mm_storeu_pd(&rx_sig_re[ii][2 * i + dd], rx_tmp128_re_f); // max index: length-dd -1 + dd = length -1
|
||||
simde_mm_storeu_pd(&rx_sig_im[ii][2 * i + dd], rx_tmp128_im_f);
|
||||
/*
|
||||
if ((ii==0)&&((i%32)==0)) {
|
||||
printf("%p %p %f,%f => %e,%e\n",rx_sig_re[ii],rx_sig_im[ii],rx_tmp.x,rx_tmp.y,rx_sig_re[ii][i-dd],rx_sig_im[ii][i-dd]);
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
|
||||
#include "assertions.h"
|
||||
|
||||
extern void print_shorts(char *s,__m128i *x);
|
||||
extern void print_shorts(char *s,simde__m128i *x);
|
||||
static mapping channelmod_names[] = {
|
||||
CHANNELMOD_MAP_INIT
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user