ObjFW  Check-in [681c2e3087]

Overview
Comment:lookup-asm-mips64-n64-elf.S: Tagged pointers
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | tagged-pointers
Files: files | file ages | folders
SHA3-256: 681c2e3087f73bdaafdcc60c8d88a4f1b551dc6a5f6fe381250ffaa450873c97
User & Date: js on 2020-07-06 20:07:13
Other Links: branch diff | manifest | tags
Context
2020-07-06
23:36
lookup-asm-mips-elf.S: Support tagged pointers check-in: 8870c49908 user: js tags: tagged-pointers
20:07
lookup-asm-mips64-n64-elf.S: Tagged pointers check-in: 681c2e3087 user: js tags: tagged-pointers
2020-07-05
14:06
lookup-asm-x86(_64)-*.S: Shave off one instruction check-in: 0579faebb2 user: js tags: tagged-pointers
Changes

Modified src/runtime/lookup-asm/lookup-asm-mips64-n64-elf.S from [93cafb41c5] to [eccb0ae4e7].

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
.globl objc_msg_lookup_super_stret

.section .text
.macro generate_lookup name not_found
\name:
	beqz	$a0, 0f




	ld	$t0, 0($a0)
	ld	$t0, 64($t0)

.Lmain_\name:
#ifdef OF_BIG_ENDIAN
# ifdef OF_SELUID24
	lbu	$t1, 5($a1)
# endif
	lbu	$t2, 6($a1)
	lbu	$t3, 7($a1)
#else
# ifdef OF_SELUID24
	lbu	$t1, 2($a1)
# endif
	lbu	$t2, 1($a1)
	lbu	$t3, 0($a1)
#endif

#ifdef OF_SELUID24
	sll	$t1, $t1, 3
#endif
	sll	$t2, $t2, 3
	sll	$t3, $t3, 3

#ifdef OF_SELUID24
	daddu	$t0, $t0, $t1
	ld	$t0, 0($t0)
#endif
	daddu	$t0, $t0, $t2
	ld	$t0, 0($t0)
	daddu	$t0, $t0, $t3
	ld	$t0, 0($t0)

	beqz	$t0, 1f

	move	$v0, $t0
	jr	$ra

0:
	lui	$v0, %hi(%neg(%gp_rel(\name)))
	daddu	$v0, $v0, $t9
	daddiu	$v0, $v0, %lo(%neg(%gp_rel(\name)))
	ld	$v0, %got_disp(nil_method)($v0)
	jr	$ra

1:
	lui	$t0, %hi(%neg(%gp_rel(\name)))
	daddu	$t0, $t0, $t9
	daddiu	$t0, $t0, %lo(%neg(%gp_rel(\name)))
	ld	$t9, %got_disp(\not_found)($t0)
	jr	$t9














.type \name, %function
.size \name, .-\name
.endm

.macro generate_lookup_super name lookup
\name:
	move	$t0, $a0
	ld	$a0, 0($a0)
	beqz	$a0, 0f

	ld	$t0, 8($t0)
	ld	$t0, 64($t0)

	daddiu	$t9, $t9, \lookup-\name
	b	.Lmain_\lookup







>
>
>
|














|










|


|

|



















>
>
>
>
>
>
>
>
>
>
>
>
>
>







|







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
.globl objc_msg_lookup_super_stret

.section .text
.macro generate_lookup name not_found
\name:
	beqz	$a0, 0f

	andi	$t0, $a0, 1
	bnez	$t0, .Ltagged_pointer_\name

	ld	$t0, ($a0)
	ld	$t0, 64($t0)

.Lmain_\name:
#ifdef OF_BIG_ENDIAN
# ifdef OF_SELUID24
	lbu	$t1, 5($a1)
# endif
	lbu	$t2, 6($a1)
	lbu	$t3, 7($a1)
#else
# ifdef OF_SELUID24
	lbu	$t1, 2($a1)
# endif
	lbu	$t2, 1($a1)
	lbu	$t3, ($a1)
#endif

#ifdef OF_SELUID24
	sll	$t1, $t1, 3
#endif
	sll	$t2, $t2, 3
	sll	$t3, $t3, 3

#ifdef OF_SELUID24
	daddu	$t0, $t0, $t1
	ld	$t0, ($t0)
#endif
	daddu	$t0, $t0, $t2
	ld	$t0, ($t0)
	daddu	$t0, $t0, $t3
	ld	$t0, ($t0)

	beqz	$t0, 1f

	move	$v0, $t0
	jr	$ra

0:
	lui	$v0, %hi(%neg(%gp_rel(\name)))
	daddu	$v0, $v0, $t9
	daddiu	$v0, $v0, %lo(%neg(%gp_rel(\name)))
	ld	$v0, %got_disp(nil_method)($v0)
	jr	$ra

1:
	lui	$t0, %hi(%neg(%gp_rel(\name)))
	daddu	$t0, $t0, $t9
	daddiu	$t0, $t0, %lo(%neg(%gp_rel(\name)))
	ld	$t9, %got_disp(\not_found)($t0)
	jr	$t9

.Ltagged_pointer_\name:
	and	$t0, $a0, 0xE
	dsll	$t0, $t0, 2

	lui	$t1, %hi(%neg(%gp_rel(\name)))
	daddu	$t1, $t1, $t9
	daddiu	$t1, $t1, %lo(%neg(%gp_rel(\name)))
	ld	$t1, %got_disp(objc_tagged_pointer_classes)($t1)
	daddu	$t0, $t1, $t0
	ld	$t0, ($t0)
	ld	$t0, 64($t0)

	b	.Lmain_\name
.type \name, %function
.size \name, .-\name
.endm

.macro generate_lookup_super name lookup
\name:
	move	$t0, $a0
	ld	$a0, ($a0)
	beqz	$a0, 0f

	ld	$t0, 8($t0)
	ld	$t0, 64($t0)

	daddiu	$t9, $t9, \lookup-\name
	b	.Lmain_\lookup