-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
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
Add more vectorOf
functions to Kotlin Native
#5265
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR completely lacks tests for the new functions. Please add some.
@@ -57,10 +57,25 @@ public final class Vector128 private constructor() { | |||
@GCUnsafeCall("Kotlin_Interop_Vector4f_of") | |||
public external fun vectorOf(f0: Float, f1: Float, f2: Float, f3: Float): Vector128 | |||
|
|||
@SinceKotlin("1.9") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The argument doesn't seem right -- this declaration won't appear in Kotlin 1.9. See more details here: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-since-kotlin/
KVector4f Kotlin_Interop_Vector2f64_of(KDouble d0, KDouble d1) { | ||
KDouble __attribute__ ((__vector_size__(16))) v2d = {d0, d1}; | ||
return (KVector4f)v2d; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At this point, it makes sense to implement those operations as compiler intrinsics. This would help avoid copy-pasting. The intrinsics are implemented here:
Line 218 in 6c05219
when (val intrinsicType = getIntrinsicType(callSite)) { |
Title