Browse Source

ARCv2: add knob for DIV_REV in Kconfig

Being highly configurable core ARC HS among other features might be
configured with or without DIV_REM_OPTION (hardware divider).

That option when enabled adds following instructions: div, divu, rem, remu.

By default ARC HS38 has this option enabled. So we add here possibility
to disable usage of hardware divider by compiler.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Alexey Brodkin 10 years ago
parent
commit
d05a76ab4d
2 changed files with 13 additions and 1 deletions
  1. 4 0
      arch/arc/Kconfig
  2. 9 1
      arch/arc/Makefile

+ 4 - 0
arch/arc/Kconfig

@@ -379,6 +379,10 @@ config ARC_HAS_LL64
 	  dest operands with 2 possible source operands.
 	  dest operands with 2 possible source operands.
 	default y
 	default y
 
 
+config ARC_HAS_DIV_REM
+	bool "Insn: div, divu, rem, remu"
+	default y
+
 config ARC_HAS_RTC
 config ARC_HAS_RTC
 	bool "Local 64-bit r/o cycle counter"
 	bool "Local 64-bit r/o cycle counter"
 	default n
 	default n

+ 9 - 1
arch/arc/Makefile

@@ -36,8 +36,16 @@ cflags-$(atleast_gcc44)			+= -fsection-anchors
 cflags-$(CONFIG_ARC_HAS_LLSC)		+= -mlock
 cflags-$(CONFIG_ARC_HAS_LLSC)		+= -mlock
 cflags-$(CONFIG_ARC_HAS_SWAPE)		+= -mswape
 cflags-$(CONFIG_ARC_HAS_SWAPE)		+= -mswape
 
 
+ifdef CONFIG_ISA_ARCV2
+
 ifndef CONFIG_ARC_HAS_LL64
 ifndef CONFIG_ARC_HAS_LL64
-cflags-$(CONFIG_ISA_ARCV2)		+= -mno-ll64
+cflags-y				+= -mno-ll64
+endif
+
+ifndef CONFIG_ARC_HAS_DIV_REM
+cflags-y				+= -mno-div-rem
+endif
+
 endif
 endif
 
 
 cflags-$(CONFIG_ARC_DW2_UNWIND)		+= -fasynchronous-unwind-tables
 cflags-$(CONFIG_ARC_DW2_UNWIND)		+= -fasynchronous-unwind-tables