summaryrefslogtreecommitdiffstats
path: root/usr/klibc/arch/i386/libgcc/__ashrdi3.S
blob: 7666eb249a230c39618aafba777f6e0439485204 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
 * arch/i386/libgcc/__ashrdi3.S
 *
 * 64-bit sar
 */
	.text
	.align 4
	.globl __ashrdi3
	.type __ashrdi3,@function
__ashrdi3:
#ifndef _REGPARM
	movl  4(%esp),%eax
	movl  8(%esp),%edx
	movb  12(%esp),%cl
#endif
	cmpb  $32,%cl
	jae   1f

	shrdl %cl,%edx,%eax
	sarl  %cl,%edx
	ret

1:
	sarl  %cl,%edx
	movl  %edx,%eax
	cdq
	ret

	.size __ashrdi3,.-__ashrdi3