objc_msgSend: powerpc64* support#386
Conversation
Works on both little- and big-endian.
|
This looks technically correct, but seems to be somewhat missing the point of the assembly implementations. This always hits the slow path and will be slower than the portable mechanism. |
|
|
||
| /* Prologue: save LR, create frame, save TOC */ | ||
| mflr 0 | ||
| stdu 1, -FRAME_SIZE(1) |
There was a problem hiding this comment.
I think you want a cfi_def_cfa_offset here.
| lfd 13, 192(1) | ||
|
|
||
| /* Tear down frame and restore LR */ | ||
| addi 1, 1, FRAME_SIZE |
There was a problem hiding this comment.
And here a cfi_adjust_cfa_offset again
| nop | ||
|
|
||
| /* Move returned IMP to r12 (required for ELFv2 indirect calls) */ | ||
| mr 12, 3 |
There was a problem hiding this comment.
Is there a reason for using register indices instead of %r<NUMBER> and %f<NUMBER>? It makes it cumbersome to read.
| .globl CDECL(objc_msgSend_stret) | ||
| TYPE_DIRECTIVE(CDECL(objc_msgSend_stret), %function) | ||
|
|
||
| /* For stret methods: r3=hidden struct ptr, r4=self, r5=sel */ |
There was a problem hiding this comment.
You can use a macro and save the duplication here. Checkout my draft objc_msgSend.powerpc.S here:
libobjc2/objc_msgSend.powerpc.S
Line 177 in ffa2b4f
|
I agree with David that there is no point in having this assembly trampoline if you always take the slow path. Maybe base it around my already existing draft. The draft is basically a translation of the RISC-V trampoline. libobjc2/objc_msgSend.powerpc.S Line 2 in ffa2b4f |
|
Also enabling this requires an additional patch in |
Works on both little- and big-endian.