Browse Source

fw: allow gcc to optimize memset, memcpy, and memmove

Use __builtin macros to enable memset/memcpy/memmove optimizations;
especially useful for small operations like structure zeroing.
H. Peter Anvin 3 years ago
parent
commit
6b1989fac8

BIN
fpga/output_files/max80.jbc


BIN
fpga/output_files/max80.jic


BIN
fpga/output_files/max80.pof


BIN
fpga/output_files/max80.sof


+ 2 - 2
fw/boot.mif

@@ -3646,8 +3646,8 @@ CONTENT BEGIN
 0E37 : 20353120;
 0E38 : 31323032;
 0E39 : 3A333220;
-0E3A : 333A3431;
-0E3B : 000A0A30;
+0E3A : 353A3732;
+0E3B : 000A0A35;
 0E3C : 61636473;
 0E3D : 725F6472;
 0E3E : 5F646165;

+ 5 - 0
fw/fw.h

@@ -8,6 +8,11 @@
 #include "picorv32.h"
 #include "irq.h"
 
+/* Use builtin memcpy and memset optimizations */
+#define memset(s,c,n)	__builtin_memset(s,c,n)
+#define memcpy(d,s,n)	__builtin_memcpy(d,s,n)
+#define memmove(d,s,n)	__builtin_memmove(d,s,n)
+
 #define likely(x)	__builtin_expect(!!(x), 1)
 #define unlikely(x)	__builtin_expect(!!(x), 0)