ObjFW  Check-in [4c90c26c75]

Overview
Comment:Add lookup-asm-sparc-elf.S
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 4c90c26c75b97a1d84a934ff043058980fadc3bf946b1fcb3543dec051141b1d
User & Date: js on 2014-05-02 21:10:59
Other Links: manifest | tags
Context
2014-05-02
22:49
Only use SPARC assembly if __arch64__ is undefined check-in: 8b9ea05af4 user: js tags: trunk
21:10
Add lookup-asm-sparc-elf.S check-in: 4c90c26c75 user: js tags: trunk
20:30
tests/OFSet.m: Rename to OFSetTests.m check-in: fc1a1ccdb6 user: js tags: trunk
Changes

Added src/runtime/lookup-asm/lookup-asm-sparc-elf.S version [b09be65dbc].





































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
/*
 * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014
 *   Jonathan Schleifer <js@webkeks.org>
 *
 * All rights reserved.
 *
 * This file is part of ObjFW. It may be distributed under the terms of the
 * Q Public License 1.0, which can be found in the file LICENSE.QPL included in
 * the packaging of this file.
 *
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#include "config.h"

.globl objc_msg_lookup
.globl objc_msg_lookup_stret
.globl objc_msg_lookup_super
.globl objc_msg_lookup_super_stret

.section .text
.macro generate_lookup name not_found
\name:
	cmp	%o0, 0
	beq,a	ret_nil
	 nop

	ld	[%o0], %o2
	ld	[%o2 + 32], %o2

.Lmain_\name:
#ifdef OF_SELUID24
	ldub	[%o1 + 1], %o3
#endif
	ldub	[%o1 + 2], %o4
	ldub	[%o1 + 3], %o5

#ifdef OF_SELUID24
	sll	%o3, 2, %o3
#endif
	sll	%o4, 2, %o4
	sll	%o5, 2, %o5

#ifdef OF_SELUID24
	ld	[%o2 + %o3], %o2
#endif
	ld	[%o2 + %o4], %o2
	ld	[%o2 + %o5], %o2

	cmp	%o2, 0
	beq,a	\not_found
	 nop

	retl
	 mov	%o2, %o0
.type \name, %function
.size \name, .-\name
.endm

.macro generate_lookup_super name lookup
\name:
	ld	[%o0], %o2
	cmp	%o2, 0
	beq	ret_nil
	 nop

	ld	[%o0 + 4], %o2
	ba	.Lmain_\lookup
	 ld	[%o2 + 32], %o2
.type \name, %function
.size \name, .-\name
.endm

generate_lookup objc_msg_lookup objc_method_not_found
generate_lookup objc_msg_lookup_stret objc_method_not_found_stret
generate_lookup_super objc_msg_lookup_super objc_msg_lookup
generate_lookup_super objc_msg_lookup_super_stret objc_msg_lookup_stret

ret_nil:
#ifdef PIC
	save

	sethi	%hi(_GLOBAL_OFFSET_TABLE_ - 4), %l7
	call	get_pc
	 add	%l7, %lo(_GLOBAL_OFFSET_TABLE_ + 4), %l7

	sethi	%hi(nil_method), %i0
	or	%i0, %lo(nil_method), %i0
	ld	[%l7 + %i0], %i0

	ret
	 restore
#else
	sethi	%hi(nil_method), %o0
	retl
	 or	%o0, %lo(nil_method), %o0
#endif

nil_method:
	retl
	 set	0, %o0

#ifdef PIC
get_pc:
	retl
	 add	%o7, %l7, %l7
#endif

#ifdef __linux__
.section .note.GNU-stack, "", %progbits
#endif

Modified src/runtime/lookup-asm/lookup-asm.S from [0b17d4b290] to [e3a99b0313].

24
25
26
27
28
29
30


31
32
33
34
35
36
37
# elif defined(__arm__) || defined(__ARM__)
#  include "lookup-asm-arm-elf.S"
# elif defined(__ppc__) || defined(__PPC__)
#  include "lookup-asm-ppc-elf.S"
# elif (defined(_MIPS_SIM) && _MIPS_SIM == _ABIO32) || \
	(defined(__mips_eabi) && _MIPS_SZPTR == 32)
#  include "lookup-asm-mips-elf.S"


# endif
#elif defined(__MACH__)
# if defined(__x86_64__)
#  include "lookup-asm-x86_64-macho.S"
# elif defined(__ppc__)
#  include "lookup-asm-ppc-macho.S"
# endif







>
>







24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# elif defined(__arm__) || defined(__ARM__)
#  include "lookup-asm-arm-elf.S"
# elif defined(__ppc__) || defined(__PPC__)
#  include "lookup-asm-ppc-elf.S"
# elif (defined(_MIPS_SIM) && _MIPS_SIM == _ABIO32) || \
	(defined(__mips_eabi) && _MIPS_SZPTR == 32)
#  include "lookup-asm-mips-elf.S"
# elif defined(__sparc__)
#  include "lookup-asm-sparc-elf.S"
# endif
#elif defined(__MACH__)
# if defined(__x86_64__)
#  include "lookup-asm-x86_64-macho.S"
# elif defined(__ppc__)
#  include "lookup-asm-ppc-macho.S"
# endif

Modified src/runtime/runtime-private.h from [0c1f32cf47] to [b4f3550173].

178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
	return (void*)s->buckets[i]->buckets[j];
#endif
}

#if defined(__ELF__)
# if defined(__x86_64__) || defined(__amd64__) || defined(__i386__) || \
	defined(__ppc__) || defined(__PPC__) || defined(__arm__) || \
	defined(__ARM__)
#  define OF_ASM_LOOKUP
# endif
# if (defined(_MIPS_SIM) && _MIPS_SIM == _ABIO32) || \
	(defined(__mips_eabi) && _MIPS_SZPTR == 32)
#  define OF_ASM_LOOKUP
# endif
#elif defined(__MACH__)







|







178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
	return (void*)s->buckets[i]->buckets[j];
#endif
}

#if defined(__ELF__)
# if defined(__x86_64__) || defined(__amd64__) || defined(__i386__) || \
	defined(__ppc__) || defined(__PPC__) || defined(__arm__) || \
	defined(__ARM__) || defined(__sparc__)
#  define OF_ASM_LOOKUP
# endif
# if (defined(_MIPS_SIM) && _MIPS_SIM == _ABIO32) || \
	(defined(__mips_eabi) && _MIPS_SZPTR == 32)
#  define OF_ASM_LOOKUP
# endif
#elif defined(__MACH__)