Skip to contentSkip to conversation

package/coremark: port for mips-i6500

PATCH Andreas Ziegler 2 participants 3 messages Feb 4 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Hi Jimmy, all

[add Chris Packham -> DEVELOPERS file]

This change is normally something that would be handled in a private overlay (e.g. BR2_EXTERNAL). Also Buildroot will never pick up these modifications, unless you also add logic to package/coremark/coremark.mk.

More remarks below:

Quoted 30 lines · Jimmy Durand Wesolowski

Compile for MIPS I6500 CPU 64-bit, with all compiler flags as recommended by MIPS

One missing flag -s "-Tmsym32.ld" since linker script "msym32.ld" does not exist in the MIPS toolchain

---
 .../0001-skeleton-for-mips-i6500.patch        | 804 ++++++++++++++++++
 ...iler-flags-customized-for-mips-i6500.patch |  35 +
 2 files changed, 839 insertions(+)
 create mode 100644 package/coremark/0001-skeleton-for-mips-i6500.patch
 create mode 100644 

package/coremark/0002-Compiler-flags-customized-for-mips-i6500.patch

package/coremark/0001-skeleton-for-mips-i6500.patch new file +7 -0
new file mode 100644
index 0000000000..e71dc980c8
@@ -0,0 +1,804 @@
+From c8f187ca290e65f9d6b14ef5ad57fa61f7f8b95f Mon Sep 17 00:00:00 2001
+From: Vladimir Kondratiev <[email protected]>
+Date: Wed, 27 Feb 2019 09:55:55 +0200
+Subject: [PATCH 1/2] skeleton for mips i6500
+
+port for mips-i6500 created, copied from linux64
+

package/coremark/0001-skeleton-for-mips-i6500.patch line 17

Quoted 10 lines
package/coremark/0001-skeleton-for-mips-i6500.patch new file +10 -0
+Signed-off-by: Vladimir Kondratiev <[email protected]>
+---
+ mips-i6500/core_portme.c   | 336 
+++++++++++++++++++++++++++++++++++++
+ mips-i6500/core_portme.h   | 291 ++++++++++++++++++++++++++++++++
+ mips-i6500/core_portme.mak | 140 ++++++++++++++++
+ 3 files changed, 767 insertions(+)
+ create mode 100755 mips-i6500/core_portme.c
+ create mode 100755 mips-i6500/core_portme.h
+ create mode 100755 mips-i6500/core_portme.mak

A more elegant way to create the baseline would be to add an appropriate rsync command to COREMARK_POST_EXTRACT_HOOKS.

<patch body removed>

Quoted 28 lines
(quoted diff) +0 -0
new file mode 100644
index 0000000000..1fdef1f300

b/package/coremark/0002-Compiler-flags-customized-for-mips-i6500.patch

(quoted diff) +18 -0
@@ -0,0 +1,35 @@
+From 59542343c82a936326345455036d33ba30a646c5 Mon Sep 17 00:00:00 2001
+From: Vladimir Kondratiev <[email protected]>
+Date: Wed, 27 Feb 2019 10:05:52 +0200
+Subject: [PATCH 2/2] Compiler flags customized for mips-i6500
+
+Signed-off-by: Vladimir Kondratiev <[email protected]>
+---
+ mips-i6500/core_portme.mak | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/mips-i6500/core_portme.mak b/mips-i6500/core_portme.mak
+index 5cfabee32658..8e0ac11d7854 100755
+--- a/mips-i6500/core_portme.mak
++++ b/mips-i6500/core_portme.mak
+@@ -24,13 +24,16 @@ OUTFLAG= -o
+ CC = gcc
+ # Flag: CFLAGS
+ #	Use this flag to define compiler options. Note, you can add 

compiler options from the command line using XCFLAGS="other flags"

+-PORT_CFLAGS = -O2
++PORT_CFLAGS := -DRTELinux -DITERATIONS=0 -DUSE_PTHREAD  

Review

Quoted 5 lines
(quoted diff) +2 -3
-DMULTITHREAD=4
++PORT_CFLAGS += -O3 -funroll-all-loops -falign-jumps=16 
-falign-loops=16 -falign-functions=16 -finline-functions 
-finline-limit=1000
++PORT_CFLAGS += -fgcse-sm -fgcse-las -EL -mtune=i6500 -mabi=64 -mmsa

Why not use the project's CFLAGS? You might always wonder why the rest of the stuff is so much slower than the coremark score suggests ...

Quoted 6 lines

+ FLAGS_STR = "$(PORT_CFLAGS) $(XCFLAGS) $(XLFLAGS) $(LFLAGS_END)"
+ CFLAGS = $(PORT_CFLAGS) -I$(PORT_DIR) -I. -DFLAGS_STR=\"$(FLAGS_STR)\"
+ #Flag: LFLAGS_END
+ # Define any libraries needed for linking or other flags that should
come at the end of the link line (e.g. linker scripts).

Quoted 8 lines

+ # Note: On certain platforms, the default clock_gettime
implementation is supported but requires linking of librt. +-LFLAGS_END += -lrt
++LFLAGS_END += -lrt -lpthread -static ++#-Tmsym32.ld
+ # Flag: PORT_SRCS
+ # Port specific source files can be added here
+ PORT_SRCS = $(PORT_DIR)/core_portme.c

Shouldn't pthread and static normally come from the Buildroot configuration?

Unless the sequence of library includes is significant (PORT_CFLAGS ... LFLAGS_END), you might just override PORT_CFLAGS and be done.

COREMARK_CFLAGS = \
	$(TARGET_CFLAGS) \
	-DUSE_CLOCK=1 \
	-DMEM_LOCATION='\"initramfs\"'

define COREMARK_BUILD_CMDS

	$(TARGET_MAKE_ENV) $(MAKE) CC="$(TARGET_CC)" -C $(@D) \
		PORT_CFLAGS="$(COREMARK_CFLAGS)" \
		PORT_DIR=linux EXE= link

endef

Quoted 4 lines

+--
+2.19.1
--
2.43.0

Kind regards,
Andreas
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#2 lore raw

Hi Andreas,

Thank you very much for the review, and I am sorry for the terrible format, Office does not allow proper inline answering.

We are indeed using a BR2_EXTERNAL, but we are in the process of upstreaming. However, you are absolutely right, I did not pay attention to the patch itself, and that makes my Acked-By more than a mistake.
I will adapt according to your comments and resend once fixed.

Thank you again.
Best regards,

________________________________________
From: Andreas Ziegler <[email protected]>
Sent: 04 February 2026 13:35
To: Jimmy Wesolowski
Cc: buildroot; Guenther Harrasser; Vladimir Kondratiev; Chris Packham
Subject: Re: [PATCH] package/coremark: port for mips-i6500

EXTERNAL EMAIL: Do not click any links or open any attachments unless you trust the sender and know the content is safe.

Hi Jimmy, all

[add Chris Packham -> DEVELOPERS file]

This change is normally something that would be handled in a private overlay (e.g. BR2_EXTERNAL). Also Buildroot will never pick up these modifications, unless you also add logic to package/coremark/coremark.mk.

More remarks below:

Quoted 31 lines · Jimmy Durand Wesolowski

Compile for MIPS I6500 CPU 64-bit, with all compiler flags as recommended by MIPS

One missing flag -s "-Tmsym32.ld" since linker script "msym32.ld" does not exist in the MIPS toolchain

---
 .../0001-skeleton-for-mips-i6500.patch        | 804 ++++++++++++++++++
 ...iler-flags-customized-for-mips-i6500.patch |  35 +
 2 files changed, 839 insertions(+)
 create mode 100644 package/coremark/0001-skeleton-for-mips-i6500.patch
 create mode 100644

package/coremark/0002-Compiler-flags-customized-for-mips-i6500.patch

package/coremark/0001-skeleton-for-mips-i6500.patch new file +7 -0
new file mode 100644
index 0000000000..e71dc980c8
@@ -0,0 +1,804 @@
+From c8f187ca290e65f9d6b14ef5ad57fa61f7f8b95f Mon Sep 17 00:00:00 2001
+From: Vladimir Kondratiev <[email protected]>
+Date: Wed, 27 Feb 2019 09:55:55 +0200
+Subject: [PATCH 1/2] skeleton for mips i6500
+
+port for mips-i6500 created, copied from linux64
+

package/coremark/0001-skeleton-for-mips-i6500.patch line 17

Quoted 10 lines
package/coremark/0001-skeleton-for-mips-i6500.patch new file +10 -0
+Signed-off-by: Vladimir Kondratiev <[email protected]>
+---
+ mips-i6500/core_portme.c   | 336
+++++++++++++++++++++++++++++++++++++
+ mips-i6500/core_portme.h   | 291 ++++++++++++++++++++++++++++++++
+ mips-i6500/core_portme.mak | 140 ++++++++++++++++
+ 3 files changed, 767 insertions(+)
+ create mode 100755 mips-i6500/core_portme.c
+ create mode 100755 mips-i6500/core_portme.h
+ create mode 100755 mips-i6500/core_portme.mak

A more elegant way to create the baseline would be to add an appropriate rsync command to COREMARK_POST_EXTRACT_HOOKS.

<patch body removed>

Quoted 30 lines

diff --git a/package/coremark/0002-Compiler-flags-customized-for-mips-i6500.patch b/package/coremark/0002-Compiler-flags-customized-for-mips-i6500.patch new file mode 100644
index 0000000000..1fdef1f300
--- /dev/null
+++
b/package/coremark/0002-Compiler-flags-customized-for-mips-i6500.patch

package/coremark/0001-skeleton-for-mips-i6500.patch new file +18 -0
@@ -0,0 +1,35 @@
+From 59542343c82a936326345455036d33ba30a646c5 Mon Sep 17 00:00:00 2001
+From: Vladimir Kondratiev <[email protected]>
+Date: Wed, 27 Feb 2019 10:05:52 +0200
+Subject: [PATCH 2/2] Compiler flags customized for mips-i6500
+
+Signed-off-by: Vladimir Kondratiev <[email protected]>
+---
+ mips-i6500/core_portme.mak | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/mips-i6500/core_portme.mak b/mips-i6500/core_portme.mak
+index 5cfabee32658..8e0ac11d7854 100755
+--- a/mips-i6500/core_portme.mak
++++ b/mips-i6500/core_portme.mak
+@@ -24,13 +24,16 @@ OUTFLAG= -o
+ CC = gcc
+ # Flag: CFLAGS
+ #   Use this flag to define compiler options. Note, you can add

compiler options from the command line using XCFLAGS="other flags" +-PORT_CFLAGS = -O2
++PORT_CFLAGS := -DRTELinux -DITERATIONS=0 -DUSE_PTHREAD

package/coremark/0001-skeleton-for-mips-i6500.patch

Quoted 5 lines
package/coremark/0001-skeleton-for-mips-i6500.patch new file +2 -3
-DMULTITHREAD=4
++PORT_CFLAGS += -O3 -funroll-all-loops -falign-jumps=16
-falign-loops=16 -falign-functions=16 -finline-functions
-finline-limit=1000
++PORT_CFLAGS += -fgcse-sm -fgcse-las -EL -mtune=i6500 -mabi=64 -mmsa

Why not use the project's CFLAGS? You might always wonder why the rest of the stuff is so much slower than the coremark score suggests ...

Quoted 6 lines

+ FLAGS_STR = "$(PORT_CFLAGS) $(XCFLAGS) $(XLFLAGS) $(LFLAGS_END)"
+ CFLAGS = $(PORT_CFLAGS) -I$(PORT_DIR) -I. -DFLAGS_STR=\"$(FLAGS_STR)\"
+ #Flag: LFLAGS_END
+ # Define any libraries needed for linking or other flags that should
come at the end of the link line (e.g. linker scripts).

Quoted 8 lines

+ # Note: On certain platforms, the default clock_gettime
implementation is supported but requires linking of librt. +-LFLAGS_END += -lrt
++LFLAGS_END += -lrt -lpthread -static ++#-Tmsym32.ld
+ # Flag: PORT_SRCS
+ # Port specific source files can be added here
+ PORT_SRCS = $(PORT_DIR)/core_portme.c

Shouldn't pthread and static normally come from the Buildroot configuration?

Unless the sequence of library includes is significant (PORT_CFLAGS ... LFLAGS_END), you might just override PORT_CFLAGS and be done.

COREMARK_CFLAGS = \
        $(TARGET_CFLAGS) \
        -DUSE_CLOCK=1 \
        -DMEM_LOCATION='\"initramfs\"'

define COREMARK_BUILD_CMDS

        $(TARGET_MAKE_ENV) $(MAKE) CC="$(TARGET_CC)" -C $(@D) \
                PORT_CFLAGS="$(COREMARK_CFLAGS)" \
                PORT_DIR=linux EXE= link

endef

Quoted 4 lines

+--
+2.19.1
--
2.43.0

Kind regards,
Andreas

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#3 lore raw

Hi Jimmy,

Quoted 10 lines · Jimmy Wesolowski

Hi Andreas,

Thank you very much for the review, and I am sorry for the terrible format, Office does not allow proper inline answering.

We are indeed using a BR2_EXTERNAL, but we are in the process of upstreaming. However, you are absolutely right, I did not pay attention to the patch itself, and that makes my Acked-By more than a mistake.
I will adapt according to your comments and resend once fixed.

No sweat, everything is fine.

Upstreaming this particular change might add significant complexity to the coremark package. The Buildroot maintainers might veto this eventually, because coremark is a rather simple package, with probably not much coverage in the community. But go ahead, I'm glad to assist and test if possible.

Quoted 4 lines

Thank you again.
Best regards,

<cut>

Kind regards,
Andreas
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot