diff options
author | Stafford Horne <shorne@gmail.com> | 2022-01-22 05:32:38 +0100 |
---|---|---|
committer | Stafford Horne <shorne@gmail.com> | 2022-05-23 10:15:49 +0200 |
commit | 87e387acd8eba5021a8e5d6b54e0c5ef5c28ada2 (patch) | |
tree | 5073239e1497fd507ca83012b847334b651a6411 /arch/openrisc/Makefile | |
parent | openrisc: define nop command for simulator reboot (diff) | |
download | linux-87e387acd8eba5021a8e5d6b54e0c5ef5c28ada2.tar.xz linux-87e387acd8eba5021a8e5d6b54e0c5ef5c28ada2.zip |
openrisc: Add gcc machine instruction flag configuration
OpenRISC GCC supports flags to enable the backend to output instructions
if they are supported by a target processor. This patch adds
configuration flags to enable configuring these flags to tune the kernel
for a particular CPU configuration.
In the future we could also enable all of these flags by default and
provide instruction emulation in the kernel to make these choices easier
for users but this is what we provide for now.
Signed-off-by: Stafford Horne <shorne@gmail.com>
Diffstat (limited to 'arch/openrisc/Makefile')
-rw-r--r-- | arch/openrisc/Makefile | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/arch/openrisc/Makefile b/arch/openrisc/Makefile index 760b734fb822..b446510173cd 100644 --- a/arch/openrisc/Makefile +++ b/arch/openrisc/Makefile @@ -21,6 +21,7 @@ OBJCOPYFLAGS := -O binary -R .note -R .comment -S LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name) KBUILD_CFLAGS += -pipe -ffixed-r10 -D__linux__ +KBUILD_CFLAGS += -msfimm -mshftimm all: vmlinux.bin @@ -38,6 +39,22 @@ else KBUILD_CFLAGS += $(call cc-option,-msoft-div) endif +ifeq ($(CONFIG_OPENRISC_HAVE_INST_CMOV),y) + KBUILD_CFLAGS += $(call cc-option,-mcmov) +endif + +ifeq ($(CONFIG_OPENRISC_HAVE_INST_ROR),y) + KBUILD_CFLAGS += $(call cc-option,-mror) +endif + +ifeq ($(CONFIG_OPENRISC_HAVE_INST_RORI),y) + KBUILD_CFLAGS += $(call cc-option,-mrori) +endif + +ifeq ($(CONFIG_OPENRISC_HAVE_INST_SEXT),y) + KBUILD_CFLAGS += $(call cc-option,-msext) +endif + head-y := arch/openrisc/kernel/head.o libs-y += $(LIBGCC) |