Compare commits

...

4 Commits

Author SHA1 Message Date
Lephe a4d23ef7ad
libc: faster memset 2020-07-28 17:34:25 +02:00
Lephe 492f61f7b2
libc: faster memcpy for on-chip memory
An optimization suggested by TSWilliamson, which pushes not only RAM,
but also on-chip memory and the CPU pipeline to their limits.
2020-07-27 22:47:30 +02:00
Lephe 7b4eb078c4
move src/core to src/kernel 2020-07-26 11:49:33 +02:00
Lephe d12be8add0
remove features that are deprecated as of v2.1 2020-07-26 11:47:23 +02:00
20 changed files with 48 additions and 44 deletions

5
TODO
View File

@ -1,8 +1,3 @@
For the 2.1.0 release:
* bopti: remove the deprecated image_t definition
* project: remove the compat branch
* project: remove the gray aliases
Extensions on existing code:
* tmu: make interrupt handlers more elegant
* bopti: try to display fullscreen images with TLB access + DMA on fxcg50

View File

@ -83,10 +83,6 @@ typedef struct
} GPACKED(4) bopti_image_t;
/* Old alias to image_t, now deprecated because of libimg */
typedef bopti_image_t image_t __attribute__((deprecated(
"image_t has been renamed to bopti_image_t")));
#endif /* FX9860G */
#endif /* GINT_DISPLAY_FX */

View File

@ -144,34 +144,4 @@ void dgray_getdelays(uint32_t *light, uint32_t *dark);
These pointers can be used for custom rendering functions. */
void dgray_getvram(uint32_t **light, uint32_t **dark);
//---
// Aliases for older programs
//---
/* Functions for the gray engine used to be called g*() to mirror the d*()
functions of the display module. They are now bundled together, so these
aliases are for older programs that still use the g*() naming scheme */
#ifdef GINT_GRAY_ALIASES
#define gclear dclear
#define grect drect
#define gpixel dpixel
#define gline dline
#define ghline dhline
#define gvline dvline
#define gimage dimage
#define gsubimage dsubimage
#define gtext dtext
#define gtext_opt dtext_opt
#define gprint dprint
#define gprint_opt dprint_opt
#define gupdate dupdate
#define gray_delays dgray_setdelays
#define gray_config dgray_getdelays
#define gvram dgray_getvram
#endif /* GINT_GRAY_ALIASES */
#endif /* GINT_GRAY */

View File

@ -24,7 +24,7 @@ _memcpy_align_dst:
/* If source is 4-aligned, use mov.l */
tst r2, r5
bt/s .aligned4
bt/s .aligned4_32
mov #4, r2
/* If unaligned but SH4, use movua.l */
@ -42,13 +42,40 @@ _memcpy_align_dst:
bra _naive_memcpy
nop
.aligned4:
.aligned4_32:
mov #36, r2
/* Copy 32 bytes at a time until at most 32 bytes are left */
mov.l @r5+, r0
mov.l @r5+, r1
mov.l @r5+, r7
mov.l r0, @r4
mov.l r1, @(4,r4)
mov.l r7, @(8,r4)
mov.l @r5+, r0
mov.l @r5+, r1
mov.l @r5+, r7
mov.l r0, @(12,r4)
mov.l r1, @(16,r4)
mov.l r7, @(20,r4)
mov.l @r5+, r0
mov.l @r5+, r1
add #-32, r6
mov.l r0, @(24,r4)
mov.l r1, @(28,r4)
cmp/ge r6, r2
bf/s .aligned4_32
add #32, r4
.aligned4_4:
mov #4, r2
/* Copy 4 bytes at a time until at most 4 bytes are left */
mov.l @r5+, r0
mov.l r0, @r4
add #-4, r6
cmp/ge r6, r2
bf/s .aligned4
bf/s .aligned4_4
add #4, r4
bra _naive_memcpy

View File

@ -31,12 +31,28 @@ _memset_align:
bf/s _memset_align
dt r6
mov #40, r2
.aligned4_32:
add #-32, r4
add #-32, r6
mov.l r0, @(28,r4)
mov.l r0, @(24,r4)
mov.l r0, @(20,r4)
mov.l r0, @(16,r4)
mov.l r0, @(12,r4)
mov.l r0, @(8,r4)
mov.l r0, @(4,r4)
cmp/ge r6, r2
bf/s .aligned4_32
mov.l r0, @r4
mov #8, r2
.aligned4:
.aligned4_4:
mov.l r0, @-r4
cmp/ge r6, r2
bf/s .aligned4
bf/s .aligned4_4
add #-4, r6
_naive_memset: