Commit 9e96203d by J"orn Rennecke Committed by Joern Rennecke

lib1funcs.asm (sdivsi3): Add optimized SH64 implementations.

	* lib1funcs.asm (sdivsi3): Add optimized SH64 implementations.
	(udivsi3): Likewise.  Rewrite SH1 implementation.
	(udivdi3, divdi3, umoddi3, moddi3): New SHmedia functions.
	* sh.md (R20_REG, R21_REG, R22_REG, R23_REG, FR23_REG): New constants.
	(udivsi3_i1_media, divsi3_i1_media): Fix clobber list.
	* config/sh/t-sh64 (LIB1ASMFUNCS): (_udivdi3, _divdi3, _umoddi3): Add.
	(_moddi3): Likewise.

	* lib1funcs.asm (ic_invalidate): Add data cache line writeback.

From-SVN: r54965
parent a8106207
Mon Jun 24 18:53:56 2002 J"orn Rennecke <joern.rennecke@superh.com>
Mon Jun 24 21:05:09 2002 J"orn Rennecke <joern.rennecke@superh.com>
* lib1funcs.asm (sdivsi3): Add optimized SH64 implementations.
(udivsi3): Likewise. Rewrite SH1 implementation.
(udivdi3, divdi3, umoddi3, moddi3): New SHmedia functions.
* sh.md (R20_REG, R21_REG, R22_REG, R23_REG, FR23_REG): New constants.
(udivsi3_i1_media, divsi3_i1_media): Fix clobber list.
* config/sh/t-sh64 (LIB1ASMFUNCS): (_udivdi3, _divdi3, _umoddi3): Add.
(_moddi3): Likewise.
* lib1funcs.asm (ic_invalidate): Add data cache line writeback.
* sh.h (FUNCTION_ARG_ADVANCE): Take SHCOMPACT_FORCE_ON_STACK
arguments into account for stack_regs.
......
......@@ -99,10 +99,15 @@
(R8_REG 8)
(R9_REG 9)
(R10_REG 10)
(R20_REG 20)
(R21_REG 21)
(R22_REG 22)
(R23_REG 23)
(DR0_REG 64)
(DR2_REG 66)
(DR4_REG 68)
(FR23_REG 87)
(TR0_REG 128)
(TR1_REG 129)
......@@ -1281,12 +1286,20 @@
[(set_attr "type" "sfunc")
(set_attr "needs_delay_slot" "yes")])
; Since shmedia-nofpu code could be linked against shcompact code, and
; the udivsi3 libcall has the same name, we must consider all registers
; clobbered that are in the union of the registers clobbered by the
; shmedia and the shcompact implementation. Note, if the shcompact
; implemenation actually used shcompact code, we'd need to clobber
; also r23 and fr23.
(define_insn "udivsi3_i1_media"
[(set (match_operand:SI 0 "register_operand" "=z")
(udiv:SI (reg:SI R4_REG) (reg:SI R5_REG)))
(clobber (reg:SI T_MEDIA_REG))
(clobber (reg:SI PR_MEDIA_REG))
(clobber (reg:SI R4_REG))
(clobber (reg:SI R20_REG))
(clobber (reg:SI R21_REG))
(clobber (reg:SI R22_REG))
(clobber (reg:DI TR0_REG))
(clobber (reg:DI TR1_REG))
(clobber (reg:DI TR2_REG))
......@@ -1430,6 +1443,12 @@
[(set_attr "type" "sfunc")
(set_attr "needs_delay_slot" "yes")])
; Since shmedia-nofpu code could be linked against shcompact code, and
; the udivsi3 libcall has the same name, we must consider all registers
; clobbered that are in the union of the registers clobbered by the
; shmedia and the shcompact implementation. Note, if the shcompact
; implemenation actually used shcompact code, we'd need to clobber
; also r22, r23 and fr23.
(define_insn "divsi3_i1_media"
[(set (match_operand:SI 0 "register_operand" "=z")
(div:SI (reg:SI R4_REG) (reg:SI R5_REG)))
......@@ -1438,6 +1457,8 @@
(clobber (reg:SI R1_REG))
(clobber (reg:SI R2_REG))
(clobber (reg:SI R3_REG))
(clobber (reg:SI R20_REG))
(clobber (reg:SI R21_REG))
(clobber (reg:DI TR0_REG))
(clobber (reg:DI TR1_REG))
(clobber (reg:DI TR2_REG))
......
......@@ -4,7 +4,8 @@ LIB1ASMFUNCS = \
_sdivsi3 _sdivsi3_i4 _udivsi3 _udivsi3_i4 _set_fpscr \
_shcompact_call_trampoline _shcompact_return_trampoline \
_shcompact_incoming_args _ic_invalidate _nested_trampoline \
_push_pop_shmedia_regs
_push_pop_shmedia_regs \
_udivdi3 _divdi3 _umoddi3 _moddi3
MULTILIB_OPTIONS = $(MULTILIB_ENDIAN) m5-32media-nofpu/m5-compact/m5-compact-nofpu/m5-64media/m5-64media-nofpu
MULTILIB_DIRNAMES= $(MULTILIB_ENDIAN) nofpu compact nofpu/compact media64 nofpu/media64
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment