I've digged in the code of krom and see something that make me curious: The whole code is in asm.
I just want to know: ZSNES is now umaintenable because it has everything wrote in asm. Don't you think it could be the same for Cen64 in the futur? Don't you think their could be the main (easy to read) code in C and the SSE one at the same place but in another ifdef part?
I just ask. I wouldn't see Cen64 unmaintained in the futur because of this.

Another point: Is there any reason why you don't use const statement? In many places it would make the code easier to read and apply the const correctness principle. Example:
Code: Select all
8 static inline uint16_t fpu_add_32(
9 uint32_t *fs, uint32_t *ft, uint32_t *fd) {
10 uint32_t res;
11 uint16_t sw;
12
13 __asm__ volatile(
14 "fclex\n\t"
15 "flds %2\n\t"
16 "flds %3\n\t"
17 "faddp\n\t"
18 "fstps %1\n\t"
19 "fstsw %%ax\n\t"
20
21 : "=a" (sw),
22 "=m" (res)
23 : "m" (*fs),
24 "m" (*ft)
25 : "st"
26 );
27
28 *fd = res;
29 return sw;
30 }
Code: Select all
8 static inline uint16_t fpu_add_32(
9 const uint32_t *fs, const uint32_t *ft, uint32_t *fd) {
10 uint32_t res;
11 uint16_t sw;
12
13 __asm__ volatile(
14 "fclex\n\t"
15 "flds %2\n\t"
16 "flds %3\n\t"
17 "faddp\n\t"
18 "fstps %1\n\t"
19 "fstsw %%ax\n\t"
20
21 : "=a" (sw),
22 "=m" (res)
23 : "m" (*fs),
24 "m" (*ft)
25 : "st"
26 );
27
28 *fd = res;
29 return sw;
30 }
Am I right on this or completely wrong? Is there any good reason to don't use const?
Sorry for my silly questions, I try to understand this (well written while quite complex) code.
Thanks in advance!