-
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
Open
alex-s168
wants to merge
2
commits into
JetBrains:master
Choose a base branch
from
alex-s168:feat/more-vectorOf
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -103,11 +103,27 @@ KVector4f Kotlin_Interop_Vector4f_of(KFloat f0, KFloat f1, KFloat f2, KFloat f3) | |||
* To avoid illegal bitcast from/to function types the following function | ||||
* return type MUST be <4 x float> and explicit type cast is done on the variable type. | ||||
*/ | ||||
KVector4f Kotlin_Interop_Vector4i32_of(KInt f0, KInt f1, KInt f2, KInt f3) { | ||||
KInt __attribute__ ((__vector_size__(16))) v4i = {f0, f1, f2, f3}; | ||||
|
||||
KVector4f Kotlin_Interop_Vector4i32_of(KInt i0, KInt i1, KInt i2, KInt i3) { | ||||
KInt __attribute__ ((__vector_size__(16))) v4i = {i0, i1, i2, i3}; | ||||
return (KVector4f)v4i; | ||||
} | ||||
|
||||
KVector4f Kotlin_Interop_Vector8i16_of(KShort s0, KShort s1, KShort s2, KShort s3, KShort s4, KShort s5, KShort s6, KShort s7) { | ||||
KShort __attribute__ ((__vector_size__(16))) v8s = {s0, s1, s2, s3, s4, s5, s6, s7}; | ||||
return (KVector4f)v8s; | ||||
} | ||||
|
||||
KVector4f Kotlin_Interop_Vector2i64_of(KLong l0, KLong l1) { | ||||
KLong __attribute__ ((__vector_size__(16))) v2l = {l0, l1}; | ||||
return (KVector4f)v2l; | ||||
} | ||||
|
||||
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 commentThe 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
|
||||
|
||||
long Kotlin_longTypeProvider() { | ||||
return 0; | ||||
} | ||||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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/