Skip to content

Commit 528d493

Browse files
committed
Resync
1 parent 8f1ee60 commit 528d493

6 files changed

Lines changed: 365 additions & 435 deletions

File tree

audio/conversion/float_to_s16.c

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,11 @@ void convert_float_to_s16(int16_t *s, const float *in, size_t len)
109109
_mm_storeu_si128((__m128i *)s, packed); /* Then put the result in the output array */
110110
}
111111

112-
len = len - i;
112+
len -= i;
113113
i = 0;
114114
/* If there are any stray samples at the end, we need to convert them
115115
* (maybe the original array didn't contain a multiple of 8 samples) */
116116
#elif defined(__ALTIVEC__)
117-
int samples_in = len;
118-
119117
/* Unaligned loads/store is a bit expensive,
120118
* so we optimize for the good path (very likely). */
121119
if (((uintptr_t)s & 15) + ((uintptr_t)in & 15) == 0)
@@ -130,20 +128,11 @@ void convert_float_to_s16(int16_t *s, const float *in, size_t len)
130128
vec_st(vec_packs(result0, result1), 0, s);
131129
}
132130

133-
samples_in -= i;
131+
len -= i;
134132
}
135133

136-
len = samples_in;
137134
i = 0;
138135
#elif defined(_MIPS_ARCH_ALLEGREX)
139-
#ifdef DEBUG
140-
/* Make sure the buffers are 16 byte aligned, this should be
141-
* the default behaviour of malloc in the PSPSDK.
142-
* Assume alignment. */
143-
retro_assert(((uintptr_t)in & 0xf) == 0);
144-
retro_assert(((uintptr_t)s & 0xf) == 0);
145-
#endif
146-
147136
for (i = 0; i + 8 <= len; i += 8)
148137
{
149138
__asm__ (

audio/conversion/s16_to_float.c

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,9 @@ void convert_s16_to_float(float *s,
111111
_mm_storeu_ps(s + 4, output_r);
112112
}
113113

114-
len = len - i;
114+
len -= i;
115115
i = 0;
116116
#elif defined(__ALTIVEC__)
117-
size_t samples_in = len;
118-
119117
/* Unaligned loads/store is a bit expensive, so we
120118
* optimize for the good path (very likely). */
121119
if (((uintptr_t)s & 15) + ((uintptr_t)in & 15) == 0)
@@ -135,23 +133,15 @@ void convert_s16_to_float(float *s,
135133
vec_st(out_lo, 16, s);
136134
}
137135

138-
samples_in -= i;
136+
len -= i;
139137
}
140138

141-
len = samples_in;
142139
i = 0;
143140
#endif
144141

145142
gain /= 0x8000;
146143

147144
#if defined(_MIPS_ARCH_ALLEGREX)
148-
#ifdef DEBUG
149-
/* Make sure the buffer is 16 byte aligned, this should be the
150-
* default behaviour of malloc in the PSPSDK.
151-
* Only the output buffer can be assumed to be 16-byte aligned. */
152-
retro_assert(((uintptr_t)s & 0xf) == 0);
153-
#endif
154-
155145
__asm__ (
156146
".set push \n"
157147
".set noreorder \n"

0 commit comments

Comments
 (0)