arch/sh/lib/ashrsi3.S

Source file repositories/reference/linux-study-clean/arch/sh/lib/ashrsi3.S

File Facts

System
Linux kernel
Corpus path
arch/sh/lib/ashrsi3.S
Extension
.S
Size
2816 bytes
Lines
180
Domain
Architecture Layer
Bucket
arch/sh
Inferred role
Architecture Layer: arch/sh
Status
atlas-only

Why This File Exists

CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.

Dependency Surface

Detected Declarations

Annotated Snippet

Copyright (C) 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
   2004, 2005, 2006
   Free Software Foundation, Inc.
*/

!! libgcc routines for the Renesas / SuperH SH CPUs.
!! Contributed by Steve Chamberlain.
!! sac@cygnus.com

!! ashiftrt_r4_x, ___ashrsi3, ___ashlsi3, ___lshrsi3 routines
!! recoded in assembly by Toshiyasu Morita
!! tm@netcom.com

/* SH2 optimizations for ___ashrsi3, ___ashlsi3, ___lshrsi3 and
   ELF local label prefixes by J"orn Rennecke
   amylaar@cygnus.com  */

!
! __ashrsi3
!
! Entry:
!
! r4: Value to shift
! r5: Shifts
!
! Exit:
!
! r0: Result
!
! Destroys:
!
! (none)
!
! __ashrsi3_r0
!
! Entry:
!
! r4: Value to shift
! r0: Shifts
!
! Exit:
!
! r0: Result
!
! Destroys:
!
! (none)

	.global	__ashrsi3
	.global	__ashrsi3_r0
	
	.align	2
__ashrsi3:
	mov	r5,r0
	.align	2
__ashrsi3_r0:
	and	#31,r0
	mov.l	r4,@-r15
	mov	r0,r4
	mova	ashrsi3_table,r0
	mov.b	@(r0,r4),r4
	add	r4,r0
	jmp	@r0
	mov.l	@r15+,r0

	.align	2
ashrsi3_table:
	.byte		ashrsi3_0-ashrsi3_table
	.byte		ashrsi3_1-ashrsi3_table
	.byte		ashrsi3_2-ashrsi3_table

Annotation

Implementation Notes