-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[JSC] Implement Float16Array #30732
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
[JSC] Implement Float16Array #30732
Conversation
|
EWS run on previous version of this PR (hash 752f717) Details |
752f717 to
d595366
Compare
|
EWS run on previous version of this PR (hash d595366) Details |
d595366 to
ed4c8cd
Compare
|
EWS run on previous version of this PR (hash ed4c8cd) Details |
ed4c8cd to
6441bf3
Compare
|
EWS run on previous version of this PR (hash 6441bf3) Details |
6441bf3 to
b38c4ea
Compare
|
EWS run on previous version of this PR (hash b38c4ea) Details |
|
I wonder if those float16 AMX instructions on the M2 / M3 would be relevant here |
b38c4ea to
9c482d9
Compare
|
EWS run on previous version of this PR (hash 9c482d9) Details |
9c482d9 to
59f985b
Compare
|
EWS run on previous version of this PR (hash 59f985b) Details |
59f985b to
847d8c1
Compare
|
EWS run on previous version of this PR (hash 847d8c1) Details |
847d8c1 to
3c0d8f8
Compare
|
EWS run on previous version of this PR (hash 3c0d8f8) Details |
7c116c8 to
006ba2a
Compare
|
EWS run on previous version of this PR (hash 006ba2a) Details |
006ba2a to
708c946
Compare
|
EWS run on previous version of this PR (hash 708c946) Details |
708c946 to
842d750
Compare
|
EWS run on previous version of this PR (hash 842d750) Details |
842d750 to
3a74bfd
Compare
|
EWS run on previous version of this PR (hash 3a74bfd) Details |
3a74bfd to
d7e2a3f
Compare
|
EWS run on previous version of this PR (hash d7e2a3f) Details |
hyjorc1
left a comment
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.
r=me
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.
FYI there's a utility Array.isTypedArray defined in Source/WebInspectorUI/UserInterface/Base/Utilities.js that could use updating like this as well :)
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.
Done.
d7e2a3f to
62de325
Compare
|
EWS run on current version of this PR (hash 62de325) Details |
https://bugs.webkit.org/show_bug.cgi?id=257022 rdar://109883982 Reviewed by Yijia Huang. This patch adds Float16Array implementation. In the subsequent patch, we will implement JIT optimization in ARM64 for Float16Array too. Basically, it is just a TypedArray with Float16. wtf/Float16.h implements Float16 data structure, and we just use it to implement Float16Array in JSC. * JSTests/test262/config.yaml: * LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idb-binary-key-roundtrip-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/IndexedDB/structured-clone.any.worker_81-100-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/IndexedDB/structured-clone.any_81-100-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-headers.any-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-headers.any.serviceworker-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-headers.any.sharedworker-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-headers.any.worker-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-upload.any-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-upload.any.serviceworker-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-upload.any.sharedworker-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-upload.any.worker-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-clone.any-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-clone.any.serviceworker-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-clone.any.sharedworker-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-clone.any.worker-expected.txt: * LayoutTests/js/Object-getOwnPropertyNames-expected.txt: * LayoutTests/js/script-tests/Object-getOwnPropertyNames.js: * LayoutTests/platform/glib/imported/w3c/web-platform-tests/fetch/api/basic/request-headers.any-expected.txt: * LayoutTests/platform/glib/imported/w3c/web-platform-tests/fetch/api/basic/request-headers.any.serviceworker-expected.txt: * LayoutTests/platform/glib/imported/w3c/web-platform-tests/fetch/api/basic/request-headers.any.sharedworker-expected.txt: * LayoutTests/platform/glib/imported/w3c/web-platform-tests/fetch/api/basic/request-headers.any.worker-expected.txt: * LayoutTests/platform/glib/imported/w3c/web-platform-tests/fetch/api/basic/request-upload.any-expected.txt: * LayoutTests/platform/glib/imported/w3c/web-platform-tests/fetch/api/basic/request-upload.any.serviceworker-expected.txt: * LayoutTests/platform/glib/imported/w3c/web-platform-tests/fetch/api/basic/request-upload.any.sharedworker-expected.txt: * LayoutTests/platform/glib/imported/w3c/web-platform-tests/fetch/api/basic/request-upload.any.worker-expected.txt: * Source/JavaScriptCore/API/JSTypedArray.cpp: (createTypedArray): * Source/JavaScriptCore/CMakeLists.txt: * Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj: * Source/JavaScriptCore/builtins/BuiltinNames.h: * Source/JavaScriptCore/bytecode/ArrayProfile.cpp: (JSC::dumpArrayModes): * Source/JavaScriptCore/bytecode/ArrayProfile.h: * Source/JavaScriptCore/bytecode/LinkTimeConstant.h: * Source/JavaScriptCore/bytecode/Repatch.cpp: (JSC::tryCacheArrayGetByVal): (JSC::tryCacheArrayPutByVal): (JSC::tryCacheArrayInByVal): * Source/JavaScriptCore/bytecode/SpeculatedType.cpp: (JSC::dumpSpeculation): (JSC::speculationToAbbreviatedString): (JSC::speculationFromTypedArrayType): (JSC::typedArrayTypeFromSpeculation): (JSC::speculationFromString): * Source/JavaScriptCore/bytecode/SpeculatedType.h: (JSC::isFloat16ArraySpeculation): * Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h: (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects): * Source/JavaScriptCore/dfg/DFGArrayMode.cpp: (JSC::DFG::ArrayMode::fromObserved): (JSC::DFG::ArrayMode::refine const): (JSC::DFG::ArrayMode::alreadyChecked const): (JSC::DFG::arrayTypeToString): (JSC::DFG::toTypedArrayType): (JSC::DFG::toArrayType): (JSC::DFG::permitsBoundsCheckLowering): * Source/JavaScriptCore/dfg/DFGArrayMode.h: (JSC::DFG::ArrayMode::supportsSelfLength const): (JSC::DFG::ArrayMode::arrayModesThatPassFiltering const): * Source/JavaScriptCore/dfg/DFGClobberize.h: (JSC::DFG::clobberize): * Source/JavaScriptCore/dfg/DFGFixupPhase.cpp: (JSC::DFG::FixupPhase::fixupNode): * Source/JavaScriptCore/dfg/DFGOperations.h: (JSC::DFG::operationNewTypedArrayWithSizeForType): (JSC::DFG::operationNewTypedArrayWithOneArgumentForType): * Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp: * Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp: (JSC::DFG::SpeculativeJIT::compileGetByVal): (JSC::DFG::SpeculativeJIT::compilePutByVal): * Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::compileGetByVal): (JSC::DFG::SpeculativeJIT::compilePutByVal): * Source/JavaScriptCore/dfg/DFGStoreBarrierInsertionPhase.cpp: * Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::compileGetByValImpl): (JSC::FTL::DFG::LowerDFGToB3::compilePutByVal): * Source/JavaScriptCore/heap/Heap.h: * Source/JavaScriptCore/inspector/JSInjectedScriptHost.cpp: (Inspector::JSInjectedScriptHost::subtype): * Source/JavaScriptCore/llint/LowLevelInterpreter.asm: * Source/JavaScriptCore/runtime/Float16Array.h: Copied from Source/JavaScriptCore/runtime/JSTypedArrayConstructors.cpp. * Source/JavaScriptCore/runtime/JSCast.h: * Source/JavaScriptCore/runtime/JSDataViewPrototype.cpp: (JSC::getData): (JSC::setData): (JSC::JSC_DEFINE_HOST_FUNCTION): * Source/JavaScriptCore/runtime/JSFloat16Array.h: Copied from Source/JavaScriptCore/runtime/JSTypedArrayConstructors.cpp. * Source/JavaScriptCore/runtime/JSGenericTypedArrayViewConstructor.h: * Source/JavaScriptCore/runtime/JSGenericTypedArrayViewInlines.h: (JSC::JSGenericTypedArrayView<Adaptor>::setFromTypedArray): (JSC::JSGenericTypedArrayView<Adaptor>::sort): (JSC::JSGenericTypedArrayView<Adaptor>::subspaceFor): * Source/JavaScriptCore/runtime/JSGenericTypedArrayViewPrototypeFunctions.h: (JSC::typedArrayIndexOfImpl): (JSC::genericTypedArrayViewProtoFuncIncludes): (JSC::genericTypedArrayViewProtoFuncSlice): * Source/JavaScriptCore/runtime/JSGlobalObject.cpp: (JSC::JSGlobalObject::init): * Source/JavaScriptCore/runtime/JSType.cpp: (WTF::printInternal): * Source/JavaScriptCore/runtime/JSType.h: * Source/JavaScriptCore/runtime/JSTypedArrayConstructors.cpp: * Source/JavaScriptCore/runtime/JSTypedArrayConstructors.h: * Source/JavaScriptCore/runtime/JSTypedArrayPrototypes.cpp: * Source/JavaScriptCore/runtime/JSTypedArrayPrototypes.h: * Source/JavaScriptCore/runtime/JSTypedArrayViewPrototype.cpp: (JSC::JSC_DEFINE_HOST_FUNCTION): * Source/JavaScriptCore/runtime/JSTypedArrays.cpp: * Source/JavaScriptCore/runtime/JSTypedArrays.h: * Source/JavaScriptCore/runtime/MathObject.cpp: (JSC::MathObject::finishCreation): (JSC::JSC_DEFINE_HOST_FUNCTION): * Source/JavaScriptCore/runtime/OptionsList.h: * Source/JavaScriptCore/runtime/TypedArrayAdaptersForwardDeclarations.h: * Source/JavaScriptCore/runtime/TypedArrayAdaptors.h: (JSC::BigIntTypedArrayAdaptor::convertTo): (JSC::Float16Adaptor::toJSValue): (JSC::Float16Adaptor::toNativeFromInt32): (JSC::Float16Adaptor::toNativeFromUint32): (JSC::Float16Adaptor::toNativeFromDouble): (JSC::Float16Adaptor::toNativeFromUndefined): (JSC::Float16Adaptor::convertTo): (JSC::Float16Adaptor::toNativeFromInt32WithoutCoercion): (JSC::Float16Adaptor::toNativeFromDoubleWithoutCoercion): * Source/JavaScriptCore/runtime/TypedArrayType.cpp: (JSC::constructorClassInfoForType): (WTF::printInternal): * Source/JavaScriptCore/runtime/TypedArrayType.h: (JSC::typedArrayType): (JSC::logElementSize): (JSC::isFloat): (JSC::isSigned): (JSC::contentType): (JSC::isSomeUint8): * Source/WTF/WTF.xcodeproj/project.pbxproj: * Source/WTF/wtf/CMakeLists.txt: * Source/WTF/wtf/Float16.h: Added. (WTF::convertFloat16ToFloat32): (WTF::convertFloat16ToFloat64): (WTF::convertFloat32ToFloat16): (WTF::convertFloat64ToFloat16): (WTF::Float16::Float16): (WTF::Float16::min): (WTF::Float16::max): (WTF::Float16::operator double const): (WTF::Float16::operator<=> const): (WTF::Float16::operator== const): (WTF::Float16::operator!= const): (WTF::Float16::asDouble const): * Source/WTF/wtf/text/StringCommon.h: (WTF::findFloat16): * Source/WebCore/bindings/js/JSDOMConvertBufferSource.h: (WebCore::toPossiblySharedFloat16Array): (WebCore::toUnsharedFloat16Array): * Source/WebCore/bindings/js/SerializedScriptValue.cpp: (WebCore::typedArrayElementSize): (WebCore::CloneSerializer::dumpArrayBufferView): (WebCore::CloneDeserializer::readArrayBufferViewImpl): * Source/WebCore/bindings/scripts/CodeGenerator.pm: * Source/WebCore/bindings/scripts/CodeGeneratorJS.pm: (GetBaseIDLType): Canonical link: https://commits.webkit.org/281870@main
62de325 to
37e1627
Compare
|
Committed 281870@main (37e1627): https://commits.webkit.org/281870@main Reviewed commits have been landed. Closing PR #30732 and removing active labels. |
🧪 api-ios
37e1627
62de325
🛠 wincairo🧪 wincairo-tests🧪 webkitperl🧪 ios-wk2🧪 api-mac🧪 ios-wk2-wpt🧪 mac-wk1🛠 🧪 jsc🧪 api-ios🧪 mac-wk2🛠 gtk🛠 🧪 jsc-arm64🛠 vision🧪 mac-AS-debug-wk2🧪 gtk-wk2🛠 vision-sim🧪 mac-wk2-stress🧪 api-gtk🛠 tv🧪 jsc-armv7-tests🛠 tv-sim🛠 watch🛠 watch-sim