We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
md5: 53a78697fff2e21f77b952fc2c262bbc
Issue Description:
Calling CATransform3DTranslate generates 40 more bytes of TEXT in Swift than ObjC.
$ cat test.swift import QuartzCore @inline(never) func blackHole<T>(_ x: T) { } let a = CATransform3DMakeRotation(0, 0, 0, 0) let b = CATransform3DTranslate(a, 0, 0, 0) let c = CATransform3DTranslate(b, 0, 0, 0) blackHole(c) $ cat test.m #import <QuartzCore/QuartzCore.h> int main(int argc, const char *argv[]) { CATransform3D a = CATransform3DMakeRotation(0, 0, 0, 0); CATransform3D b = CATransform3DTranslate(a, 0, 0, 0); CATransform3D c = CATransform3DTranslate(b, 0, 0, 0); printf("%p\n", &c); return 0; } $ swiftc -Osize -whole-module-optimization -module-name test -o test test.swift $ clang -framework QuartzCore -Os -o testobjc test.m
Here’s the generated code for the second CATransform3DTranslate call in each.
ObjC (88 bytes):
0000000100007ed4 ldr q0, [sp, #​0x1c0] 0000000100007ed8 str q0, [sp, #​0x40] 0000000100007edc ldr q0, [sp, #​0x1b0] 0000000100007ee0 str q0, [sp, #​0x30] 0000000100007ee4 ldr q0, [sp, #​0x1a0] 0000000100007ee8 str q0, [sp, #​0x20] 0000000100007eec ldr q0, [sp, #​0x190] 0000000100007ef0 str q0, [sp, #​0x10] 0000000100007ef4 ldr q0, [sp, #​0x200] 0000000100007ef8 str q0, [sp, #​0x80] 0000000100007efc ldr q0, [sp, #​0x1f0] 0000000100007f00 str q0, [sp, #​0x70] 0000000100007f04 ldr q0, [sp, #​0x1e0] 0000000100007f08 str q0, [sp, #​0x60] 0000000100007f0c ldr q0, [sp, #​0x1d0] 0000000100007f10 str q0, [sp, #​0x50] 0000000100007f14 add x19, sp, #​0x90 0000000100007f18 fmov d0, xzr 0000000100007f1c fmov d1, xzr 0000000100007f20 fmov d2, xzr 0000000100007f24 add x0, sp, #​0x10 0000000100007f28 add x8, sp, #​0x90 0000000100007f2c bl 0x100007f60 ; symbol stub for: _CATransform3DTranslate
Swift (128 bytes):
0000000100007e6c ldp x9, x8, [sp] 0000000100007e70 ldp x11, x10, [sp, #​0x10] 0000000100007e74 ldp x13, x12, [sp, #​0x20] 0000000100007e78 ldp x15, x14, [sp, #​0x30] 0000000100007e7c ldp x17, x16, [sp, #​0x40] 0000000100007e80 ldp x1, x0, [sp, #​0x50] 0000000100007e84 ldp x3, x2, [sp, #​0x60] 0000000100007e88 ldp x5, x4, [sp, #​0x70] 0000000100007e8c adr x6, #​0x264 0000000100007e90 nop 0000000100007e94 stp x9, x8, [x6] 0000000100007e98 stp x11, x10, [x6, #​0x10] 0000000100007e9c stp x13, x12, [x6, #​0x20] 0000000100007ea0 stp x15, x14, [x6, #​0x30] 0000000100007ea4 stp x17, x16, [x6, #​0x40] 0000000100007ea8 stp x1, x0, [x6, #​0x50] 0000000100007eac stp x3, x2, [x6, #​0x60] 0000000100007eb0 stp x5, x4, [x6, #​0x70] 0000000100007eb4 stp x8, x11, [sp, #​0x88] 0000000100007eb8 str x9, [sp, #​0x80] 0000000100007ebc stp x10, x13, [sp, #​0x98] 0000000100007ec0 stp x12, x15, [sp, #​0xa8] 0000000100007ec4 stp x14, x17, [sp, #​0xb8] 0000000100007ec8 stp x16, x1, [sp, #​0xc8] 0000000100007ecc stp x0, x3, [sp, #​0xd8] 0000000100007ed0 stp x2, x5, [sp, #​0xe8] 0000000100007ed4 str x4, [sp, #​0xf8] 0000000100007ed8 fmov d0, xzr 0000000100007edc fmov d1, xzr 0000000100007ee0 fmov d2, xzr 0000000100007ee4 add x0, sp, #​0x80 0000000100007ee8 mov x8, sp 0000000100007eec bl 0x100007f58 ; symbol stub for: _CATransform3DTranslate
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Additional Detail from JIRA
md5: 53a78697fff2e21f77b952fc2c262bbc
Issue Description:
Calling CATransform3DTranslate generates 40 more bytes of TEXT in Swift than ObjC.
Here’s the generated code for the second CATransform3DTranslate call in each.
ObjC (88 bytes):
Swift (128 bytes):
The text was updated successfully, but these errors were encountered: