Skip to content

Commit

Permalink
Fixed ARM NEON as per x86 SSE4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
TexZK committed Mar 30, 2024
1 parent 5a69817 commit 0000b85
Show file tree
Hide file tree
Showing 3 changed files with 483 additions and 281 deletions.
8 changes: 4 additions & 4 deletions include/aymo_ymf262_arm_neon.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ struct aymo_(conn) {

// TODO: move reg queue outside YMF262
#ifndef AYMO_YMF262_ARM_NEON_REG_QUEUE_LENGTH
#define AYMO_YMF262_ARM_NEON_REG_QUEUE_LENGTH 256
#define AYMO_YMF262_ARM_NEON_REG_QUEUE_LENGTH 1024
#endif
#ifndef AYMO_YMF262_ARM_NEON_REG_QUEUE_LATENCY
#define AYMO_YMF262_ARM_NEON_REG_QUEUE_LATENCY 2
Expand Down Expand Up @@ -163,6 +163,7 @@ struct aymo_(slot_group) {

#ifdef AYMO_DEBUG
// Variables for debug
vi16x8_t eg_tl_x4;
vi16x8_t eg_ksl;
vi16x8_t eg_rate;
vi16x8_t eg_inc;
Expand All @@ -181,7 +182,6 @@ struct aymo_(ch2x_group) {

// Updated only by writing registers
vi16x8_t eg_ksv;

vi16x8_t og_ch_gate_a;
vi16x8_t og_ch_gate_b;
vi16x8_t og_ch_gate_c;
Expand Down Expand Up @@ -304,7 +304,7 @@ int aymo_(sgi_to_cgi)(int sgi)
static inline
int8_t aymo_(addr_to_slot)(uint16_t address)
{
uint16_t subaddr = ((address & 0x1F) | ((address >> 8) & 1));
unsigned subaddr = ((address & 0x1Fu) | ((address >> 3u) & 0x20u));
int8_t slot = aymo_ymf262_subaddr_to_slot[subaddr];
return slot;
}
Expand All @@ -314,7 +314,7 @@ int8_t aymo_(addr_to_slot)(uint16_t address)
static inline
int8_t aymo_(addr_to_ch2x)(uint16_t address)
{
uint16_t subaddr = ((address & 0x0F) | ((address >> 8) & 1));
unsigned subaddr = ((address & 0x0Fu) | ((address >> 4u) & 0x10u));
int8_t ch2x = aymo_ymf262_subaddr_to_ch2x[subaddr];
return ch2x;
}
Expand Down
Loading

0 comments on commit 0000b85

Please sign in to comment.