react-native-executorch 0.4.8 → 0.5.1-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/CMakeLists.txt +17 -0
- package/android/build.gradle +76 -13
- package/android/libs/classes.jar +0 -0
- package/android/src/main/cpp/CMakeLists.txt +73 -0
- package/android/src/main/cpp/ETInstallerModule.cpp +76 -0
- package/android/src/main/cpp/ETInstallerModule.h +43 -0
- package/android/src/main/java/com/swmansion/rnexecutorch/ETInstaller.kt +66 -0
- package/android/src/main/java/com/swmansion/rnexecutorch/LLM.kt +3 -3
- package/android/src/main/java/com/swmansion/rnexecutorch/RnExecutorchPackage.kt +7 -113
- package/common/ada/ada.cpp +17406 -0
- package/common/ada/ada.h +10274 -0
- package/common/pfft/pfft.c +2205 -0
- package/common/pfft/pfft.h +185 -0
- package/common/rnexecutorch/Log.h +489 -0
- package/common/rnexecutorch/RnExecutorchInstaller.cpp +78 -0
- package/common/rnexecutorch/RnExecutorchInstaller.h +112 -0
- package/common/rnexecutorch/TokenizerModule.cpp +52 -0
- package/common/rnexecutorch/TokenizerModule.h +26 -0
- package/common/rnexecutorch/data_processing/FFT.cpp +21 -0
- package/common/rnexecutorch/data_processing/FFT.h +23 -0
- package/common/rnexecutorch/data_processing/FileUtils.h +30 -0
- package/common/rnexecutorch/data_processing/ImageProcessing.cpp +240 -0
- package/common/rnexecutorch/data_processing/ImageProcessing.h +55 -0
- package/common/rnexecutorch/data_processing/Numerical.cpp +82 -0
- package/common/rnexecutorch/data_processing/Numerical.h +23 -0
- package/common/rnexecutorch/data_processing/base64.cpp +110 -0
- package/common/rnexecutorch/data_processing/base64.h +46 -0
- package/common/rnexecutorch/data_processing/dsp.cpp +65 -0
- package/common/rnexecutorch/data_processing/dsp.h +12 -0
- package/common/rnexecutorch/host_objects/JSTensorViewIn.h +12 -0
- package/common/rnexecutorch/host_objects/JSTensorViewOut.h +22 -0
- package/common/rnexecutorch/host_objects/JsiConversions.h +410 -0
- package/common/rnexecutorch/host_objects/ModelHostObject.h +239 -0
- package/common/rnexecutorch/jsi/JsiHostObject.cpp +108 -0
- package/common/rnexecutorch/jsi/JsiHostObject.h +87 -0
- package/common/rnexecutorch/jsi/OwningArrayBuffer.h +40 -0
- package/common/rnexecutorch/jsi/Promise.cpp +20 -0
- package/common/rnexecutorch/jsi/Promise.h +69 -0
- package/common/rnexecutorch/jsi/RuntimeAwareCache.h +58 -0
- package/common/rnexecutorch/jsi/RuntimeLifecycleMonitor.cpp +53 -0
- package/common/rnexecutorch/jsi/RuntimeLifecycleMonitor.h +35 -0
- package/common/rnexecutorch/metaprogramming/ConstructorHelpers.h +131 -0
- package/common/rnexecutorch/metaprogramming/FunctionHelpers.h +50 -0
- package/common/rnexecutorch/metaprogramming/TypeConcepts.h +37 -0
- package/common/rnexecutorch/models/BaseModel.cpp +181 -0
- package/common/rnexecutorch/models/BaseModel.h +47 -0
- package/common/rnexecutorch/models/EncoderDecoderBase.cpp +21 -0
- package/common/rnexecutorch/models/EncoderDecoderBase.h +31 -0
- package/common/rnexecutorch/models/classification/Classification.cpp +72 -0
- package/common/rnexecutorch/models/classification/Classification.h +26 -0
- package/{ios/RnExecutorch/models/classification/Constants.mm → common/rnexecutorch/models/classification/Constants.h} +7 -2
- package/common/rnexecutorch/models/embeddings/BaseEmbeddings.cpp +27 -0
- package/common/rnexecutorch/models/embeddings/BaseEmbeddings.h +17 -0
- package/common/rnexecutorch/models/embeddings/image/ImageEmbeddings.cpp +45 -0
- package/common/rnexecutorch/models/embeddings/image/ImageEmbeddings.h +23 -0
- package/common/rnexecutorch/models/embeddings/text/TextEmbeddings.cpp +61 -0
- package/common/rnexecutorch/models/embeddings/text/TextEmbeddings.h +26 -0
- package/{ios/RnExecutorch/models/image_segmentation/Constants.mm → common/rnexecutorch/models/image_segmentation/Constants.h} +7 -2
- package/common/rnexecutorch/models/image_segmentation/ImageSegmentation.cpp +173 -0
- package/common/rnexecutorch/models/image_segmentation/ImageSegmentation.h +43 -0
- package/{ios/RnExecutorch/utils/Constants.mm → common/rnexecutorch/models/object_detection/Constants.h} +9 -2
- package/common/rnexecutorch/models/object_detection/ObjectDetection.cpp +82 -0
- package/common/rnexecutorch/models/object_detection/ObjectDetection.h +31 -0
- package/{ios/RnExecutorch/utils/ObjectDetectionUtils.mm → common/rnexecutorch/models/object_detection/Utils.cpp} +10 -30
- package/common/rnexecutorch/models/object_detection/Utils.h +17 -0
- package/common/rnexecutorch/models/ocr/CTCLabelConverter.cpp +88 -0
- package/common/rnexecutorch/models/ocr/CTCLabelConverter.h +29 -0
- package/common/rnexecutorch/models/ocr/Constants.h +34 -0
- package/common/rnexecutorch/models/ocr/Detector.cpp +102 -0
- package/common/rnexecutorch/models/ocr/Detector.h +30 -0
- package/common/rnexecutorch/models/ocr/DetectorUtils.cpp +703 -0
- package/common/rnexecutorch/models/ocr/DetectorUtils.h +80 -0
- package/common/rnexecutorch/models/ocr/OCR.cpp +52 -0
- package/common/rnexecutorch/models/ocr/OCR.h +36 -0
- package/common/rnexecutorch/models/ocr/RecognitionHandler.cpp +107 -0
- package/common/rnexecutorch/models/ocr/RecognitionHandler.h +40 -0
- package/common/rnexecutorch/models/ocr/RecognitionHandlerUtils.cpp +153 -0
- package/common/rnexecutorch/models/ocr/RecognitionHandlerUtils.h +72 -0
- package/common/rnexecutorch/models/ocr/Recognizer.cpp +80 -0
- package/common/rnexecutorch/models/ocr/Recognizer.h +36 -0
- package/common/rnexecutorch/models/ocr/RecognizerUtils.cpp +202 -0
- package/common/rnexecutorch/models/ocr/RecognizerUtils.h +70 -0
- package/common/rnexecutorch/models/ocr/Types.h +37 -0
- package/common/rnexecutorch/models/speech_to_text/MoonshineStrategy.cpp +31 -0
- package/common/rnexecutorch/models/speech_to_text/MoonshineStrategy.h +21 -0
- package/common/rnexecutorch/models/speech_to_text/SpeechToText.cpp +70 -0
- package/common/rnexecutorch/models/speech_to_text/SpeechToText.h +31 -0
- package/common/rnexecutorch/models/speech_to_text/SpeechToTextStrategy.h +26 -0
- package/common/rnexecutorch/models/speech_to_text/WhisperStrategy.cpp +38 -0
- package/common/rnexecutorch/models/speech_to_text/WhisperStrategy.h +25 -0
- package/common/rnexecutorch/models/style_transfer/StyleTransfer.cpp +55 -0
- package/common/rnexecutorch/models/style_transfer/StyleTransfer.h +29 -0
- package/common/rnexecutorch/models/vertical_ocr/VerticalDetector.cpp +92 -0
- package/common/rnexecutorch/models/vertical_ocr/VerticalDetector.h +49 -0
- package/common/rnexecutorch/models/vertical_ocr/VerticalOCR.cpp +180 -0
- package/common/rnexecutorch/models/vertical_ocr/VerticalOCR.h +78 -0
- package/common/rnexecutorch/tests/LogTest.cpp +530 -0
- package/common/rnexecutorch/tests/README.md +20 -0
- package/common/rnexecutorch/tests/run_all_tests.sh +14 -0
- package/common/rnexecutorch/tests/run_test.sh +18 -0
- package/ios/ExecutorchLib.xcframework/Info.plist +4 -4
- package/ios/ExecutorchLib.xcframework/ios-arm64/ExecutorchLib.framework/ExecutorchLib +0 -0
- package/ios/ExecutorchLib.xcframework/ios-arm64/ExecutorchLib.framework/Info.plist +0 -0
- package/ios/ExecutorchLib.xcframework/ios-arm64-simulator/ExecutorchLib.framework/ExecutorchLib +0 -0
- package/ios/ExecutorchLib.xcframework/ios-arm64-simulator/ExecutorchLib.framework/Info.plist +0 -0
- package/ios/RnExecutorch/ETInstaller.h +8 -0
- package/ios/RnExecutorch/ETInstaller.mm +56 -0
- package/ios/RnExecutorch/utils/Conversions.h +8 -9
- package/ios/RnExecutorch/utils/Numerical.h +2 -0
- package/ios/RnExecutorch.xcodeproj/project.pbxproj +73 -0
- package/lib/common/Logger.d.ts +8 -0
- package/lib/common/Logger.js +19 -0
- package/lib/constants/modelUrls.d.ts +89 -0
- package/lib/constants/modelUrls.js +116 -0
- package/lib/constants/sttDefaults.js +66 -0
- package/lib/controllers/LLMController.js +210 -0
- package/lib/controllers/OCRController.js +65 -0
- package/lib/controllers/SpeechToTextController.d.ts +52 -0
- package/lib/controllers/SpeechToTextController.js +343 -0
- package/lib/hooks/natural_language_processing/useSpeechToText.js +44 -0
- package/lib/index.d.ts +50 -0
- package/{src/index.tsx → lib/index.js} +22 -10
- package/lib/module/Error.js +2 -0
- package/lib/module/Error.js.map +1 -1
- package/lib/module/common/Logger.js +23 -0
- package/lib/module/common/Logger.js.map +1 -0
- package/lib/module/constants/llmDefaults.js +8 -0
- package/lib/module/constants/llmDefaults.js.map +1 -1
- package/lib/module/constants/modelUrls.js +300 -84
- package/lib/module/constants/modelUrls.js.map +1 -1
- package/lib/module/constants/ocr/models.js +181 -286
- package/lib/module/constants/ocr/models.js.map +1 -1
- package/lib/module/constants/ocr/symbols.js +63 -63
- package/lib/module/constants/sttDefaults.js +12 -10
- package/lib/module/constants/sttDefaults.js.map +1 -1
- package/lib/module/controllers/LLMController.js +17 -11
- package/lib/module/controllers/LLMController.js.map +1 -1
- package/lib/module/controllers/OCRController.js +16 -9
- package/lib/module/controllers/OCRController.js.map +1 -1
- package/lib/module/controllers/SpeechToTextController.js +32 -19
- package/lib/module/controllers/SpeechToTextController.js.map +1 -1
- package/lib/module/controllers/VerticalOCRController.js +16 -9
- package/lib/module/controllers/VerticalOCRController.js.map +1 -1
- package/lib/module/hooks/computer_vision/useClassification.js +5 -5
- package/lib/module/hooks/computer_vision/useClassification.js.map +1 -1
- package/lib/module/hooks/computer_vision/useImageEmbeddings.js +13 -0
- package/lib/module/hooks/computer_vision/useImageEmbeddings.js.map +1 -0
- package/lib/module/hooks/computer_vision/useImageSegmentation.js +4 -4
- package/lib/module/hooks/computer_vision/useImageSegmentation.js.map +1 -1
- package/lib/module/hooks/computer_vision/useOCR.js +14 -15
- package/lib/module/hooks/computer_vision/useOCR.js.map +1 -1
- package/lib/module/hooks/computer_vision/useObjectDetection.js +5 -5
- package/lib/module/hooks/computer_vision/useObjectDetection.js.map +1 -1
- package/lib/module/hooks/computer_vision/useStyleTransfer.js +5 -5
- package/lib/module/hooks/computer_vision/useStyleTransfer.js.map +1 -1
- package/lib/module/hooks/computer_vision/useVerticalOCR.js +16 -17
- package/lib/module/hooks/computer_vision/useVerticalOCR.js.map +1 -1
- package/lib/module/hooks/general/useExecutorchModule.js +5 -3
- package/lib/module/hooks/general/useExecutorchModule.js.map +1 -1
- package/lib/module/hooks/natural_language_processing/useLLM.js +22 -25
- package/lib/module/hooks/natural_language_processing/useLLM.js.map +1 -1
- package/lib/module/hooks/natural_language_processing/useSpeechToText.js +16 -14
- package/lib/module/hooks/natural_language_processing/useSpeechToText.js.map +1 -1
- package/lib/module/hooks/natural_language_processing/useTextEmbeddings.js +4 -5
- package/lib/module/hooks/natural_language_processing/useTextEmbeddings.js.map +1 -1
- package/lib/module/hooks/natural_language_processing/useTokenizer.js +20 -19
- package/lib/module/hooks/natural_language_processing/useTokenizer.js.map +1 -1
- package/lib/module/hooks/useNonStaticModule.js +52 -0
- package/lib/module/hooks/useNonStaticModule.js.map +1 -0
- package/lib/module/index.js +16 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/modules/BaseModule.js +6 -3
- package/lib/module/modules/BaseModule.js.map +1 -1
- package/lib/module/modules/BaseNonStaticModule.js +17 -0
- package/lib/module/modules/BaseNonStaticModule.js.map +1 -0
- package/lib/module/modules/computer_vision/ClassificationModule.js +13 -8
- package/lib/module/modules/computer_vision/ClassificationModule.js.map +1 -1
- package/lib/module/modules/computer_vision/ImageEmbeddingsModule.js +19 -0
- package/lib/module/modules/computer_vision/ImageEmbeddingsModule.js.map +1 -0
- package/lib/module/modules/computer_vision/ImageSegmentationModule.js +21 -19
- package/lib/module/modules/computer_vision/ImageSegmentationModule.js.map +1 -1
- package/lib/module/modules/computer_vision/OCRModule.js +13 -10
- package/lib/module/modules/computer_vision/OCRModule.js.map +1 -1
- package/lib/module/modules/computer_vision/ObjectDetectionModule.js +13 -8
- package/lib/module/modules/computer_vision/ObjectDetectionModule.js.map +1 -1
- package/lib/module/modules/computer_vision/StyleTransferModule.js +13 -8
- package/lib/module/modules/computer_vision/StyleTransferModule.js.map +1 -1
- package/lib/module/modules/computer_vision/VerticalOCRModule.js +15 -10
- package/lib/module/modules/computer_vision/VerticalOCRModule.js.map +1 -1
- package/lib/module/modules/general/ExecutorchModule.js +10 -36
- package/lib/module/modules/general/ExecutorchModule.js.map +1 -1
- package/lib/module/modules/natural_language_processing/LLMModule.js +18 -22
- package/lib/module/modules/natural_language_processing/LLMModule.js.map +1 -1
- package/lib/module/modules/natural_language_processing/SpeechToTextModule.js +27 -16
- package/lib/module/modules/natural_language_processing/SpeechToTextModule.js.map +1 -1
- package/lib/module/modules/natural_language_processing/TextEmbeddingsModule.js +15 -8
- package/lib/module/modules/natural_language_processing/TextEmbeddingsModule.js.map +1 -1
- package/lib/module/modules/natural_language_processing/TokenizerModule.js +20 -14
- package/lib/module/modules/natural_language_processing/TokenizerModule.js.map +1 -1
- package/lib/module/native/NativeETInstaller.js +5 -0
- package/lib/module/native/NativeETInstaller.js.map +1 -0
- package/lib/module/native/RnExecutorchModules.js +2 -11
- package/lib/module/native/RnExecutorchModules.js.map +1 -1
- package/lib/module/types/common.js +25 -8
- package/lib/module/types/common.js.map +1 -1
- package/lib/module/types/stt.js +6 -0
- package/lib/module/types/stt.js.map +1 -1
- package/lib/module/utils/ResourceFetcher.js +276 -114
- package/lib/module/utils/ResourceFetcher.js.map +1 -1
- package/lib/module/utils/ResourceFetcherUtils.js +155 -0
- package/lib/module/utils/ResourceFetcherUtils.js.map +1 -0
- package/lib/module/utils/llm.js +41 -1
- package/lib/module/utils/llm.js.map +1 -1
- package/lib/modules/natural_language_processing/SpeechToTextModule.d.ts +14 -0
- package/lib/modules/natural_language_processing/SpeechToTextModule.js +30 -0
- package/lib/modules/natural_language_processing/TokenizerModule.js +29 -0
- package/lib/native/RnExecutorchModules.d.ts +3 -0
- package/lib/native/RnExecutorchModules.js +16 -0
- package/lib/typescript/Error.d.ts +2 -0
- package/lib/typescript/Error.d.ts.map +1 -1
- package/lib/typescript/common/Logger.d.ts +9 -0
- package/lib/typescript/common/Logger.d.ts.map +1 -0
- package/lib/typescript/constants/llmDefaults.d.ts +1 -0
- package/lib/typescript/constants/llmDefaults.d.ts.map +1 -1
- package/lib/typescript/constants/modelUrls.d.ts +223 -79
- package/lib/typescript/constants/modelUrls.d.ts.map +1 -1
- package/lib/typescript/constants/ocr/models.d.ts +882 -284
- package/lib/typescript/constants/ocr/models.d.ts.map +1 -1
- package/lib/typescript/constants/sttDefaults.d.ts +1 -0
- package/lib/typescript/constants/sttDefaults.d.ts.map +1 -1
- package/lib/typescript/controllers/LLMController.d.ts +3 -4
- package/lib/typescript/controllers/LLMController.d.ts.map +1 -1
- package/lib/typescript/controllers/OCRController.d.ts +5 -6
- package/lib/typescript/controllers/OCRController.d.ts.map +1 -1
- package/lib/typescript/controllers/SpeechToTextController.d.ts +11 -6
- package/lib/typescript/controllers/SpeechToTextController.d.ts.map +1 -1
- package/lib/typescript/controllers/VerticalOCRController.d.ts +5 -6
- package/lib/typescript/controllers/VerticalOCRController.d.ts.map +1 -1
- package/lib/typescript/hooks/computer_vision/useClassification.d.ts +8 -6
- package/lib/typescript/hooks/computer_vision/useClassification.d.ts.map +1 -1
- package/lib/typescript/hooks/computer_vision/useImageEmbeddings.d.ts +16 -0
- package/lib/typescript/hooks/computer_vision/useImageEmbeddings.d.ts.map +1 -0
- package/lib/typescript/hooks/computer_vision/useImageSegmentation.d.ts +5 -3
- package/lib/typescript/hooks/computer_vision/useImageSegmentation.d.ts.map +1 -1
- package/lib/typescript/hooks/computer_vision/useOCR.d.ts +4 -4
- package/lib/typescript/hooks/computer_vision/useOCR.d.ts.map +1 -1
- package/lib/typescript/hooks/computer_vision/useObjectDetection.d.ts +5 -3
- package/lib/typescript/hooks/computer_vision/useObjectDetection.d.ts.map +1 -1
- package/lib/typescript/hooks/computer_vision/useStyleTransfer.d.ts +5 -3
- package/lib/typescript/hooks/computer_vision/useStyleTransfer.d.ts.map +1 -1
- package/lib/typescript/hooks/computer_vision/useVerticalOCR.d.ts +3 -5
- package/lib/typescript/hooks/computer_vision/useVerticalOCR.d.ts.map +1 -1
- package/lib/typescript/hooks/general/useExecutorchModule.d.ts +1 -1
- package/lib/typescript/hooks/natural_language_processing/useLLM.d.ts +6 -4
- package/lib/typescript/hooks/natural_language_processing/useLLM.d.ts.map +1 -1
- package/lib/typescript/hooks/natural_language_processing/useSpeechToText.d.ts +7 -5
- package/lib/typescript/hooks/natural_language_processing/useSpeechToText.d.ts.map +1 -1
- package/lib/typescript/hooks/natural_language_processing/useTextEmbeddings.d.ts +9 -5
- package/lib/typescript/hooks/natural_language_processing/useTextEmbeddings.d.ts.map +1 -1
- package/lib/typescript/hooks/natural_language_processing/useTokenizer.d.ts +6 -4
- package/lib/typescript/hooks/natural_language_processing/useTokenizer.d.ts.map +1 -1
- package/lib/typescript/hooks/useNonStaticModule.d.ts +21 -0
- package/lib/typescript/hooks/useNonStaticModule.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +18 -2
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/modules/BaseModule.d.ts +1 -1
- package/lib/typescript/modules/BaseModule.d.ts.map +1 -1
- package/lib/typescript/modules/BaseNonStaticModule.d.ts +10 -0
- package/lib/typescript/modules/BaseNonStaticModule.d.ts.map +1 -0
- package/lib/typescript/modules/computer_vision/ClassificationModule.d.ts +6 -6
- package/lib/typescript/modules/computer_vision/ClassificationModule.d.ts.map +1 -1
- package/lib/typescript/modules/computer_vision/ImageEmbeddingsModule.d.ts +9 -0
- package/lib/typescript/modules/computer_vision/ImageEmbeddingsModule.d.ts.map +1 -0
- package/lib/typescript/modules/computer_vision/ImageSegmentationModule.d.ts +8 -28
- package/lib/typescript/modules/computer_vision/ImageSegmentationModule.d.ts.map +1 -1
- package/lib/typescript/modules/computer_vision/OCRModule.d.ts +8 -7
- package/lib/typescript/modules/computer_vision/OCRModule.d.ts.map +1 -1
- package/lib/typescript/modules/computer_vision/ObjectDetectionModule.d.ts +7 -5
- package/lib/typescript/modules/computer_vision/ObjectDetectionModule.d.ts.map +1 -1
- package/lib/typescript/modules/computer_vision/StyleTransferModule.d.ts +6 -5
- package/lib/typescript/modules/computer_vision/StyleTransferModule.d.ts.map +1 -1
- package/lib/typescript/modules/computer_vision/VerticalOCRModule.d.ts +7 -8
- package/lib/typescript/modules/computer_vision/VerticalOCRModule.d.ts.map +1 -1
- package/lib/typescript/modules/general/ExecutorchModule.d.ts +5 -8
- package/lib/typescript/modules/general/ExecutorchModule.d.ts.map +1 -1
- package/lib/typescript/modules/natural_language_processing/LLMModule.d.ts +16 -16
- package/lib/typescript/modules/natural_language_processing/LLMModule.d.ts.map +1 -1
- package/lib/typescript/modules/natural_language_processing/SpeechToTextModule.d.ts +19 -9
- package/lib/typescript/modules/natural_language_processing/SpeechToTextModule.d.ts.map +1 -1
- package/lib/typescript/modules/natural_language_processing/TextEmbeddingsModule.d.ts +7 -5
- package/lib/typescript/modules/natural_language_processing/TextEmbeddingsModule.d.ts.map +1 -1
- package/lib/typescript/modules/natural_language_processing/TokenizerModule.d.ts +10 -9
- package/lib/typescript/modules/natural_language_processing/TokenizerModule.d.ts.map +1 -1
- package/lib/typescript/native/{NativeStyleTransfer.d.ts → NativeETInstaller.d.ts} +2 -3
- package/lib/typescript/native/NativeETInstaller.d.ts.map +1 -0
- package/lib/typescript/native/RnExecutorchModules.d.ts +3 -21
- package/lib/typescript/native/RnExecutorchModules.d.ts.map +1 -1
- package/lib/typescript/types/common.d.ts +30 -2
- package/lib/typescript/types/common.d.ts.map +1 -1
- package/lib/typescript/types/stt.d.ts +5 -1
- package/lib/typescript/types/stt.d.ts.map +1 -1
- package/lib/typescript/utils/ResourceFetcher.d.ts +18 -10
- package/lib/typescript/utils/ResourceFetcher.d.ts.map +1 -1
- package/lib/typescript/utils/ResourceFetcherUtils.d.ts +55 -0
- package/lib/typescript/utils/ResourceFetcherUtils.d.ts.map +1 -0
- package/lib/typescript/utils/llm.d.ts +4 -0
- package/lib/typescript/utils/llm.d.ts.map +1 -1
- package/lib/utils/ResourceFetcherUtils.js +119 -0
- package/lib/utils/llm.js +72 -0
- package/package.json +22 -64
- package/react-native-executorch.podspec +75 -3
- package/src/Error.ts +2 -0
- package/src/common/Logger.ts +25 -0
- package/src/constants/llmDefaults.ts +11 -0
- package/src/constants/modelUrls.ts +365 -168
- package/src/constants/ocr/models.ts +826 -395
- package/src/constants/ocr/symbols.ts +63 -63
- package/src/constants/sttDefaults.ts +14 -18
- package/src/controllers/LLMController.ts +28 -18
- package/src/controllers/OCRController.ts +24 -15
- package/src/controllers/SpeechToTextController.ts +53 -40
- package/src/controllers/VerticalOCRController.ts +24 -14
- package/src/hooks/computer_vision/useClassification.ts +10 -11
- package/src/hooks/computer_vision/useImageEmbeddings.ts +15 -0
- package/src/hooks/computer_vision/useImageSegmentation.ts +5 -8
- package/src/hooks/computer_vision/useOCR.ts +29 -21
- package/src/hooks/computer_vision/useObjectDetection.ts +6 -9
- package/src/hooks/computer_vision/useStyleTransfer.ts +6 -6
- package/src/hooks/computer_vision/useVerticalOCR.ts +30 -27
- package/src/hooks/general/useExecutorchModule.ts +3 -3
- package/src/hooks/natural_language_processing/useLLM.ts +38 -28
- package/src/hooks/natural_language_processing/useSpeechToText.ts +34 -26
- package/src/hooks/natural_language_processing/useTextEmbeddings.ts +11 -11
- package/src/hooks/natural_language_processing/useTokenizer.ts +22 -22
- package/src/hooks/useNonStaticModule.ts +74 -0
- package/src/index.ts +108 -0
- package/src/modules/BaseModule.ts +9 -3
- package/src/modules/BaseNonStaticModule.ts +26 -0
- package/src/modules/computer_vision/ClassificationModule.ts +20 -11
- package/src/modules/computer_vision/ImageEmbeddingsModule.ts +26 -0
- package/src/modules/computer_vision/ImageSegmentationModule.ts +35 -27
- package/src/modules/computer_vision/OCRModule.ts +23 -15
- package/src/modules/computer_vision/ObjectDetectionModule.ts +24 -11
- package/src/modules/computer_vision/StyleTransferModule.ts +20 -11
- package/src/modules/computer_vision/VerticalOCRModule.ts +25 -21
- package/src/modules/general/ExecutorchModule.ts +18 -48
- package/src/modules/natural_language_processing/LLMModule.ts +27 -30
- package/src/modules/natural_language_processing/SpeechToTextModule.ts +42 -37
- package/src/modules/natural_language_processing/TextEmbeddingsModule.ts +27 -12
- package/src/modules/natural_language_processing/TokenizerModule.ts +27 -17
- package/src/native/NativeETInstaller.ts +8 -0
- package/src/native/RnExecutorchModules.ts +4 -46
- package/src/types/common.ts +40 -12
- package/src/types/stt.ts +5 -1
- package/src/utils/ResourceFetcher.ts +338 -119
- package/src/utils/ResourceFetcherUtils.ts +186 -0
- package/src/utils/llm.ts +65 -1
- package/third-party/android/libs/executorch/arm64-v8a/libexecutorch.so +0 -0
- package/third-party/android/libs/executorch/x86_64/libexecutorch.so +0 -0
- package/third-party/android/libs/opencv/arm64-v8a/libopencv_core.a +0 -0
- package/third-party/android/libs/opencv/arm64-v8a/libopencv_features2d.a +0 -0
- package/third-party/android/libs/opencv/arm64-v8a/libopencv_highgui.a +0 -0
- package/third-party/android/libs/opencv/arm64-v8a/libopencv_imgproc.a +0 -0
- package/third-party/android/libs/opencv/arm64-v8a/libopencv_photo.a +0 -0
- package/third-party/android/libs/opencv/arm64-v8a/libopencv_video.a +0 -0
- package/third-party/android/libs/opencv/x86_64/libopencv_core.a +0 -0
- package/third-party/android/libs/opencv/x86_64/libopencv_features2d.a +0 -0
- package/third-party/android/libs/opencv/x86_64/libopencv_highgui.a +0 -0
- package/third-party/android/libs/opencv/x86_64/libopencv_imgproc.a +0 -0
- package/third-party/android/libs/opencv/x86_64/libopencv_photo.a +0 -0
- package/third-party/android/libs/opencv/x86_64/libopencv_video.a +0 -0
- package/third-party/android/libs/opencv-third-party/arm64-v8a/libkleidicv.a +0 -0
- package/third-party/android/libs/opencv-third-party/arm64-v8a/libkleidicv_hal.a +0 -0
- package/third-party/android/libs/opencv-third-party/arm64-v8a/libkleidicv_thread.a +0 -0
- package/third-party/include/c10/macros/Export.h +163 -0
- package/third-party/include/c10/macros/Macros.h +497 -0
- package/third-party/include/c10/util/BFloat16-inl.h +342 -0
- package/third-party/include/c10/util/BFloat16-math.h +266 -0
- package/third-party/include/c10/util/BFloat16.h +125 -0
- package/third-party/include/c10/util/Half-inl.h +347 -0
- package/third-party/include/c10/util/Half.h +416 -0
- package/third-party/include/c10/util/TypeSafeSignMath.h +133 -0
- package/third-party/include/c10/util/bit_cast.h +43 -0
- package/third-party/include/c10/util/floating_point_utils.h +33 -0
- package/third-party/include/c10/util/irange.h +107 -0
- package/third-party/include/executorch/ExecuTorch.h +13 -0
- package/third-party/include/executorch/ExecuTorchError.h +16 -0
- package/third-party/include/executorch/ExecuTorchLog.h +76 -0
- package/third-party/include/executorch/ExecuTorchModule.h +286 -0
- package/third-party/include/executorch/ExecuTorchTensor.h +742 -0
- package/third-party/include/executorch/ExecuTorchValue.h +219 -0
- package/third-party/include/executorch/extension/module/module.h +492 -0
- package/third-party/include/executorch/extension/tensor/tensor.h +13 -0
- package/third-party/include/executorch/extension/tensor/tensor_accessor.h +190 -0
- package/third-party/include/executorch/extension/tensor/tensor_ptr.h +347 -0
- package/third-party/include/executorch/extension/tensor/tensor_ptr_maker.h +653 -0
- package/third-party/include/executorch/runtime/backend/backend_execution_context.h +71 -0
- package/third-party/include/executorch/runtime/backend/backend_init_context.h +72 -0
- package/third-party/include/executorch/runtime/backend/interface.h +166 -0
- package/third-party/include/executorch/runtime/core/array_ref.h +235 -0
- package/third-party/include/executorch/runtime/core/data_loader.h +136 -0
- package/third-party/include/executorch/runtime/core/defines.h +20 -0
- package/third-party/include/executorch/runtime/core/error.h +229 -0
- package/third-party/include/executorch/runtime/core/evalue.h +521 -0
- package/third-party/include/executorch/runtime/core/event_tracer.h +565 -0
- package/third-party/include/executorch/runtime/core/event_tracer_hooks.h +323 -0
- package/third-party/include/executorch/runtime/core/event_tracer_hooks_delegate.h +197 -0
- package/third-party/include/executorch/runtime/core/exec_aten/exec_aten.h +147 -0
- package/third-party/include/executorch/runtime/core/exec_aten/util/dim_order_util.h +263 -0
- package/third-party/include/executorch/runtime/core/exec_aten/util/scalar_type_util.h +1331 -0
- package/third-party/include/executorch/runtime/core/exec_aten/util/tensor_dimension_limit.h +21 -0
- package/third-party/include/executorch/runtime/core/exec_aten/util/tensor_shape_to_c_string.h +69 -0
- package/third-party/include/executorch/runtime/core/exec_aten/util/tensor_util.h +1250 -0
- package/third-party/include/executorch/runtime/core/freeable_buffer.h +107 -0
- package/third-party/include/executorch/runtime/core/hierarchical_allocator.h +107 -0
- package/third-party/include/executorch/runtime/core/memory_allocator.h +198 -0
- package/third-party/include/executorch/runtime/core/named_data_map.h +86 -0
- package/third-party/include/executorch/runtime/core/portable_type/bfloat16.h +27 -0
- package/third-party/include/executorch/runtime/core/portable_type/bfloat16_math.h +14 -0
- package/third-party/include/executorch/runtime/core/portable_type/bits_types.h +83 -0
- package/third-party/include/executorch/runtime/core/portable_type/c10/c10/macros/Export.h +163 -0
- package/third-party/include/executorch/runtime/core/portable_type/c10/c10/macros/Macros.h +497 -0
- package/third-party/include/executorch/runtime/core/portable_type/c10/c10/util/BFloat16-inl.h +342 -0
- package/third-party/include/executorch/runtime/core/portable_type/c10/c10/util/BFloat16-math.h +266 -0
- package/third-party/include/executorch/runtime/core/portable_type/c10/c10/util/BFloat16.h +125 -0
- package/third-party/include/executorch/runtime/core/portable_type/c10/c10/util/Half-inl.h +347 -0
- package/third-party/include/executorch/runtime/core/portable_type/c10/c10/util/Half.h +416 -0
- package/third-party/include/executorch/runtime/core/portable_type/c10/c10/util/TypeSafeSignMath.h +133 -0
- package/third-party/include/executorch/runtime/core/portable_type/c10/c10/util/bit_cast.h +43 -0
- package/third-party/include/executorch/runtime/core/portable_type/c10/c10/util/floating_point_utils.h +33 -0
- package/third-party/include/executorch/runtime/core/portable_type/c10/c10/util/irange.h +107 -0
- package/third-party/include/executorch/runtime/core/portable_type/complex.h +44 -0
- package/third-party/include/executorch/runtime/core/portable_type/device.h +70 -0
- package/third-party/include/executorch/runtime/core/portable_type/half.h +27 -0
- package/third-party/include/executorch/runtime/core/portable_type/optional.h +36 -0
- package/third-party/include/executorch/runtime/core/portable_type/qint_types.h +83 -0
- package/third-party/include/executorch/runtime/core/portable_type/scalar.h +110 -0
- package/third-party/include/executorch/runtime/core/portable_type/scalar_type.h +154 -0
- package/third-party/include/executorch/runtime/core/portable_type/string_view.h +29 -0
- package/third-party/include/executorch/runtime/core/portable_type/tensor.h +142 -0
- package/third-party/include/executorch/runtime/core/portable_type/tensor_impl.h +261 -0
- package/third-party/include/executorch/runtime/core/portable_type/tensor_options.h +60 -0
- package/third-party/include/executorch/runtime/core/result.h +258 -0
- package/third-party/include/executorch/runtime/core/span.h +93 -0
- package/third-party/include/executorch/runtime/core/tag.h +71 -0
- package/third-party/include/executorch/runtime/core/tensor_layout.h +79 -0
- package/third-party/include/executorch/runtime/core/tensor_shape_dynamism.h +39 -0
- package/third-party/include/executorch/runtime/executor/memory_manager.h +113 -0
- package/third-party/include/executorch/runtime/executor/method.h +387 -0
- package/third-party/include/executorch/runtime/executor/method_meta.h +251 -0
- package/third-party/include/executorch/runtime/executor/program.h +320 -0
- package/third-party/include/executorch/runtime/executor/pte_data_map.h +144 -0
- package/third-party/include/executorch/runtime/executor/tensor_parser.h +156 -0
- package/third-party/include/executorch/runtime/kernel/kernel_runtime_context.h +122 -0
- package/third-party/include/executorch/runtime/kernel/operator_registry.h +278 -0
- package/third-party/include/executorch/runtime/platform/abort.h +36 -0
- package/third-party/include/executorch/runtime/platform/assert.h +119 -0
- package/third-party/include/executorch/runtime/platform/clock.h +43 -0
- package/third-party/include/executorch/runtime/platform/compat_unistd.h +75 -0
- package/third-party/include/executorch/runtime/platform/compiler.h +191 -0
- package/third-party/include/executorch/runtime/platform/log.h +177 -0
- package/third-party/include/executorch/runtime/platform/platform.h +133 -0
- package/third-party/include/executorch/runtime/platform/profiler.h +292 -0
- package/third-party/include/executorch/runtime/platform/runtime.h +35 -0
- package/third-party/include/executorch/runtime/platform/system.h +49 -0
- package/third-party/include/executorch/runtime/platform/types.h +24 -0
- package/third-party/include/executorch/schema/extended_header.h +76 -0
- package/third-party/include/opencv2/core/affine.hpp +676 -0
- package/third-party/include/opencv2/core/async.hpp +107 -0
- package/third-party/include/opencv2/core/base.hpp +735 -0
- package/third-party/include/opencv2/core/bindings_utils.hpp +279 -0
- package/third-party/include/opencv2/core/bufferpool.hpp +39 -0
- package/third-party/include/opencv2/core/check.hpp +231 -0
- package/third-party/include/opencv2/core/core.hpp +55 -0
- package/third-party/include/opencv2/core/core_c.h +3261 -0
- package/third-party/include/opencv2/core/cv_cpu_dispatch.h +404 -0
- package/third-party/include/opencv2/core/cv_cpu_helper.h +856 -0
- package/third-party/include/opencv2/core/cvdef.h +1003 -0
- package/third-party/include/opencv2/core/cvstd.hpp +196 -0
- package/third-party/include/opencv2/core/cvstd.inl.hpp +188 -0
- package/third-party/include/opencv2/core/cvstd_wrapper.hpp +187 -0
- package/third-party/include/opencv2/core/detail/async_promise.hpp +73 -0
- package/third-party/include/opencv2/core/detail/dispatch_helper.impl.hpp +48 -0
- package/third-party/include/opencv2/core/detail/exception_ptr.hpp +24 -0
- package/third-party/include/opencv2/core/dualquaternion.hpp +1054 -0
- package/third-party/include/opencv2/core/dualquaternion.inl.hpp +464 -0
- package/third-party/include/opencv2/core/eigen.hpp +405 -0
- package/third-party/include/opencv2/core/fast_math.hpp +433 -0
- package/third-party/include/opencv2/core/hal/hal.hpp +451 -0
- package/third-party/include/opencv2/core/hal/interface.h +191 -0
- package/third-party/include/opencv2/core/hal/intrin.hpp +1222 -0
- package/third-party/include/opencv2/core/hal/intrin_avx.hpp +3378 -0
- package/third-party/include/opencv2/core/hal/intrin_avx512.hpp +3688 -0
- package/third-party/include/opencv2/core/hal/intrin_cpp.hpp +3446 -0
- package/third-party/include/opencv2/core/hal/intrin_forward.hpp +195 -0
- package/third-party/include/opencv2/core/hal/intrin_lasx.hpp +3243 -0
- package/third-party/include/opencv2/core/hal/intrin_lsx.hpp +2671 -0
- package/third-party/include/opencv2/core/hal/intrin_math.hpp +772 -0
- package/third-party/include/opencv2/core/hal/intrin_msa.hpp +1973 -0
- package/third-party/include/opencv2/core/hal/intrin_neon.hpp +2710 -0
- package/third-party/include/opencv2/core/hal/intrin_rvv071.hpp +3452 -0
- package/third-party/include/opencv2/core/hal/intrin_rvv_scalable.hpp +2559 -0
- package/third-party/include/opencv2/core/hal/intrin_sse.hpp +3528 -0
- package/third-party/include/opencv2/core/hal/intrin_sse_em.hpp +175 -0
- package/third-party/include/opencv2/core/hal/intrin_vsx.hpp +1756 -0
- package/third-party/include/opencv2/core/hal/intrin_wasm.hpp +2911 -0
- package/third-party/include/opencv2/core/hal/msa_macros.h +2079 -0
- package/third-party/include/opencv2/core/hal/simd_utils.impl.hpp +313 -0
- package/third-party/include/opencv2/core/mat.hpp +3842 -0
- package/third-party/include/opencv2/core/mat.inl.hpp +2753 -0
- package/third-party/include/opencv2/core/matx.hpp +603 -0
- package/third-party/include/opencv2/core/matx.inl.hpp +1132 -0
- package/third-party/include/opencv2/core/neon_utils.hpp +127 -0
- package/third-party/include/opencv2/core/operations.hpp +610 -0
- package/third-party/include/opencv2/core/optim.hpp +362 -0
- package/third-party/include/opencv2/core/parallel/backend/parallel_for.openmp.hpp +66 -0
- package/third-party/include/opencv2/core/parallel/backend/parallel_for.tbb.hpp +148 -0
- package/third-party/include/opencv2/core/parallel/parallel_backend.hpp +108 -0
- package/third-party/include/opencv2/core/persistence.hpp +1321 -0
- package/third-party/include/opencv2/core/quaternion.hpp +1889 -0
- package/third-party/include/opencv2/core/quaternion.inl.hpp +907 -0
- package/third-party/include/opencv2/core/saturate.hpp +347 -0
- package/third-party/include/opencv2/core/simd_intrinsics.hpp +90 -0
- package/third-party/include/opencv2/core/softfloat.hpp +657 -0
- package/third-party/include/opencv2/core/sse_utils.hpp +861 -0
- package/third-party/include/opencv2/core/traits.hpp +417 -0
- package/third-party/include/opencv2/core/types.hpp +2368 -0
- package/third-party/include/opencv2/core/types_c.h +2064 -0
- package/third-party/include/opencv2/core/utility.hpp +1296 -0
- package/third-party/include/opencv2/core/utils/allocator_stats.hpp +31 -0
- package/third-party/include/opencv2/core/utils/allocator_stats.impl.hpp +111 -0
- package/third-party/include/opencv2/core/utils/filesystem.hpp +91 -0
- package/third-party/include/opencv2/core/utils/fp_control_utils.hpp +70 -0
- package/third-party/include/opencv2/core/utils/instrumentation.hpp +127 -0
- package/third-party/include/opencv2/core/utils/logger.defines.hpp +50 -0
- package/third-party/include/opencv2/core/utils/logger.hpp +258 -0
- package/third-party/include/opencv2/core/utils/logtag.hpp +27 -0
- package/third-party/include/opencv2/core/utils/tls.hpp +230 -0
- package/third-party/include/opencv2/core/utils/trace.hpp +281 -0
- package/third-party/include/opencv2/core/version.hpp +29 -0
- package/third-party/include/opencv2/core/vsx_utils.hpp +1115 -0
- package/third-party/include/opencv2/core.hpp +3699 -0
- package/third-party/include/opencv2/cvconfig.h +155 -0
- package/third-party/include/opencv2/dnn/dnn.hpp +51 -0
- package/third-party/include/opencv2/dnn.hpp +17 -0
- package/third-party/include/opencv2/features2d/features2d.hpp +55 -0
- package/third-party/include/opencv2/features2d/hal/interface.h +32 -0
- package/third-party/include/opencv2/features2d.hpp +1756 -0
- package/third-party/include/opencv2/highgui/highgui.hpp +113 -0
- package/third-party/include/opencv2/highgui.hpp +17 -0
- package/third-party/include/opencv2/imgproc/bindings.hpp +34 -0
- package/third-party/include/opencv2/imgproc/detail/gcgraph.hpp +355 -0
- package/third-party/include/opencv2/imgproc/detail/legacy.hpp +35 -0
- package/third-party/include/opencv2/imgproc/hal/hal.hpp +246 -0
- package/third-party/include/opencv2/imgproc/hal/interface.h +52 -0
- package/third-party/include/opencv2/imgproc/imgproc.hpp +55 -0
- package/third-party/include/opencv2/imgproc/imgproc_c.h +1261 -0
- package/third-party/include/opencv2/imgproc/segmentation.hpp +168 -0
- package/third-party/include/opencv2/imgproc/types_c.h +632 -0
- package/third-party/include/opencv2/imgproc.hpp +5956 -0
- package/third-party/include/opencv2/opencv.hpp +102 -0
- package/third-party/include/opencv2/opencv_modules.hpp +19 -0
- package/third-party/include/opencv2/photo/legacy/constants_c.h +10 -0
- package/third-party/include/opencv2/photo/photo.hpp +55 -0
- package/third-party/include/opencv2/photo.hpp +975 -0
- package/third-party/include/opencv2/video/background_segm.hpp +341 -0
- package/third-party/include/opencv2/video/detail/tracking.detail.hpp +435 -0
- package/third-party/include/opencv2/video/legacy/constants_c.h +15 -0
- package/third-party/include/opencv2/video/tracking.hpp +1014 -0
- package/third-party/include/opencv2/video/video.hpp +55 -0
- package/third-party/include/opencv2/video.hpp +65 -0
- package/third-party/include/tokenizers-cpp/tokenizers_c.h +61 -0
- package/third-party/include/tokenizers-cpp/tokenizers_cpp.h +118 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/Exported/ETModel.h +27 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/Exported/ETModel.mm +249 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/Exported/HuggingFaceTokenizer.h +14 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/Exported/HuggingFaceTokenizer.mm +80 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/Exported/LLaMARunner.h +32 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/Exported/LLaMARunner.mm +95 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/InputType.h +12 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/Utils.hpp +217 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/model/Model.cpp +11 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/model/Model.h +11 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/runner/irunner.h +48 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/runner/runner.cpp +278 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/runner/runner.h +67 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/runner/stats.h +164 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/runner/text_decoder_runner.cpp +65 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/runner/text_decoder_runner.h +105 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/runner/text_prefiller.cpp +91 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/runner/text_prefiller.h +51 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/runner/text_token_generator.h +162 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/runner/util.h +108 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/sampler/sampler.cpp +193 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/sampler/sampler.h +64 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/tokenizer/base64.h +202 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/tokenizer/bpe_tokenizer.cpp +313 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/tokenizer/bpe_tokenizer.h +57 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/tokenizer/llama_tiktoken.cpp +78 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/tokenizer/llama_tiktoken.h +23 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/tokenizer/tiktoken.cpp +427 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/tokenizer/tiktoken.h +87 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib/tokenizer/tokenizer.h +76 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib.xcodeproj/project.pbxproj +683 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib.xcodeproj/project.xcworkspace/xcuserdata/norbertklockiewicz.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/third-party/ios/ExecutorchLib/ExecutorchLib.xcodeproj/xcuserdata/norbertklockiewicz.xcuserdatad/xcschemes/xcschememanagement.plist +14 -0
- package/third-party/ios/ExecutorchLib/build.sh +44 -0
- package/third-party/ios/ExecutorchLib/frameworks/backend_coreml.xcframework/Info.plist +43 -0
- package/third-party/ios/ExecutorchLib/frameworks/backend_coreml.xcframework/ios-arm64/libbackend_coreml_ios.a +0 -0
- package/third-party/ios/ExecutorchLib/frameworks/backend_coreml.xcframework/ios-arm64-simulator/libbackend_coreml_simulator.a +0 -0
- package/third-party/ios/ExecutorchLib/frameworks/backend_mps.xcframework/Info.plist +43 -0
- package/third-party/ios/ExecutorchLib/frameworks/backend_mps.xcframework/ios-arm64/libbackend_mps_ios.a +0 -0
- package/third-party/ios/ExecutorchLib/frameworks/backend_mps.xcframework/ios-arm64-simulator/libbackend_mps_simulator.a +0 -0
- package/third-party/ios/ExecutorchLib/frameworks/backend_xnnpack.xcframework/Info.plist +43 -0
- package/third-party/ios/ExecutorchLib/frameworks/backend_xnnpack.xcframework/ios-arm64/libbackend_xnnpack_ios.a +0 -0
- package/third-party/ios/ExecutorchLib/frameworks/backend_xnnpack.xcframework/ios-arm64-simulator/libbackend_xnnpack_simulator.a +0 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/Info.plist +47 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/c10/macros/Export.h +163 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/c10/macros/Macros.h +497 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/c10/util/BFloat16-inl.h +342 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/c10/util/BFloat16-math.h +266 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/c10/util/BFloat16.h +125 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/c10/util/Half-inl.h +347 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/c10/util/Half.h +416 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/c10/util/TypeSafeSignMath.h +133 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/c10/util/bit_cast.h +43 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/c10/util/floating_point_utils.h +33 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/c10/util/irange.h +107 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/ExecuTorch.h +13 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/ExecuTorchError.h +16 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/ExecuTorchLog.h +76 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/ExecuTorchModule.h +286 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/ExecuTorchTensor.h +742 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/ExecuTorchValue.h +219 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/extension/module/module.h +492 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/extension/tensor/tensor.h +13 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/extension/tensor/tensor_accessor.h +190 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/extension/tensor/tensor_ptr.h +347 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/extension/tensor/tensor_ptr_maker.h +653 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/backend/backend_execution_context.h +71 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/backend/backend_init_context.h +72 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/backend/interface.h +166 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/array_ref.h +235 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/data_loader.h +136 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/defines.h +20 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/error.h +229 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/evalue.h +521 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/event_tracer.h +565 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/event_tracer_hooks.h +323 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/event_tracer_hooks_delegate.h +197 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/exec_aten/exec_aten.h +147 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/exec_aten/util/dim_order_util.h +263 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/exec_aten/util/scalar_type_util.h +1331 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/exec_aten/util/tensor_dimension_limit.h +21 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/exec_aten/util/tensor_shape_to_c_string.h +69 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/exec_aten/util/tensor_util.h +1250 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/freeable_buffer.h +107 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/hierarchical_allocator.h +107 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/memory_allocator.h +198 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/named_data_map.h +86 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/bfloat16.h +27 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/bfloat16_math.h +14 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/bits_types.h +83 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/c10/c10/macros/Export.h +163 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/c10/c10/macros/Macros.h +497 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/c10/c10/util/BFloat16-inl.h +342 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/c10/c10/util/BFloat16-math.h +266 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/c10/c10/util/BFloat16.h +125 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/c10/c10/util/Half-inl.h +347 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/c10/c10/util/Half.h +416 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/c10/c10/util/TypeSafeSignMath.h +133 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/c10/c10/util/bit_cast.h +43 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/c10/c10/util/floating_point_utils.h +33 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/c10/c10/util/irange.h +107 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/complex.h +44 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/device.h +70 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/half.h +27 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/optional.h +36 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/qint_types.h +83 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/scalar.h +110 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/scalar_type.h +154 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/string_view.h +29 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/tensor.h +142 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/tensor_impl.h +261 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/portable_type/tensor_options.h +60 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/result.h +258 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/span.h +93 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/tag.h +71 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/tensor_layout.h +79 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/core/tensor_shape_dynamism.h +39 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/executor/memory_manager.h +113 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/executor/method.h +387 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/executor/method_meta.h +251 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/executor/program.h +320 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/executor/pte_data_map.h +144 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/executor/tensor_parser.h +156 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/kernel/kernel_runtime_context.h +122 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/kernel/operator_registry.h +278 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/platform/abort.h +36 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/platform/assert.h +119 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/platform/clock.h +43 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/platform/compat_unistd.h +75 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/platform/compiler.h +191 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/platform/log.h +177 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/platform/platform.h +133 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/platform/profiler.h +292 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/platform/runtime.h +35 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/platform/system.h +49 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/runtime/platform/types.h +24 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/executorch/schema/extended_header.h +76 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/Headers/module.modulemap +5 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64/libexecutorch_ios.a +0 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/c10/macros/Export.h +163 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/c10/macros/Macros.h +497 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/c10/util/BFloat16-inl.h +342 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/c10/util/BFloat16-math.h +266 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/c10/util/BFloat16.h +125 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/c10/util/Half-inl.h +347 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/c10/util/Half.h +416 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/c10/util/TypeSafeSignMath.h +133 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/c10/util/bit_cast.h +43 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/c10/util/floating_point_utils.h +33 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/c10/util/irange.h +107 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/ExecuTorch.h +13 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/ExecuTorchError.h +16 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/ExecuTorchLog.h +76 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/ExecuTorchModule.h +286 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/ExecuTorchTensor.h +742 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/ExecuTorchValue.h +219 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/extension/module/module.h +492 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/extension/tensor/tensor.h +13 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/extension/tensor/tensor_accessor.h +190 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/extension/tensor/tensor_ptr.h +347 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/extension/tensor/tensor_ptr_maker.h +653 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/backend/backend_execution_context.h +71 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/backend/backend_init_context.h +72 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/backend/interface.h +166 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/array_ref.h +235 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/data_loader.h +136 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/defines.h +20 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/error.h +229 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/evalue.h +521 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/event_tracer.h +565 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/event_tracer_hooks.h +323 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/event_tracer_hooks_delegate.h +197 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/exec_aten/exec_aten.h +147 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/exec_aten/util/dim_order_util.h +263 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/exec_aten/util/scalar_type_util.h +1331 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/exec_aten/util/tensor_dimension_limit.h +21 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/exec_aten/util/tensor_shape_to_c_string.h +69 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/exec_aten/util/tensor_util.h +1250 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/freeable_buffer.h +107 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/hierarchical_allocator.h +107 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/memory_allocator.h +198 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/named_data_map.h +86 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/bfloat16.h +27 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/bfloat16_math.h +14 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/bits_types.h +83 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/c10/c10/macros/Export.h +163 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/c10/c10/macros/Macros.h +497 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/c10/c10/util/BFloat16-inl.h +342 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/c10/c10/util/BFloat16-math.h +266 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/c10/c10/util/BFloat16.h +125 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/c10/c10/util/Half-inl.h +347 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/c10/c10/util/Half.h +416 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/c10/c10/util/TypeSafeSignMath.h +133 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/c10/c10/util/bit_cast.h +43 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/c10/c10/util/floating_point_utils.h +33 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/c10/c10/util/irange.h +107 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/complex.h +44 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/device.h +70 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/half.h +27 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/optional.h +36 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/qint_types.h +83 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/scalar.h +110 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/scalar_type.h +154 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/string_view.h +29 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/tensor.h +142 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/tensor_impl.h +261 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/portable_type/tensor_options.h +60 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/result.h +258 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/span.h +93 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/tag.h +71 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/tensor_layout.h +79 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/core/tensor_shape_dynamism.h +39 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/executor/memory_manager.h +113 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/executor/method.h +387 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/executor/method_meta.h +251 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/executor/program.h +320 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/executor/pte_data_map.h +144 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/executor/tensor_parser.h +156 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/kernel/kernel_runtime_context.h +122 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/kernel/operator_registry.h +278 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/platform/abort.h +36 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/platform/assert.h +119 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/platform/clock.h +43 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/platform/compat_unistd.h +75 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/platform/compiler.h +191 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/platform/log.h +177 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/platform/platform.h +133 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/platform/profiler.h +292 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/platform/runtime.h +35 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/platform/system.h +49 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/runtime/platform/types.h +24 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/executorch/schema/extended_header.h +76 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/Headers/module.modulemap +5 -0
- package/third-party/ios/ExecutorchLib/frameworks/executorch.xcframework/ios-arm64-simulator/libexecutorch_simulator.a +0 -0
- package/third-party/ios/ExecutorchLib/frameworks/kernels_custom.xcframework/Info.plist +43 -0
- package/third-party/ios/ExecutorchLib/frameworks/kernels_custom.xcframework/ios-arm64/libkernels_custom_ios.a +0 -0
- package/third-party/ios/ExecutorchLib/frameworks/kernels_custom.xcframework/ios-arm64-simulator/libkernels_custom_simulator.a +0 -0
- package/third-party/ios/ExecutorchLib/frameworks/kernels_optimized.xcframework/Info.plist +43 -0
- package/third-party/ios/ExecutorchLib/frameworks/kernels_optimized.xcframework/ios-arm64/libkernels_optimized_ios.a +0 -0
- package/third-party/ios/ExecutorchLib/frameworks/kernels_optimized.xcframework/ios-arm64-simulator/libkernels_optimized_simulator.a +0 -0
- package/third-party/ios/ExecutorchLib/frameworks/kernels_portable.xcframework/Info.plist +43 -0
- package/third-party/ios/ExecutorchLib/frameworks/kernels_portable.xcframework/ios-arm64/libkernels_portable_ios.a +0 -0
- package/third-party/ios/ExecutorchLib/frameworks/kernels_portable.xcframework/ios-arm64-simulator/libkernels_portable_simulator.a +0 -0
- package/third-party/ios/ExecutorchLib/frameworks/kernels_quantized.xcframework/Info.plist +43 -0
- package/third-party/ios/ExecutorchLib/frameworks/kernels_quantized.xcframework/ios-arm64/libkernels_quantized_ios.a +0 -0
- package/third-party/ios/ExecutorchLib/frameworks/kernels_quantized.xcframework/ios-arm64-simulator/libkernels_quantized_simulator.a +0 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/Info.plist +43 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64/re2.framework/Headers/bitmap256.h +82 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64/re2.framework/Headers/filtered_re2.h +111 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64/re2.framework/Headers/pod_array.h +43 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64/re2.framework/Headers/prefilter.h +130 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64/re2.framework/Headers/prefilter_tree.h +139 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64/re2.framework/Headers/prog.h +483 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64/re2.framework/Headers/re2.h +994 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64/re2.framework/Headers/regexp.h +692 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64/re2.framework/Headers/set.h +85 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64/re2.framework/Headers/sparse_array.h +367 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64/re2.framework/Headers/sparse_set.h +241 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64/re2.framework/Headers/stringpiece.h +205 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64/re2.framework/Headers/unicode_casefold.h +78 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64/re2.framework/Headers/unicode_groups.h +64 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64/re2.framework/Headers/walker-inl.h +235 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64/re2.framework/Info.plist +26 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64/re2.framework/re2 +0 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64-simulator/re2.framework/Headers/bitmap256.h +82 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64-simulator/re2.framework/Headers/filtered_re2.h +111 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64-simulator/re2.framework/Headers/pod_array.h +43 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64-simulator/re2.framework/Headers/prefilter.h +130 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64-simulator/re2.framework/Headers/prefilter_tree.h +139 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64-simulator/re2.framework/Headers/prog.h +483 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64-simulator/re2.framework/Headers/re2.h +994 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64-simulator/re2.framework/Headers/regexp.h +692 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64-simulator/re2.framework/Headers/set.h +85 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64-simulator/re2.framework/Headers/sparse_array.h +367 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64-simulator/re2.framework/Headers/sparse_set.h +241 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64-simulator/re2.framework/Headers/stringpiece.h +205 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64-simulator/re2.framework/Headers/unicode_casefold.h +78 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64-simulator/re2.framework/Headers/unicode_groups.h +64 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64-simulator/re2.framework/Headers/walker-inl.h +235 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64-simulator/re2.framework/Info.plist +26 -0
- package/third-party/ios/ExecutorchLib/frameworks/re2.xcframework/ios-arm64-simulator/re2.framework/re2 +0 -0
- package/third-party/ios/ios.toolchain.cmake +1122 -0
- package/LICENSE +0 -79
- package/README.md +0 -148
- package/android/src/main/java/com/swmansion/rnexecutorch/Classification.kt +0 -64
- package/android/src/main/java/com/swmansion/rnexecutorch/ETModule.kt +0 -90
- package/android/src/main/java/com/swmansion/rnexecutorch/ImageSegmentation.kt +0 -58
- package/android/src/main/java/com/swmansion/rnexecutorch/OCR.kt +0 -90
- package/android/src/main/java/com/swmansion/rnexecutorch/ObjectDetection.kt +0 -64
- package/android/src/main/java/com/swmansion/rnexecutorch/SpeechToText.kt +0 -91
- package/android/src/main/java/com/swmansion/rnexecutorch/StyleTransfer.kt +0 -54
- package/android/src/main/java/com/swmansion/rnexecutorch/TextEmbeddings.kt +0 -51
- package/android/src/main/java/com/swmansion/rnexecutorch/Tokenizer.kt +0 -86
- package/android/src/main/java/com/swmansion/rnexecutorch/VerticalOCR.kt +0 -179
- package/android/src/main/java/com/swmansion/rnexecutorch/models/BaseModel.kt +0 -54
- package/android/src/main/java/com/swmansion/rnexecutorch/models/TextEmbeddings/TextEmbeddingsModel.kt +0 -48
- package/android/src/main/java/com/swmansion/rnexecutorch/models/TextEmbeddings/TextEmbeddingsUtils.kt +0 -37
- package/android/src/main/java/com/swmansion/rnexecutorch/models/classification/ClassificationModel.kt +0 -46
- package/android/src/main/java/com/swmansion/rnexecutorch/models/classification/Constants.kt +0 -1005
- package/android/src/main/java/com/swmansion/rnexecutorch/models/imageSegmentation/Constants.kt +0 -26
- package/android/src/main/java/com/swmansion/rnexecutorch/models/imageSegmentation/ImageSegmentationModel.kt +0 -142
- package/android/src/main/java/com/swmansion/rnexecutorch/models/objectDetection/SSDLiteLargeModel.kt +0 -74
- package/android/src/main/java/com/swmansion/rnexecutorch/models/ocr/Detector.kt +0 -82
- package/android/src/main/java/com/swmansion/rnexecutorch/models/ocr/RecognitionHandler.kt +0 -117
- package/android/src/main/java/com/swmansion/rnexecutorch/models/ocr/Recognizer.kt +0 -51
- package/android/src/main/java/com/swmansion/rnexecutorch/models/ocr/VerticalDetector.kt +0 -89
- package/android/src/main/java/com/swmansion/rnexecutorch/models/ocr/utils/CTCLabelConverter.kt +0 -58
- package/android/src/main/java/com/swmansion/rnexecutorch/models/ocr/utils/Constants.kt +0 -31
- package/android/src/main/java/com/swmansion/rnexecutorch/models/ocr/utils/DetectorUtils.kt +0 -608
- package/android/src/main/java/com/swmansion/rnexecutorch/models/ocr/utils/RecognizerUtils.kt +0 -430
- package/android/src/main/java/com/swmansion/rnexecutorch/models/speechToText/BaseS2TDecoder.kt +0 -39
- package/android/src/main/java/com/swmansion/rnexecutorch/models/speechToText/BaseS2TModule.kt +0 -43
- package/android/src/main/java/com/swmansion/rnexecutorch/models/speechToText/Moonshine.kt +0 -16
- package/android/src/main/java/com/swmansion/rnexecutorch/models/speechToText/MoonshineDecoder.kt +0 -23
- package/android/src/main/java/com/swmansion/rnexecutorch/models/speechToText/MoonshineEncoder.kt +0 -20
- package/android/src/main/java/com/swmansion/rnexecutorch/models/speechToText/Whisper.kt +0 -16
- package/android/src/main/java/com/swmansion/rnexecutorch/models/speechToText/WhisperDecoder.kt +0 -22
- package/android/src/main/java/com/swmansion/rnexecutorch/models/speechToText/WhisperEncoder.kt +0 -29
- package/android/src/main/java/com/swmansion/rnexecutorch/models/styleTransfer/StyleTransferModel.kt +0 -43
- package/android/src/main/java/com/swmansion/rnexecutorch/utils/ArrayUtils.kt +0 -87
- package/android/src/main/java/com/swmansion/rnexecutorch/utils/ETError.kt +0 -34
- package/android/src/main/java/com/swmansion/rnexecutorch/utils/ImageProcessor.kt +0 -237
- package/android/src/main/java/com/swmansion/rnexecutorch/utils/Numerical.kt +0 -8
- package/android/src/main/java/com/swmansion/rnexecutorch/utils/ObjectDetectionUtils.kt +0 -201
- package/android/src/main/java/com/swmansion/rnexecutorch/utils/STFT.kt +0 -50
- package/android/src/main/java/com/swmansion/rnexecutorch/utils/TensorUtils.kt +0 -103
- package/ios/RnExecutorch/Classification.h +0 -5
- package/ios/RnExecutorch/Classification.mm +0 -54
- package/ios/RnExecutorch/ETModule.h +0 -5
- package/ios/RnExecutorch/ETModule.mm +0 -75
- package/ios/RnExecutorch/ImageSegmentation.h +0 -5
- package/ios/RnExecutorch/ImageSegmentation.mm +0 -60
- package/ios/RnExecutorch/OCR.h +0 -5
- package/ios/RnExecutorch/OCR.mm +0 -96
- package/ios/RnExecutorch/ObjectDetection.h +0 -5
- package/ios/RnExecutorch/ObjectDetection.mm +0 -56
- package/ios/RnExecutorch/SpeechToText.h +0 -5
- package/ios/RnExecutorch/SpeechToText.mm +0 -125
- package/ios/RnExecutorch/StyleTransfer.h +0 -5
- package/ios/RnExecutorch/StyleTransfer.mm +0 -55
- package/ios/RnExecutorch/TextEmbeddings.h +0 -5
- package/ios/RnExecutorch/TextEmbeddings.mm +0 -62
- package/ios/RnExecutorch/Tokenizer.h +0 -5
- package/ios/RnExecutorch/Tokenizer.mm +0 -83
- package/ios/RnExecutorch/VerticalOCR.h +0 -5
- package/ios/RnExecutorch/VerticalOCR.mm +0 -183
- package/ios/RnExecutorch/models/BaseModel.h +0 -21
- package/ios/RnExecutorch/models/BaseModel.mm +0 -43
- package/ios/RnExecutorch/models/classification/ClassificationModel.h +0 -10
- package/ios/RnExecutorch/models/classification/ClassificationModel.mm +0 -53
- package/ios/RnExecutorch/models/classification/Constants.h +0 -3
- package/ios/RnExecutorch/models/image_segmentation/Constants.h +0 -4
- package/ios/RnExecutorch/models/image_segmentation/ImageSegmentationModel.h +0 -10
- package/ios/RnExecutorch/models/image_segmentation/ImageSegmentationModel.mm +0 -146
- package/ios/RnExecutorch/models/object_detection/SSDLiteLargeModel.hpp +0 -11
- package/ios/RnExecutorch/models/object_detection/SSDLiteLargeModel.mm +0 -64
- package/ios/RnExecutorch/models/ocr/Detector.h +0 -9
- package/ios/RnExecutorch/models/ocr/Detector.mm +0 -101
- package/ios/RnExecutorch/models/ocr/RecognitionHandler.h +0 -16
- package/ios/RnExecutorch/models/ocr/RecognitionHandler.mm +0 -135
- package/ios/RnExecutorch/models/ocr/Recognizer.h +0 -8
- package/ios/RnExecutorch/models/ocr/Recognizer.mm +0 -77
- package/ios/RnExecutorch/models/ocr/VerticalDetector.h +0 -10
- package/ios/RnExecutorch/models/ocr/VerticalDetector.mm +0 -118
- package/ios/RnExecutorch/models/ocr/utils/CTCLabelConverter.h +0 -16
- package/ios/RnExecutorch/models/ocr/utils/CTCLabelConverter.mm +0 -80
- package/ios/RnExecutorch/models/ocr/utils/Constants.h +0 -26
- package/ios/RnExecutorch/models/ocr/utils/DetectorUtils.h +0 -31
- package/ios/RnExecutorch/models/ocr/utils/DetectorUtils.mm +0 -754
- package/ios/RnExecutorch/models/ocr/utils/OCRUtils.h +0 -10
- package/ios/RnExecutorch/models/ocr/utils/OCRUtils.mm +0 -67
- package/ios/RnExecutorch/models/ocr/utils/RecognizerUtils.h +0 -35
- package/ios/RnExecutorch/models/ocr/utils/RecognizerUtils.mm +0 -331
- package/ios/RnExecutorch/models/stt/Moonshine.hpp +0 -13
- package/ios/RnExecutorch/models/stt/Moonshine.mm +0 -64
- package/ios/RnExecutorch/models/stt/MoonshineDecoder.hpp +0 -16
- package/ios/RnExecutorch/models/stt/MoonshineDecoder.mm +0 -24
- package/ios/RnExecutorch/models/stt/MoonshineEncoder.hpp +0 -15
- package/ios/RnExecutorch/models/stt/MoonshineEncoder.mm +0 -18
- package/ios/RnExecutorch/models/stt/SpeechToTextBaseModel.hpp +0 -26
- package/ios/RnExecutorch/models/stt/SpeechToTextBaseModel.mm +0 -19
- package/ios/RnExecutorch/models/stt/Whisper.hpp +0 -12
- package/ios/RnExecutorch/models/stt/Whisper.mm +0 -68
- package/ios/RnExecutorch/models/stt/WhisperDecoder.hpp +0 -16
- package/ios/RnExecutorch/models/stt/WhisperDecoder.mm +0 -22
- package/ios/RnExecutorch/models/stt/WhisperEncoder.hpp +0 -15
- package/ios/RnExecutorch/models/stt/WhisperEncoder.mm +0 -21
- package/ios/RnExecutorch/models/style_transfer/StyleTransferModel.h +0 -11
- package/ios/RnExecutorch/models/style_transfer/StyleTransferModel.mm +0 -50
- package/ios/RnExecutorch/models/text_embeddings/TextEmbeddingsModel.h +0 -15
- package/ios/RnExecutorch/models/text_embeddings/TextEmbeddingsModel.mm +0 -45
- package/ios/RnExecutorch/models/text_embeddings/TextEmbeddingsUtils.h +0 -8
- package/ios/RnExecutorch/models/text_embeddings/TextEmbeddingsUtils.mm +0 -49
- package/ios/RnExecutorch/utils/Constants.h +0 -8
- package/ios/RnExecutorch/utils/ObjectDetectionUtils.hpp +0 -23
- package/ios/RnExecutorch/utils/SFFT.hpp +0 -13
- package/ios/RnExecutorch/utils/SFFT.mm +0 -71
- package/lib/module/native/NativeClassification.js +0 -5
- package/lib/module/native/NativeClassification.js.map +0 -1
- package/lib/module/native/NativeETModule.js +0 -5
- package/lib/module/native/NativeETModule.js.map +0 -1
- package/lib/module/native/NativeImageSegmentation.js +0 -5
- package/lib/module/native/NativeImageSegmentation.js.map +0 -1
- package/lib/module/native/NativeOCR.js +0 -5
- package/lib/module/native/NativeOCR.js.map +0 -1
- package/lib/module/native/NativeObjectDetection.js +0 -5
- package/lib/module/native/NativeObjectDetection.js.map +0 -1
- package/lib/module/native/NativeSpeechToText.js +0 -5
- package/lib/module/native/NativeSpeechToText.js.map +0 -1
- package/lib/module/native/NativeStyleTransfer.js +0 -5
- package/lib/module/native/NativeStyleTransfer.js.map +0 -1
- package/lib/module/native/NativeTextEmbeddings.js +0 -5
- package/lib/module/native/NativeTextEmbeddings.js.map +0 -1
- package/lib/module/native/NativeTokenizer.js +0 -5
- package/lib/module/native/NativeTokenizer.js.map +0 -1
- package/lib/module/native/NativeVerticalOCR.js +0 -5
- package/lib/module/native/NativeVerticalOCR.js.map +0 -1
- package/lib/module/package.json +0 -1
- package/lib/typescript/native/NativeClassification.d.ts +0 -10
- package/lib/typescript/native/NativeClassification.d.ts.map +0 -1
- package/lib/typescript/native/NativeETModule.d.ts +0 -9
- package/lib/typescript/native/NativeETModule.d.ts.map +0 -1
- package/lib/typescript/native/NativeImageSegmentation.d.ts +0 -10
- package/lib/typescript/native/NativeImageSegmentation.d.ts.map +0 -1
- package/lib/typescript/native/NativeOCR.d.ts +0 -9
- package/lib/typescript/native/NativeOCR.d.ts.map +0 -1
- package/lib/typescript/native/NativeObjectDetection.d.ts +0 -9
- package/lib/typescript/native/NativeObjectDetection.d.ts.map +0 -1
- package/lib/typescript/native/NativeSpeechToText.d.ts +0 -12
- package/lib/typescript/native/NativeSpeechToText.d.ts.map +0 -1
- package/lib/typescript/native/NativeStyleTransfer.d.ts.map +0 -1
- package/lib/typescript/native/NativeTextEmbeddings.d.ts +0 -8
- package/lib/typescript/native/NativeTextEmbeddings.d.ts.map +0 -1
- package/lib/typescript/native/NativeTokenizer.d.ts +0 -12
- package/lib/typescript/native/NativeTokenizer.d.ts.map +0 -1
- package/lib/typescript/native/NativeVerticalOCR.d.ts +0 -9
- package/lib/typescript/native/NativeVerticalOCR.d.ts.map +0 -1
- package/src/native/NativeClassification.ts +0 -9
- package/src/native/NativeETModule.ts +0 -14
- package/src/native/NativeImageSegmentation.ts +0 -14
- package/src/native/NativeOCR.ts +0 -16
- package/src/native/NativeObjectDetection.ts +0 -10
- package/src/native/NativeSpeechToText.ts +0 -17
- package/src/native/NativeStyleTransfer.ts +0 -10
- package/src/native/NativeTextEmbeddings.ts +0 -9
- package/src/native/NativeTokenizer.ts +0 -13
- package/src/native/NativeVerticalOCR.ts +0 -16
|
@@ -0,0 +1,2079 @@
|
|
|
1
|
+
// This file is part of OpenCV project.
|
|
2
|
+
// It is subject to the license terms in the LICENSE file found in the top-level
|
|
3
|
+
// directory of this distribution and at http://opencv.org/license.html.
|
|
4
|
+
|
|
5
|
+
#ifndef OPENCV_CORE_HAL_MSA_MACROS_H
|
|
6
|
+
#define OPENCV_CORE_HAL_MSA_MACROS_H
|
|
7
|
+
|
|
8
|
+
#ifdef __mips_msa
|
|
9
|
+
#include "msa.h"
|
|
10
|
+
#include <stdint.h>
|
|
11
|
+
|
|
12
|
+
#ifdef __cplusplus
|
|
13
|
+
extern "C" {
|
|
14
|
+
#endif
|
|
15
|
+
|
|
16
|
+
/* Define 64 bits vector types */
|
|
17
|
+
typedef signed char v8i8 __attribute__((vector_size(8), aligned(8)));
|
|
18
|
+
typedef unsigned char v8u8 __attribute__((vector_size(8), aligned(8)));
|
|
19
|
+
typedef short v4i16 __attribute__((vector_size(8), aligned(8)));
|
|
20
|
+
typedef unsigned short v4u16 __attribute__((vector_size(8), aligned(8)));
|
|
21
|
+
typedef int v2i32 __attribute__((vector_size(8), aligned(8)));
|
|
22
|
+
typedef unsigned int v2u32 __attribute__((vector_size(8), aligned(8)));
|
|
23
|
+
typedef long long v1i64 __attribute__((vector_size(8), aligned(8)));
|
|
24
|
+
typedef unsigned long long v1u64 __attribute__((vector_size(8), aligned(8)));
|
|
25
|
+
typedef float v2f32 __attribute__((vector_size(8), aligned(8)));
|
|
26
|
+
typedef double v1f64 __attribute__((vector_size(8), aligned(8)));
|
|
27
|
+
|
|
28
|
+
/* Load values from the given memory a 64-bit vector. */
|
|
29
|
+
#define msa_ld1_s8(__a) (*((v8i8 *)(__a)))
|
|
30
|
+
#define msa_ld1_s16(__a) (*((v4i16 *)(__a)))
|
|
31
|
+
#define msa_ld1_s32(__a) (*((v2i32 *)(__a)))
|
|
32
|
+
#define msa_ld1_s64(__a) (*((v1i64 *)(__a)))
|
|
33
|
+
#define msa_ld1_u8(__a) (*((v8u8 *)(__a)))
|
|
34
|
+
#define msa_ld1_u16(__a) (*((v4u16 *)(__a)))
|
|
35
|
+
#define msa_ld1_u32(__a) (*((v2u32 *)(__a)))
|
|
36
|
+
#define msa_ld1_u64(__a) (*((v1u64 *)(__a)))
|
|
37
|
+
#define msa_ld1_f32(__a) (*((v2f32 *)(__a)))
|
|
38
|
+
#define msa_ld1_f64(__a) (*((v1f64 *)(__a)))
|
|
39
|
+
|
|
40
|
+
/* Load values from the given memory address to a 128-bit vector */
|
|
41
|
+
#define msa_ld1q_s8(__a) ((v16i8)__builtin_msa_ld_b(__a, 0))
|
|
42
|
+
#define msa_ld1q_s16(__a) ((v8i16)__builtin_msa_ld_h(__a, 0))
|
|
43
|
+
#define msa_ld1q_s32(__a) ((v4i32)__builtin_msa_ld_w(__a, 0))
|
|
44
|
+
#define msa_ld1q_s64(__a) ((v2i64)__builtin_msa_ld_d(__a, 0))
|
|
45
|
+
#define msa_ld1q_u8(__a) ((v16u8)__builtin_msa_ld_b(__a, 0))
|
|
46
|
+
#define msa_ld1q_u16(__a) ((v8u16)__builtin_msa_ld_h(__a, 0))
|
|
47
|
+
#define msa_ld1q_u32(__a) ((v4u32)__builtin_msa_ld_w(__a, 0))
|
|
48
|
+
#define msa_ld1q_u64(__a) ((v2u64)__builtin_msa_ld_d(__a, 0))
|
|
49
|
+
#define msa_ld1q_f32(__a) ((v4f32)__builtin_msa_ld_w(__a, 0))
|
|
50
|
+
#define msa_ld1q_f64(__a) ((v2f64)__builtin_msa_ld_d(__a, 0))
|
|
51
|
+
|
|
52
|
+
/* Store 64bits vector elements values to the given memory address. */
|
|
53
|
+
#define msa_st1_s8(__a, __b) (*((v8i8 *)(__a)) = __b)
|
|
54
|
+
#define msa_st1_s16(__a, __b) (*((v4i16 *)(__a)) = __b)
|
|
55
|
+
#define msa_st1_s32(__a, __b) (*((v2i32 *)(__a)) = __b)
|
|
56
|
+
#define msa_st1_s64(__a, __b) (*((v1i64 *)(__a)) = __b)
|
|
57
|
+
#define msa_st1_u8(__a, __b) (*((v8u8 *)(__a)) = __b)
|
|
58
|
+
#define msa_st1_u16(__a, __b) (*((v4u16 *)(__a)) = __b)
|
|
59
|
+
#define msa_st1_u32(__a, __b) (*((v2u32 *)(__a)) = __b)
|
|
60
|
+
#define msa_st1_u64(__a, __b) (*((v1u64 *)(__a)) = __b)
|
|
61
|
+
#define msa_st1_f32(__a, __b) (*((v2f32 *)(__a)) = __b)
|
|
62
|
+
#define msa_st1_f64(__a, __b) (*((v1f64 *)(__a)) = __b)
|
|
63
|
+
|
|
64
|
+
/* Store the values of elements in the 128 bits vector __a to the given memory
|
|
65
|
+
* address __a. */
|
|
66
|
+
#define msa_st1q_s8(__a, __b) (__builtin_msa_st_b((v16i8)(__b), __a, 0))
|
|
67
|
+
#define msa_st1q_s16(__a, __b) (__builtin_msa_st_h((v8i16)(__b), __a, 0))
|
|
68
|
+
#define msa_st1q_s32(__a, __b) (__builtin_msa_st_w((v4i32)(__b), __a, 0))
|
|
69
|
+
#define msa_st1q_s64(__a, __b) (__builtin_msa_st_d((v2i64)(__b), __a, 0))
|
|
70
|
+
#define msa_st1q_u8(__a, __b) (__builtin_msa_st_b((v16i8)(__b), __a, 0))
|
|
71
|
+
#define msa_st1q_u16(__a, __b) (__builtin_msa_st_h((v8i16)(__b), __a, 0))
|
|
72
|
+
#define msa_st1q_u32(__a, __b) (__builtin_msa_st_w((v4i32)(__b), __a, 0))
|
|
73
|
+
#define msa_st1q_u64(__a, __b) (__builtin_msa_st_d((v2i64)(__b), __a, 0))
|
|
74
|
+
#define msa_st1q_f32(__a, __b) (__builtin_msa_st_w((v4i32)(__b), __a, 0))
|
|
75
|
+
#define msa_st1q_f64(__a, __b) (__builtin_msa_st_d((v2i64)(__b), __a, 0))
|
|
76
|
+
|
|
77
|
+
/* Store the value of the element with the index __c in vector __a to the given
|
|
78
|
+
* memory address __a. */
|
|
79
|
+
#define msa_st1_lane_s8(__a, __b, __c) (*((int8_t *)(__a)) = __b[__c])
|
|
80
|
+
#define msa_st1_lane_s16(__a, __b, __c) (*((int16_t *)(__a)) = __b[__c])
|
|
81
|
+
#define msa_st1_lane_s32(__a, __b, __c) (*((int32_t *)(__a)) = __b[__c])
|
|
82
|
+
#define msa_st1_lane_s64(__a, __b, __c) (*((int64_t *)(__a)) = __b[__c])
|
|
83
|
+
#define msa_st1_lane_u8(__a, __b, __c) (*((uint8_t *)(__a)) = __b[__c])
|
|
84
|
+
#define msa_st1_lane_u16(__a, __b, __c) (*((uint16_t *)(__a)) = __b[__c])
|
|
85
|
+
#define msa_st1_lane_u32(__a, __b, __c) (*((uint32_t *)(__a)) = __b[__c])
|
|
86
|
+
#define msa_st1_lane_u64(__a, __b, __c) (*((uint64_t *)(__a)) = __b[__c])
|
|
87
|
+
#define msa_st1_lane_f32(__a, __b, __c) (*((float *)(__a)) = __b[__c])
|
|
88
|
+
#define msa_st1_lane_f64(__a, __b, __c) (*((double *)(__a)) = __b[__c])
|
|
89
|
+
#define msa_st1q_lane_s8(__a, __b, __c) \
|
|
90
|
+
(*((int8_t *)(__a)) = (int8_t)__builtin_msa_copy_s_b(__b, __c))
|
|
91
|
+
#define msa_st1q_lane_s16(__a, __b, __c) \
|
|
92
|
+
(*((int16_t *)(__a)) = (int16_t)__builtin_msa_copy_s_h(__b, __c))
|
|
93
|
+
#define msa_st1q_lane_s32(__a, __b, __c) \
|
|
94
|
+
(*((int32_t *)(__a)) = __builtin_msa_copy_s_w(__b, __c))
|
|
95
|
+
#define msa_st1q_lane_s64(__a, __b, __c) \
|
|
96
|
+
(*((int64_t *)(__a)) = __builtin_msa_copy_s_d(__b, __c))
|
|
97
|
+
#define msa_st1q_lane_u8(__a, __b, __c) \
|
|
98
|
+
(*((uint8_t *)(__a)) = (uint8_t)__builtin_msa_copy_u_b((v16i8)(__b), __c))
|
|
99
|
+
#define msa_st1q_lane_u16(__a, __b, __c) \
|
|
100
|
+
(*((uint16_t *)(__a)) = (uint16_t)__builtin_msa_copy_u_h((v8i16)(__b), __c))
|
|
101
|
+
#define msa_st1q_lane_u32(__a, __b, __c) \
|
|
102
|
+
(*((uint32_t *)(__a)) = __builtin_msa_copy_u_w((v4i32)(__b), __c))
|
|
103
|
+
#define msa_st1q_lane_u64(__a, __b, __c) \
|
|
104
|
+
(*((uint64_t *)(__a)) = __builtin_msa_copy_u_d((v2i64)(__b), __c))
|
|
105
|
+
#define msa_st1q_lane_f32(__a, __b, __c) (*((float *)(__a)) = __b[__c])
|
|
106
|
+
#define msa_st1q_lane_f64(__a, __b, __c) (*((double *)(__a)) = __b[__c])
|
|
107
|
+
|
|
108
|
+
/* Duplicate elements for 64-bit doubleword vectors */
|
|
109
|
+
#define msa_dup_n_s8(__a) \
|
|
110
|
+
((v8i8)__builtin_msa_copy_s_d((v2i64)__builtin_msa_fill_b((int32_t)(__a)), 0))
|
|
111
|
+
#define msa_dup_n_s16(__a) \
|
|
112
|
+
((v4i16)__builtin_msa_copy_s_d((v2i64)__builtin_msa_fill_h((int32_t)(__a)), \
|
|
113
|
+
0))
|
|
114
|
+
#define msa_dup_n_s32(__a) ((v2i32){__a, __a})
|
|
115
|
+
#define msa_dup_n_s64(__a) ((v1i64){__a})
|
|
116
|
+
#define msa_dup_n_u8(__a) \
|
|
117
|
+
((v8u8)__builtin_msa_copy_u_d((v2i64)__builtin_msa_fill_b((int32_t)(__a)), 0))
|
|
118
|
+
#define msa_dup_n_u16(__a) \
|
|
119
|
+
((v4u16)__builtin_msa_copy_u_d((v2i64)__builtin_msa_fill_h((int32_t)(__a)), \
|
|
120
|
+
0))
|
|
121
|
+
#define msa_dup_n_u32(__a) ((v2u32){__a, __a})
|
|
122
|
+
#define msa_dup_n_u64(__a) ((v1u64){__a})
|
|
123
|
+
#define msa_dup_n_f32(__a) ((v2f32){__a, __a})
|
|
124
|
+
#define msa_dup_n_f64(__a) ((v1f64){__a})
|
|
125
|
+
|
|
126
|
+
/* Duplicate elements for 128-bit quadword vectors */
|
|
127
|
+
#define msa_dupq_n_s8(__a) (__builtin_msa_fill_b((int32_t)(__a)))
|
|
128
|
+
#define msa_dupq_n_s16(__a) (__builtin_msa_fill_h((int32_t)(__a)))
|
|
129
|
+
#define msa_dupq_n_s32(__a) (__builtin_msa_fill_w((int32_t)(__a)))
|
|
130
|
+
#define msa_dupq_n_s64(__a) (__builtin_msa_fill_d((int64_t)(__a)))
|
|
131
|
+
#define msa_dupq_n_u8(__a) ((v16u8)__builtin_msa_fill_b((int32_t)(__a)))
|
|
132
|
+
#define msa_dupq_n_u16(__a) ((v8u16)__builtin_msa_fill_h((int32_t)(__a)))
|
|
133
|
+
#define msa_dupq_n_u32(__a) ((v4u32)__builtin_msa_fill_w((int32_t)(__a)))
|
|
134
|
+
#define msa_dupq_n_u64(__a) ((v2u64)__builtin_msa_fill_d((int64_t)(__a)))
|
|
135
|
+
#define msa_dupq_n_f32(__a) ((v4f32){__a, __a, __a, __a})
|
|
136
|
+
#define msa_dupq_n_f64(__a) ((v2f64){__a, __a})
|
|
137
|
+
#define msa_dupq_lane_s8(__a, __b) (__builtin_msa_splat_b(__a, __b))
|
|
138
|
+
#define msa_dupq_lane_s16(__a, __b) (__builtin_msa_splat_h(__a, __b))
|
|
139
|
+
#define msa_dupq_lane_s32(__a, __b) (__builtin_msa_splat_w(__a, __b))
|
|
140
|
+
#define msa_dupq_lane_s64(__a, __b) (__builtin_msa_splat_d(__a, __b))
|
|
141
|
+
#define msa_dupq_lane_u8(__a, __b) \
|
|
142
|
+
((v16u8)__builtin_msa_splat_b((v16i8)(__a), __b))
|
|
143
|
+
#define msa_dupq_lane_u16(__a, __b) \
|
|
144
|
+
((v8u16)__builtin_msa_splat_h((v8i16)(__a), __b))
|
|
145
|
+
#define msa_dupq_lane_u32(__a, __b) \
|
|
146
|
+
((v4u32)__builtin_msa_splat_w((v4i32)(__a), __b))
|
|
147
|
+
#define msa_dupq_lane_u64(__a, __b) \
|
|
148
|
+
((v2u64)__builtin_msa_splat_d((v2i64)(__a), __b))
|
|
149
|
+
|
|
150
|
+
/* Create a 64 bits vector */
|
|
151
|
+
#define msa_create_s8(__a) ((v8i8)((uint64_t)(__a)))
|
|
152
|
+
#define msa_create_s16(__a) ((v4i16)((uint64_t)(__a)))
|
|
153
|
+
#define msa_create_s32(__a) ((v2i32)((uint64_t)(__a)))
|
|
154
|
+
#define msa_create_s64(__a) ((v1i64)((uint64_t)(__a)))
|
|
155
|
+
#define msa_create_u8(__a) ((v8u8)((uint64_t)(__a)))
|
|
156
|
+
#define msa_create_u16(__a) ((v4u16)((uint64_t)(__a)))
|
|
157
|
+
#define msa_create_u32(__a) ((v2u32)((uint64_t)(__a)))
|
|
158
|
+
#define msa_create_u64(__a) ((v1u64)((uint64_t)(__a)))
|
|
159
|
+
#define msa_create_f32(__a) ((v2f32)((uint64_t)(__a)))
|
|
160
|
+
#define msa_create_f64(__a) ((v1f64)((uint64_t)(__a)))
|
|
161
|
+
|
|
162
|
+
/* Sign extends or zero extends each element in a 64 bits vector to twice its
|
|
163
|
+
* original length, and places the results in a 128 bits vector. */
|
|
164
|
+
/*Transform v8i8 to v8i16*/
|
|
165
|
+
#define msa_movl_s8(__a) \
|
|
166
|
+
((v8i16){(__a)[0], (__a)[1], (__a)[2], (__a)[3], (__a)[4], (__a)[5], \
|
|
167
|
+
(__a)[6], (__a)[7]})
|
|
168
|
+
|
|
169
|
+
/*Transform v8u8 to v8u16*/
|
|
170
|
+
#define msa_movl_u8(__a) \
|
|
171
|
+
((v8u16){(__a)[0], (__a)[1], (__a)[2], (__a)[3], (__a)[4], (__a)[5], \
|
|
172
|
+
(__a)[6], (__a)[7]})
|
|
173
|
+
|
|
174
|
+
/*Transform v4i16 to v8i16*/
|
|
175
|
+
#define msa_movl_s16(__a) ((v4i32){(__a)[0], (__a)[1], (__a)[2], (__a)[3]})
|
|
176
|
+
|
|
177
|
+
/*Transform v2i32 to v4i32*/
|
|
178
|
+
#define msa_movl_s32(__a) ((v2i64){(__a)[0], (__a)[1]})
|
|
179
|
+
|
|
180
|
+
/*Transform v4u16 to v8u16*/
|
|
181
|
+
#define msa_movl_u16(__a) ((v4u32){(__a)[0], (__a)[1], (__a)[2], (__a)[3]})
|
|
182
|
+
|
|
183
|
+
/*Transform v2u32 to v4u32*/
|
|
184
|
+
#define msa_movl_u32(__a) ((v2u64){(__a)[0], (__a)[1]})
|
|
185
|
+
|
|
186
|
+
/* Copies the least significant half of each element of a 128 bits vector into
|
|
187
|
+
* the corresponding elements of a 64 bits vector. */
|
|
188
|
+
#define msa_movn_s16(__a) \
|
|
189
|
+
({ \
|
|
190
|
+
v16i8 __d = __builtin_msa_pckev_b(__builtin_msa_fill_b(0), (v16i8)(__a)); \
|
|
191
|
+
(v8i8) __builtin_msa_copy_s_d((v2i64)__d, 0); \
|
|
192
|
+
})
|
|
193
|
+
|
|
194
|
+
#define msa_movn_s32(__a) \
|
|
195
|
+
({ \
|
|
196
|
+
v8i16 __d = __builtin_msa_pckev_h(__builtin_msa_fill_h(0), (v8i16)(__a)); \
|
|
197
|
+
(v4i16) __builtin_msa_copy_s_d((v2i64)__d, 0); \
|
|
198
|
+
})
|
|
199
|
+
|
|
200
|
+
#define msa_movn_s64(__a) \
|
|
201
|
+
({ \
|
|
202
|
+
v4i32 __d = __builtin_msa_pckev_w(__builtin_msa_fill_w(0), (v4i32)(__a)); \
|
|
203
|
+
(v2i32) __builtin_msa_copy_s_d((v2i64)__d, 0); \
|
|
204
|
+
})
|
|
205
|
+
|
|
206
|
+
#define msa_movn_u16(__a) \
|
|
207
|
+
({ \
|
|
208
|
+
v16i8 __d = __builtin_msa_pckev_b(__builtin_msa_fill_b(0), (v16i8)(__a)); \
|
|
209
|
+
(v8u8) __builtin_msa_copy_u_d((v2i64)__d, 0); \
|
|
210
|
+
})
|
|
211
|
+
|
|
212
|
+
#define msa_movn_u32(__a) \
|
|
213
|
+
({ \
|
|
214
|
+
v8i16 __d = __builtin_msa_pckev_h(__builtin_msa_fill_h(0), (v8i16)(__a)); \
|
|
215
|
+
(v4u16) __builtin_msa_copy_u_d((v2i64)__d, 0); \
|
|
216
|
+
})
|
|
217
|
+
|
|
218
|
+
#define msa_movn_u64(__a) \
|
|
219
|
+
({ \
|
|
220
|
+
v4i32 __d = __builtin_msa_pckev_w(__builtin_msa_fill_w(0), (v4i32)(__a)); \
|
|
221
|
+
(v2u32) __builtin_msa_copy_u_d((v2i64)__d, 0); \
|
|
222
|
+
})
|
|
223
|
+
|
|
224
|
+
/* qmovn */
|
|
225
|
+
#define msa_qmovn_s16(__a) \
|
|
226
|
+
({ \
|
|
227
|
+
v16i8 __d = \
|
|
228
|
+
__builtin_msa_pckev_b(__builtin_msa_fill_b(0), \
|
|
229
|
+
(v16i8)__builtin_msa_sat_s_h((v8i16)(__a), 7)); \
|
|
230
|
+
(v8i8) __builtin_msa_copy_s_d((v2i64)__d, 0); \
|
|
231
|
+
})
|
|
232
|
+
|
|
233
|
+
#define msa_qmovn_s32(__a) \
|
|
234
|
+
({ \
|
|
235
|
+
v8i16 __d = \
|
|
236
|
+
__builtin_msa_pckev_h(__builtin_msa_fill_h(0), \
|
|
237
|
+
(v8i16)__builtin_msa_sat_s_w((v4i32)(__a), 15)); \
|
|
238
|
+
(v4i16) __builtin_msa_copy_s_d((v2i64)__d, 0); \
|
|
239
|
+
})
|
|
240
|
+
|
|
241
|
+
#define msa_qmovn_s64(__a) \
|
|
242
|
+
({ \
|
|
243
|
+
v4i32 __d = \
|
|
244
|
+
__builtin_msa_pckev_w(__builtin_msa_fill_w(0), \
|
|
245
|
+
(v4i32)__builtin_msa_sat_s_d((v2i64)(__a), 31)); \
|
|
246
|
+
(v2i32) __builtin_msa_copy_s_d((v2i64)__d, 0); \
|
|
247
|
+
})
|
|
248
|
+
|
|
249
|
+
#define msa_qmovn_u16(__a) \
|
|
250
|
+
({ \
|
|
251
|
+
v16i8 __d = \
|
|
252
|
+
__builtin_msa_pckev_b(__builtin_msa_fill_b(0), \
|
|
253
|
+
(v16i8)__builtin_msa_sat_u_h((v8u16)(__a), 7)); \
|
|
254
|
+
(v8u8) __builtin_msa_copy_u_d((v2i64)__d, 0); \
|
|
255
|
+
})
|
|
256
|
+
|
|
257
|
+
#define msa_qmovn_u32(__a) \
|
|
258
|
+
({ \
|
|
259
|
+
v8i16 __d = \
|
|
260
|
+
__builtin_msa_pckev_h(__builtin_msa_fill_h(0), \
|
|
261
|
+
(v8i16)__builtin_msa_sat_u_w((v4u32)(__a), 15)); \
|
|
262
|
+
(v4u16) __builtin_msa_copy_u_d((v2i64)__d, 0); \
|
|
263
|
+
})
|
|
264
|
+
|
|
265
|
+
#define msa_qmovn_u64(__a) \
|
|
266
|
+
({ \
|
|
267
|
+
v4i32 __d = \
|
|
268
|
+
__builtin_msa_pckev_w(__builtin_msa_fill_w(0), \
|
|
269
|
+
(v4i32)__builtin_msa_sat_u_d((v2u64)(__a), 31)); \
|
|
270
|
+
(v2u32) __builtin_msa_copy_u_d((v2i64)__d, 0); \
|
|
271
|
+
})
|
|
272
|
+
|
|
273
|
+
/* qmovun */
|
|
274
|
+
#define msa_qmovun_s16(__a) \
|
|
275
|
+
({ \
|
|
276
|
+
v8i16 __d = __builtin_msa_max_s_h(__builtin_msa_fill_h(0), (v8i16)(__a)); \
|
|
277
|
+
v16i8 __e = __builtin_msa_pckev_b( \
|
|
278
|
+
__builtin_msa_fill_b(0), (v16i8)__builtin_msa_sat_u_h((v8u16)__d, 7)); \
|
|
279
|
+
(v8u8) __builtin_msa_copy_u_d((v2i64)__e, 0); \
|
|
280
|
+
})
|
|
281
|
+
|
|
282
|
+
#define msa_qmovun_s32(__a) \
|
|
283
|
+
({ \
|
|
284
|
+
v4i32 __d = __builtin_msa_max_s_w(__builtin_msa_fill_w(0), (v4i32)(__a)); \
|
|
285
|
+
v8i16 __e = \
|
|
286
|
+
__builtin_msa_pckev_h(__builtin_msa_fill_h(0), \
|
|
287
|
+
(v8i16)__builtin_msa_sat_u_w((v4u32)__d, 15)); \
|
|
288
|
+
(v4u16) __builtin_msa_copy_u_d((v2i64)__e, 0); \
|
|
289
|
+
})
|
|
290
|
+
|
|
291
|
+
#define msa_qmovun_s64(__a) \
|
|
292
|
+
({ \
|
|
293
|
+
v2i64 __d = __builtin_msa_max_s_d(__builtin_msa_fill_d(0), (v2i64)(__a)); \
|
|
294
|
+
v4i32 __e = \
|
|
295
|
+
__builtin_msa_pckev_w(__builtin_msa_fill_w(0), \
|
|
296
|
+
(v4i32)__builtin_msa_sat_u_d((v2u64)__d, 31)); \
|
|
297
|
+
(v2u32) __builtin_msa_copy_u_d((v2i64)__e, 0); \
|
|
298
|
+
})
|
|
299
|
+
|
|
300
|
+
/* Right shift elements in a 128 bits vector by an immediate value, and places
|
|
301
|
+
* the results in a 64 bits vector. */
|
|
302
|
+
#define msa_shrn_n_s16(__a, __b) \
|
|
303
|
+
({ \
|
|
304
|
+
v16i8 __d = __builtin_msa_pckev_b( \
|
|
305
|
+
__builtin_msa_fill_b(0), \
|
|
306
|
+
(v16i8)__builtin_msa_srai_h((v8i16)(__a), (int)(__b))); \
|
|
307
|
+
(v8i8) __builtin_msa_copy_s_d((v2i64)__d, 0); \
|
|
308
|
+
})
|
|
309
|
+
|
|
310
|
+
#define msa_shrn_n_s32(__a, __b) \
|
|
311
|
+
({ \
|
|
312
|
+
v8i16 __d = __builtin_msa_pckev_h( \
|
|
313
|
+
__builtin_msa_fill_h(0), \
|
|
314
|
+
(v8i16)__builtin_msa_srai_w((v4i32)(__a), (int)(__b))); \
|
|
315
|
+
(v4i16) __builtin_msa_copy_s_d((v2i64)__d, 0); \
|
|
316
|
+
})
|
|
317
|
+
|
|
318
|
+
#define msa_shrn_n_s64(__a, __b) \
|
|
319
|
+
({ \
|
|
320
|
+
v4i32 __d = __builtin_msa_pckev_w( \
|
|
321
|
+
__builtin_msa_fill_w(0), \
|
|
322
|
+
(v4i32)__builtin_msa_srai_d((v2i64)(__a), (int)(__b))); \
|
|
323
|
+
(v2i32) __builtin_msa_copy_s_d((v2i64)__d, 0); \
|
|
324
|
+
})
|
|
325
|
+
|
|
326
|
+
#define msa_shrn_n_u16(__a, __b) \
|
|
327
|
+
({ \
|
|
328
|
+
v16i8 __d = __builtin_msa_pckev_b( \
|
|
329
|
+
__builtin_msa_fill_b(0), \
|
|
330
|
+
(v16i8)__builtin_msa_srli_h((v8i16)(__a), (int)(__b))); \
|
|
331
|
+
(v8u8) __builtin_msa_copy_u_d((v2i64)__d, 0); \
|
|
332
|
+
})
|
|
333
|
+
|
|
334
|
+
#define msa_shrn_n_u32(__a, __b) \
|
|
335
|
+
({ \
|
|
336
|
+
v8i16 __d = __builtin_msa_pckev_h( \
|
|
337
|
+
__builtin_msa_fill_h(0), \
|
|
338
|
+
(v8i16)__builtin_msa_srli_w((v4i32)(__a), (int)(__b))); \
|
|
339
|
+
(v4u16) __builtin_msa_copy_u_d((v2i64)__d, 0); \
|
|
340
|
+
})
|
|
341
|
+
|
|
342
|
+
#define msa_shrn_n_u64(__a, __b) \
|
|
343
|
+
({ \
|
|
344
|
+
v4i32 __d = __builtin_msa_pckev_w( \
|
|
345
|
+
__builtin_msa_fill_w(0), \
|
|
346
|
+
(v4i32)__builtin_msa_srli_d((v2i64)(__a), (int)(__b))); \
|
|
347
|
+
(v2u32) __builtin_msa_copy_u_d((v2i64)__d, 0); \
|
|
348
|
+
})
|
|
349
|
+
|
|
350
|
+
/* Right shift elements in a 128 bits vector by an immediate value, and places
|
|
351
|
+
* the results in a 64 bits vector. */
|
|
352
|
+
#define msa_rshrn_n_s16(__a, __b) \
|
|
353
|
+
({ \
|
|
354
|
+
v16i8 __d = __builtin_msa_pckev_b( \
|
|
355
|
+
__builtin_msa_fill_b(0), \
|
|
356
|
+
(v16i8)__builtin_msa_srari_h((v8i16)(__a), (int)__b)); \
|
|
357
|
+
(v8i8) __builtin_msa_copy_s_d((v2i64)__d, 0); \
|
|
358
|
+
})
|
|
359
|
+
|
|
360
|
+
#define msa_rshrn_n_s32(__a, __b) \
|
|
361
|
+
({ \
|
|
362
|
+
v8i16 __d = __builtin_msa_pckev_h( \
|
|
363
|
+
__builtin_msa_fill_h(0), \
|
|
364
|
+
(v8i16)__builtin_msa_srari_w((v4i32)(__a), (int)__b)); \
|
|
365
|
+
(v4i16) __builtin_msa_copy_s_d((v2i64)__d, 0); \
|
|
366
|
+
})
|
|
367
|
+
|
|
368
|
+
#define msa_rshrn_n_s64(__a, __b) \
|
|
369
|
+
({ \
|
|
370
|
+
v4i32 __d = __builtin_msa_pckev_w( \
|
|
371
|
+
__builtin_msa_fill_w(0), \
|
|
372
|
+
(v4i32)__builtin_msa_srari_d((v2i64)(__a), (int)__b)); \
|
|
373
|
+
(v2i32) __builtin_msa_copy_s_d((v2i64)__d, 0); \
|
|
374
|
+
})
|
|
375
|
+
|
|
376
|
+
#define msa_rshrn_n_u16(__a, __b) \
|
|
377
|
+
({ \
|
|
378
|
+
v16i8 __d = __builtin_msa_pckev_b( \
|
|
379
|
+
__builtin_msa_fill_b(0), \
|
|
380
|
+
(v16i8)__builtin_msa_srlri_h((v8i16)(__a), (int)__b)); \
|
|
381
|
+
(v8u8) __builtin_msa_copy_u_d((v2i64)__d, 0); \
|
|
382
|
+
})
|
|
383
|
+
|
|
384
|
+
#define msa_rshrn_n_u32(__a, __b) \
|
|
385
|
+
({ \
|
|
386
|
+
v8i16 __d = __builtin_msa_pckev_h( \
|
|
387
|
+
__builtin_msa_fill_h(0), \
|
|
388
|
+
(v8i16)__builtin_msa_srlri_w((v4i32)(__a), (int)__b)); \
|
|
389
|
+
(v4u16) __builtin_msa_copy_u_d((v2i64)__d, 0); \
|
|
390
|
+
})
|
|
391
|
+
|
|
392
|
+
#define msa_rshrn_n_u64(__a, __b) \
|
|
393
|
+
({ \
|
|
394
|
+
v4i32 __d = __builtin_msa_pckev_w( \
|
|
395
|
+
__builtin_msa_fill_w(0), \
|
|
396
|
+
(v4i32)__builtin_msa_srlri_d((v2i64)(__a), (int)__b)); \
|
|
397
|
+
(v2u32) __builtin_msa_copy_u_d((v2i64)__d, 0); \
|
|
398
|
+
})
|
|
399
|
+
|
|
400
|
+
/* Right shift elements in a 128 bits vector by an immediate value, saturate the
|
|
401
|
+
* results and them in a 64 bits vector. */
|
|
402
|
+
#define msa_qrshrn_n_s16(__a, __b) \
|
|
403
|
+
({ \
|
|
404
|
+
v8i16 __d = __builtin_msa_sat_s_h( \
|
|
405
|
+
__builtin_msa_srari_h((v8i16)(__a), (int)(__b)), 7); \
|
|
406
|
+
v16i8 __e = __builtin_msa_pckev_b(__builtin_msa_fill_b(0), (v16i8)__d); \
|
|
407
|
+
(v8i8) __builtin_msa_copy_s_d((v2i64)__e, 0); \
|
|
408
|
+
})
|
|
409
|
+
|
|
410
|
+
#define msa_qrshrn_n_s32(__a, __b) \
|
|
411
|
+
({ \
|
|
412
|
+
v4i32 __d = __builtin_msa_sat_s_w( \
|
|
413
|
+
__builtin_msa_srari_w((v4i32)(__a), (int)(__b)), 15); \
|
|
414
|
+
v8i16 __e = __builtin_msa_pckev_h(__builtin_msa_fill_h(0), (v8i16)__d); \
|
|
415
|
+
(v4i16) __builtin_msa_copy_s_d((v2i64)__e, 0); \
|
|
416
|
+
})
|
|
417
|
+
|
|
418
|
+
#define msa_qrshrn_n_s64(__a, __b) \
|
|
419
|
+
({ \
|
|
420
|
+
v2i64 __d = __builtin_msa_sat_s_d( \
|
|
421
|
+
__builtin_msa_srari_d((v2i64)(__a), (int)(__b)), 31); \
|
|
422
|
+
v4i32 __e = __builtin_msa_pckev_w(__builtin_msa_fill_w(0), (v4i32)__d); \
|
|
423
|
+
(v2i32) __builtin_msa_copy_s_d((v2i64)__e, 0); \
|
|
424
|
+
})
|
|
425
|
+
|
|
426
|
+
#define msa_qrshrn_n_u16(__a, __b) \
|
|
427
|
+
({ \
|
|
428
|
+
v8u16 __d = __builtin_msa_sat_u_h( \
|
|
429
|
+
(v8u16)__builtin_msa_srlri_h((v8i16)(__a), (int)(__b)), 7); \
|
|
430
|
+
v16i8 __e = __builtin_msa_pckev_b(__builtin_msa_fill_b(0), (v16i8)__d); \
|
|
431
|
+
(v8u8) __builtin_msa_copy_u_d((v2i64)__e, 0); \
|
|
432
|
+
})
|
|
433
|
+
|
|
434
|
+
#define msa_qrshrn_n_u32(__a, __b) \
|
|
435
|
+
({ \
|
|
436
|
+
v4u32 __d = __builtin_msa_sat_u_w( \
|
|
437
|
+
(v4u32)__builtin_msa_srlri_w((v4i32)(__a), (int)(__b)), 15); \
|
|
438
|
+
v8i16 __e = __builtin_msa_pckev_h(__builtin_msa_fill_h(0), (v8i16)__d); \
|
|
439
|
+
(v4u16) __builtin_msa_copy_u_d((v2i64)__e, 0); \
|
|
440
|
+
})
|
|
441
|
+
|
|
442
|
+
#define msa_qrshrn_n_u64(__a, __b) \
|
|
443
|
+
({ \
|
|
444
|
+
v2u64 __d = __builtin_msa_sat_u_d( \
|
|
445
|
+
(v2u64)__builtin_msa_srlri_d((v2i64)(__a), (int)(__b)), 31); \
|
|
446
|
+
v4i32 __e = __builtin_msa_pckev_w(__builtin_msa_fill_w(0), (v4i32)__d); \
|
|
447
|
+
(v2u32) __builtin_msa_copy_u_d((v2i64)__e, 0); \
|
|
448
|
+
})
|
|
449
|
+
|
|
450
|
+
/* Right shift elements in a 128 bits vector by an immediate value, saturate the
|
|
451
|
+
results and them in a 64 bits vector. Input is signed and output is unsigned.
|
|
452
|
+
*/
|
|
453
|
+
#define msa_qrshrun_n_s16(__a, __b) \
|
|
454
|
+
({ \
|
|
455
|
+
v8i16 __d = __builtin_msa_srlri_h( \
|
|
456
|
+
__builtin_msa_max_s_h(__builtin_msa_fill_h(0), (v8i16)(__a)), \
|
|
457
|
+
(int)(__b)); \
|
|
458
|
+
v16i8 __e = __builtin_msa_pckev_b( \
|
|
459
|
+
__builtin_msa_fill_b(0), (v16i8)__builtin_msa_sat_u_h((v8u16)__d, 7)); \
|
|
460
|
+
(v8u8) __builtin_msa_copy_u_d((v2i64)__e, 0); \
|
|
461
|
+
})
|
|
462
|
+
|
|
463
|
+
#define msa_qrshrun_n_s32(__a, __b) \
|
|
464
|
+
({ \
|
|
465
|
+
v4i32 __d = __builtin_msa_srlri_w( \
|
|
466
|
+
__builtin_msa_max_s_w(__builtin_msa_fill_w(0), (v4i32)(__a)), \
|
|
467
|
+
(int)(__b)); \
|
|
468
|
+
v8i16 __e = \
|
|
469
|
+
__builtin_msa_pckev_h(__builtin_msa_fill_h(0), \
|
|
470
|
+
(v8i16)__builtin_msa_sat_u_w((v4u32)__d, 15)); \
|
|
471
|
+
(v4u16) __builtin_msa_copy_u_d((v2i64)__e, 0); \
|
|
472
|
+
})
|
|
473
|
+
|
|
474
|
+
#define msa_qrshrun_n_s64(__a, __b) \
|
|
475
|
+
({ \
|
|
476
|
+
v2i64 __d = __builtin_msa_srlri_d( \
|
|
477
|
+
__builtin_msa_max_s_d(__builtin_msa_fill_d(0), (v2i64)(__a)), \
|
|
478
|
+
(int)(__b)); \
|
|
479
|
+
v4i32 __e = \
|
|
480
|
+
__builtin_msa_pckev_w(__builtin_msa_fill_w(0), \
|
|
481
|
+
(v4i32)__builtin_msa_sat_u_d((v2u64)__d, 31)); \
|
|
482
|
+
(v2u32) __builtin_msa_copy_u_d((v2i64)__e, 0); \
|
|
483
|
+
})
|
|
484
|
+
|
|
485
|
+
/* pack */
|
|
486
|
+
#define msa_pack_s16(__a, __b) \
|
|
487
|
+
(__builtin_msa_pckev_b((v16i8)(__b), (v16i8)(__a)))
|
|
488
|
+
#define msa_pack_s32(__a, __b) \
|
|
489
|
+
(__builtin_msa_pckev_h((v8i16)(__b), (v8i16)(__a)))
|
|
490
|
+
#define msa_pack_s64(__a, __b) \
|
|
491
|
+
(__builtin_msa_pckev_w((v4i32)(__b), (v4i32)(__a)))
|
|
492
|
+
#define msa_pack_u16(__a, __b) \
|
|
493
|
+
((v16u8)__builtin_msa_pckev_b((v16i8)(__b), (v16i8)(__a)))
|
|
494
|
+
#define msa_pack_u32(__a, __b) \
|
|
495
|
+
((v8u16)__builtin_msa_pckev_h((v8i16)(__b), (v8i16)(__a)))
|
|
496
|
+
#define msa_pack_u64(__a, __b) \
|
|
497
|
+
((v4u32)__builtin_msa_pckev_w((v4i32)(__b), (v4i32)(__a)))
|
|
498
|
+
|
|
499
|
+
/* qpack */
|
|
500
|
+
#define msa_qpack_s16(__a, __b) \
|
|
501
|
+
(__builtin_msa_pckev_b((v16i8)__builtin_msa_sat_s_h((v8i16)(__b), 7), \
|
|
502
|
+
(v16i8)__builtin_msa_sat_s_h((v8i16)(__a), 7)))
|
|
503
|
+
#define msa_qpack_s32(__a, __b) \
|
|
504
|
+
(__builtin_msa_pckev_h((v8i16)__builtin_msa_sat_s_w((v4i32)(__b), 15), \
|
|
505
|
+
(v8i16)__builtin_msa_sat_s_w((v4i32)(__a), 15)))
|
|
506
|
+
#define msa_qpack_s64(__a, __b) \
|
|
507
|
+
(__builtin_msa_pckev_w((v4i32)__builtin_msa_sat_s_d((v2i64)(__b), 31), \
|
|
508
|
+
(v4i32)__builtin_msa_sat_s_d((v2i64)(__a), 31)))
|
|
509
|
+
#define msa_qpack_u16(__a, __b) \
|
|
510
|
+
((v16u8)__builtin_msa_pckev_b( \
|
|
511
|
+
(v16i8)__builtin_msa_sat_u_h((v8u16)(__b), 7), \
|
|
512
|
+
(v16i8)__builtin_msa_sat_u_h((v8u16)(__a), 7)))
|
|
513
|
+
#define msa_qpack_u32(__a, __b) \
|
|
514
|
+
((v8u16)__builtin_msa_pckev_h( \
|
|
515
|
+
(v8i16)__builtin_msa_sat_u_w((v4u32)(__b), 15), \
|
|
516
|
+
(v8i16)__builtin_msa_sat_u_w((v4u32)(__a), 15)))
|
|
517
|
+
#define msa_qpack_u64(__a, __b) \
|
|
518
|
+
((v4u32)__builtin_msa_pckev_w( \
|
|
519
|
+
(v4i32)__builtin_msa_sat_u_d((v2u64)(__b), 31), \
|
|
520
|
+
(v4i32)__builtin_msa_sat_u_d((v2u64)(__a), 31)))
|
|
521
|
+
|
|
522
|
+
/* qpacku */
|
|
523
|
+
#define msa_qpacku_s16(__a, __b) \
|
|
524
|
+
((v16u8)__builtin_msa_pckev_b( \
|
|
525
|
+
(v16i8)__builtin_msa_sat_u_h( \
|
|
526
|
+
(v8u16)(__builtin_msa_max_s_h(__builtin_msa_fill_h(0), \
|
|
527
|
+
(v8i16)(__b))), \
|
|
528
|
+
7), \
|
|
529
|
+
(v16i8)__builtin_msa_sat_u_h( \
|
|
530
|
+
(v8u16)(__builtin_msa_max_s_h(__builtin_msa_fill_h(0), \
|
|
531
|
+
(v8i16)(__a))), \
|
|
532
|
+
7)))
|
|
533
|
+
#define msa_qpacku_s32(__a, __b) \
|
|
534
|
+
((v8u16)__builtin_msa_pckev_h( \
|
|
535
|
+
(v8i16)__builtin_msa_sat_u_w( \
|
|
536
|
+
(v4u32)(__builtin_msa_max_s_w(__builtin_msa_fill_w(0), \
|
|
537
|
+
(v4i32)(__b))), \
|
|
538
|
+
15), \
|
|
539
|
+
(v8i16)__builtin_msa_sat_u_w( \
|
|
540
|
+
(v4u32)(__builtin_msa_max_s_w(__builtin_msa_fill_w(0), \
|
|
541
|
+
(v4i32)(__a))), \
|
|
542
|
+
15)))
|
|
543
|
+
#define msa_qpacku_s64(__a, __b) \
|
|
544
|
+
((v4u32)__builtin_msa_pckev_w( \
|
|
545
|
+
(v4i32)__builtin_msa_sat_u_d( \
|
|
546
|
+
(v2u64)(__builtin_msa_max_s_d(__builtin_msa_fill_d(0), \
|
|
547
|
+
(v2i64)(__b))), \
|
|
548
|
+
31), \
|
|
549
|
+
(v4i32)__builtin_msa_sat_u_d( \
|
|
550
|
+
(v2u64)(__builtin_msa_max_s_d(__builtin_msa_fill_d(0), \
|
|
551
|
+
(v2i64)(__a))), \
|
|
552
|
+
31)))
|
|
553
|
+
|
|
554
|
+
/* packr */
|
|
555
|
+
#define msa_packr_s16(__a, __b, __c) \
|
|
556
|
+
(__builtin_msa_pckev_b( \
|
|
557
|
+
(v16i8)__builtin_msa_srai_h((v8i16)(__b), (int)(__c)), \
|
|
558
|
+
(v16i8)__builtin_msa_srai_h((v8i16)(__a), (int)(__c))))
|
|
559
|
+
#define msa_packr_s32(__a, __b, __c) \
|
|
560
|
+
(__builtin_msa_pckev_h( \
|
|
561
|
+
(v8i16)__builtin_msa_srai_w((v4i32)(__b), (int)(__c)), \
|
|
562
|
+
(v8i16)__builtin_msa_srai_w((v4i32)(__a), (int)(__c))))
|
|
563
|
+
#define msa_packr_s64(__a, __b, __c) \
|
|
564
|
+
(__builtin_msa_pckev_w( \
|
|
565
|
+
(v4i32)__builtin_msa_srai_d((v2i64)(__b), (int)(__c)), \
|
|
566
|
+
(v4i32)__builtin_msa_srai_d((v2i64)(__a), (int)(__c))))
|
|
567
|
+
#define msa_packr_u16(__a, __b, __c) \
|
|
568
|
+
((v16u8)__builtin_msa_pckev_b( \
|
|
569
|
+
(v16i8)__builtin_msa_srli_h((v8i16)(__b), (int)(__c)), \
|
|
570
|
+
(v16i8)__builtin_msa_srli_h((v8i16)(__a), (int)(__c))))
|
|
571
|
+
#define msa_packr_u32(__a, __b, __c) \
|
|
572
|
+
((v8u16)__builtin_msa_pckev_h( \
|
|
573
|
+
(v8i16)__builtin_msa_srli_w((v4i32)(__b), (int)(__c)), \
|
|
574
|
+
(v8i16)__builtin_msa_srli_w((v4i32)(__a), (int)(__c))))
|
|
575
|
+
#define msa_packr_u64(__a, __b, __c) \
|
|
576
|
+
((v4u32)__builtin_msa_pckev_w( \
|
|
577
|
+
(v4i32)__builtin_msa_srli_d((v2i64)(__b), (int)(__c)), \
|
|
578
|
+
(v4i32)__builtin_msa_srli_d((v2i64)(__a), (int)(__c))))
|
|
579
|
+
|
|
580
|
+
/* rpackr */
|
|
581
|
+
#define msa_rpackr_s16(__a, __b, __c) \
|
|
582
|
+
(__builtin_msa_pckev_b( \
|
|
583
|
+
(v16i8)__builtin_msa_srari_h((v8i16)(__b), (int)(__c)), \
|
|
584
|
+
(v16i8)__builtin_msa_srari_h((v8i16)(__a), (int)(__c))))
|
|
585
|
+
#define msa_rpackr_s32(__a, __b, __c) \
|
|
586
|
+
(__builtin_msa_pckev_h( \
|
|
587
|
+
(v8i16)__builtin_msa_srari_w((v4i32)(__b), (int)(__c)), \
|
|
588
|
+
(v8i16)__builtin_msa_srari_w((v4i32)(__a), (int)(__c))))
|
|
589
|
+
#define msa_rpackr_s64(__a, __b, __c) \
|
|
590
|
+
(__builtin_msa_pckev_w( \
|
|
591
|
+
(v4i32)__builtin_msa_srari_d((v2i64)(__b), (int)(__c)), \
|
|
592
|
+
(v4i32)__builtin_msa_srari_d((v2i64)(__a), (int)(__c))))
|
|
593
|
+
#define msa_rpackr_u16(__a, __b, __c) \
|
|
594
|
+
((v16u8)__builtin_msa_pckev_b( \
|
|
595
|
+
(v16i8)__builtin_msa_srlri_h((v8i16)(__b), (int)(__c)), \
|
|
596
|
+
(v16i8)__builtin_msa_srlri_h((v8i16)(__a), (int)(__c))))
|
|
597
|
+
#define msa_rpackr_u32(__a, __b, __c) \
|
|
598
|
+
((v8u16)__builtin_msa_pckev_h( \
|
|
599
|
+
(v8i16)__builtin_msa_srlri_w((v4i32)(__b), (int)(__c)), \
|
|
600
|
+
(v8i16)__builtin_msa_srlri_w((v4i32)(__a), (int)(__c))))
|
|
601
|
+
#define msa_rpackr_u64(__a, __b, __c) \
|
|
602
|
+
((v4u32)__builtin_msa_pckev_w( \
|
|
603
|
+
(v4i32)__builtin_msa_srlri_d((v2i64)(__b), (int)(__c)), \
|
|
604
|
+
(v4i32)__builtin_msa_srlri_d((v2i64)(__a), (int)(__c))))
|
|
605
|
+
|
|
606
|
+
/* qrpackr */
|
|
607
|
+
#define msa_qrpackr_s16(__a, __b, __c) \
|
|
608
|
+
(__builtin_msa_pckev_b( \
|
|
609
|
+
(v16i8)__builtin_msa_sat_s_h( \
|
|
610
|
+
__builtin_msa_srari_h((v8i16)(__b), (int)(__c)), 7), \
|
|
611
|
+
(v16i8)__builtin_msa_sat_s_h( \
|
|
612
|
+
__builtin_msa_srari_h((v8i16)(__a), (int)(__c)), 7)))
|
|
613
|
+
#define msa_qrpackr_s32(__a, __b, __c) \
|
|
614
|
+
(__builtin_msa_pckev_h( \
|
|
615
|
+
(v8i16)__builtin_msa_sat_s_w( \
|
|
616
|
+
__builtin_msa_srari_w((v4i32)(__b), (int)(__c)), 15), \
|
|
617
|
+
(v8i16)__builtin_msa_sat_s_w( \
|
|
618
|
+
__builtin_msa_srari_w((v4i32)(__a), (int)(__c)), 15)))
|
|
619
|
+
#define msa_qrpackr_s64(__a, __b, __c) \
|
|
620
|
+
(__builtin_msa_pckev_w( \
|
|
621
|
+
(v4i32)__builtin_msa_sat_s_d( \
|
|
622
|
+
__builtin_msa_srari_d((v2i64)(__b), (int)(__c)), 31), \
|
|
623
|
+
(v4i32)__builtin_msa_sat_s_d( \
|
|
624
|
+
__builtin_msa_srari_d((v2i64)(__a), (int)(__c)), 31)))
|
|
625
|
+
#define msa_qrpackr_u16(__a, __b, __c) \
|
|
626
|
+
((v16u8)__builtin_msa_pckev_b( \
|
|
627
|
+
(v16i8)__builtin_msa_sat_u_h( \
|
|
628
|
+
(v8u16)__builtin_msa_srlri_h((v8i16)(__b), (int)(__c)), 7), \
|
|
629
|
+
(v16i8)__builtin_msa_sat_u_h( \
|
|
630
|
+
(v8u16)__builtin_msa_srlri_h((v8i16)(__a), (int)(__c)), 7)))
|
|
631
|
+
#define msa_qrpackr_u32(__a, __b, __c) \
|
|
632
|
+
((v8u16)__builtin_msa_pckev_h( \
|
|
633
|
+
(v8i16)__builtin_msa_sat_u_w( \
|
|
634
|
+
(v4u32)__builtin_msa_srlri_w((v4i32)(__b), (int)(__c)), 15), \
|
|
635
|
+
(v8i16)__builtin_msa_sat_u_w( \
|
|
636
|
+
(v4u32)__builtin_msa_srlri_w((v4i32)(__a), (int)(__c)), 15)))
|
|
637
|
+
#define msa_qrpackr_u64(__a, __b, __c) \
|
|
638
|
+
((v4u32)__builtin_msa_pckev_w( \
|
|
639
|
+
(v4i32)__builtin_msa_sat_u_d( \
|
|
640
|
+
(v2u64)__builtin_msa_srlri_d((v2i64)(__b), (int)(__c)), 31), \
|
|
641
|
+
(v4i32)__builtin_msa_sat_u_d( \
|
|
642
|
+
(v2u64)__builtin_msa_srlri_d((v2i64)(__a), (int)(__c)), 31)))
|
|
643
|
+
|
|
644
|
+
/* qrpackru */
|
|
645
|
+
#define msa_qrpackru_s16(__a, __b, __c) \
|
|
646
|
+
({ \
|
|
647
|
+
v8i16 __d = __builtin_msa_srlri_h( \
|
|
648
|
+
__builtin_msa_max_s_h(__builtin_msa_fill_h(0), (v8i16)(__a)), \
|
|
649
|
+
(int)(__c)); \
|
|
650
|
+
v8i16 __e = __builtin_msa_srlri_h( \
|
|
651
|
+
__builtin_msa_max_s_h(__builtin_msa_fill_h(0), (v8i16)(__b)), \
|
|
652
|
+
(int)(__c)); \
|
|
653
|
+
(v16u8) \
|
|
654
|
+
__builtin_msa_pckev_b((v16i8)__builtin_msa_sat_u_h((v8u16)__e, 7), \
|
|
655
|
+
(v16i8)__builtin_msa_sat_u_h((v8u16)__d, 7)); \
|
|
656
|
+
})
|
|
657
|
+
|
|
658
|
+
#define msa_qrpackru_s32(__a, __b, __c) \
|
|
659
|
+
({ \
|
|
660
|
+
v4i32 __d = __builtin_msa_srlri_w( \
|
|
661
|
+
__builtin_msa_max_s_w(__builtin_msa_fill_w(0), (v4i32)(__a)), \
|
|
662
|
+
(int)(__c)); \
|
|
663
|
+
v4i32 __e = __builtin_msa_srlri_w( \
|
|
664
|
+
__builtin_msa_max_s_w(__builtin_msa_fill_w(0), (v4i32)(__b)), \
|
|
665
|
+
(int)(__c)); \
|
|
666
|
+
(v8u16) \
|
|
667
|
+
__builtin_msa_pckev_h((v8i16)__builtin_msa_sat_u_w((v4u32)__e, 15), \
|
|
668
|
+
(v8i16)__builtin_msa_sat_u_w((v4u32)__d, 15)); \
|
|
669
|
+
})
|
|
670
|
+
|
|
671
|
+
#define msa_qrpackru_s64(__a, __b, __c) \
|
|
672
|
+
({ \
|
|
673
|
+
v2i64 __d = __builtin_msa_srlri_d( \
|
|
674
|
+
__builtin_msa_max_s_d(__builtin_msa_fill_d(0), (v2i64)(__a)), \
|
|
675
|
+
(int)(__c)); \
|
|
676
|
+
v2i64 __e = __builtin_msa_srlri_d( \
|
|
677
|
+
__builtin_msa_max_s_d(__builtin_msa_fill_d(0), (v2i64)(__b)), \
|
|
678
|
+
(int)(__c)); \
|
|
679
|
+
(v4u32) \
|
|
680
|
+
__builtin_msa_pckev_w((v4i32)__builtin_msa_sat_u_d((v2u64)__e, 31), \
|
|
681
|
+
(v4i32)__builtin_msa_sat_u_d((v2u64)__d, 31)); \
|
|
682
|
+
})
|
|
683
|
+
|
|
684
|
+
/* Minimum values between corresponding elements in the two vectors are written
|
|
685
|
+
* to the returned vector. */
|
|
686
|
+
#define msa_minq_s8(__a, __b) (__builtin_msa_min_s_b(__a, __b))
|
|
687
|
+
#define msa_minq_s16(__a, __b) (__builtin_msa_min_s_h(__a, __b))
|
|
688
|
+
#define msa_minq_s32(__a, __b) (__builtin_msa_min_s_w(__a, __b))
|
|
689
|
+
#define msa_minq_s64(__a, __b) (__builtin_msa_min_s_d(__a, __b))
|
|
690
|
+
#define msa_minq_u8(__a, __b) ((v16u8)__builtin_msa_min_u_b(__a, __b))
|
|
691
|
+
#define msa_minq_u16(__a, __b) ((v8u16)__builtin_msa_min_u_h(__a, __b))
|
|
692
|
+
#define msa_minq_u32(__a, __b) ((v4u32)__builtin_msa_min_u_w(__a, __b))
|
|
693
|
+
#define msa_minq_u64(__a, __b) ((v2u64)__builtin_msa_min_u_d(__a, __b))
|
|
694
|
+
#define msa_minq_f32(__a, __b) (__builtin_msa_fmin_w(__a, __b))
|
|
695
|
+
#define msa_minq_f64(__a, __b) (__builtin_msa_fmin_d(__a, __b))
|
|
696
|
+
|
|
697
|
+
/* Maximum values between corresponding elements in the two vectors are written
|
|
698
|
+
* to the returned vector. */
|
|
699
|
+
#define msa_maxq_s8(__a, __b) (__builtin_msa_max_s_b(__a, __b))
|
|
700
|
+
#define msa_maxq_s16(__a, __b) (__builtin_msa_max_s_h(__a, __b))
|
|
701
|
+
#define msa_maxq_s32(__a, __b) (__builtin_msa_max_s_w(__a, __b))
|
|
702
|
+
#define msa_maxq_s64(__a, __b) (__builtin_msa_max_s_d(__a, __b))
|
|
703
|
+
#define msa_maxq_u8(__a, __b) ((v16u8)__builtin_msa_max_u_b(__a, __b))
|
|
704
|
+
#define msa_maxq_u16(__a, __b) ((v8u16)__builtin_msa_max_u_h(__a, __b))
|
|
705
|
+
#define msa_maxq_u32(__a, __b) ((v4u32)__builtin_msa_max_u_w(__a, __b))
|
|
706
|
+
#define msa_maxq_u64(__a, __b) ((v2u64)__builtin_msa_max_u_d(__a, __b))
|
|
707
|
+
#define msa_maxq_f32(__a, __b) (__builtin_msa_fmax_w(__a, __b))
|
|
708
|
+
#define msa_maxq_f64(__a, __b) (__builtin_msa_fmax_d(__a, __b))
|
|
709
|
+
|
|
710
|
+
/* Vector type reinterpretion */
|
|
711
|
+
#define MSA_TPV_REINTERPRET(_Tpv, Vec) ((_Tpv)(Vec))
|
|
712
|
+
|
|
713
|
+
/* Add the odd elements in vector __a with the even elements in vector __b to
|
|
714
|
+
* double width elements in the returned vector. */
|
|
715
|
+
/* v8i16 msa_hadd_s16 ((v16i8)__a, (v16i8)__b) */
|
|
716
|
+
#define msa_hadd_s16(__a, __b) \
|
|
717
|
+
(__builtin_msa_hadd_s_h((v16i8)(__a), (v16i8)(__b)))
|
|
718
|
+
/* v4i32 msa_hadd_s32 ((v8i16)__a, (v8i16)__b) */
|
|
719
|
+
#define msa_hadd_s32(__a, __b) \
|
|
720
|
+
(__builtin_msa_hadd_s_w((v8i16)(__a), (v8i16)(__b)))
|
|
721
|
+
/* v2i64 msa_hadd_s64 ((v4i32)__a, (v4i32)__b) */
|
|
722
|
+
#define msa_hadd_s64(__a, __b) \
|
|
723
|
+
(__builtin_msa_hadd_s_d((v4i32)(__a), (v4i32)(__b)))
|
|
724
|
+
|
|
725
|
+
/* Copy even elements in __a to the left half and even elements in __b to the
|
|
726
|
+
* right half and return the result vector. */
|
|
727
|
+
#define msa_pckev_s8(__a, __b) \
|
|
728
|
+
(__builtin_msa_pckev_b((v16i8)(__a), (v16i8)(__b)))
|
|
729
|
+
#define msa_pckev_s16(__a, __b) \
|
|
730
|
+
(__builtin_msa_pckev_h((v8i16)(__a), (v8i16)(__b)))
|
|
731
|
+
#define msa_pckev_s32(__a, __b) \
|
|
732
|
+
(__builtin_msa_pckev_w((v4i32)(__a), (v4i32)(__b)))
|
|
733
|
+
#define msa_pckev_s64(__a, __b) \
|
|
734
|
+
(__builtin_msa_pckev_d((v2i64)(__a), (v2i64)(__b)))
|
|
735
|
+
|
|
736
|
+
/* Copy even elements in __a to the left half and even elements in __b to the
|
|
737
|
+
* right half and return the result vector. */
|
|
738
|
+
#define msa_pckod_s8(__a, __b) \
|
|
739
|
+
(__builtin_msa_pckod_b((v16i8)(__a), (v16i8)(__b)))
|
|
740
|
+
#define msa_pckod_s16(__a, __b) \
|
|
741
|
+
(__builtin_msa_pckod_h((v8i16)(__a), (v8i16)(__b)))
|
|
742
|
+
#define msa_pckod_s32(__a, __b) \
|
|
743
|
+
(__builtin_msa_pckod_w((v4i32)(__a), (v4i32)(__b)))
|
|
744
|
+
#define msa_pckod_s64(__a, __b) \
|
|
745
|
+
(__builtin_msa_pckod_d((v2i64)(__a), (v2i64)(__b)))
|
|
746
|
+
|
|
747
|
+
#ifdef _MIPSEB
|
|
748
|
+
#define LANE_IMM0_1(x) (0b1 - ((x) & 0b1))
|
|
749
|
+
#define LANE_IMM0_3(x) (0b11 - ((x) & 0b11))
|
|
750
|
+
#define LANE_IMM0_7(x) (0b111 - ((x) & 0b111))
|
|
751
|
+
#define LANE_IMM0_15(x) (0b1111 - ((x) & 0b1111))
|
|
752
|
+
#else
|
|
753
|
+
#define LANE_IMM0_1(x) ((x) & 0b1)
|
|
754
|
+
#define LANE_IMM0_3(x) ((x) & 0b11)
|
|
755
|
+
#define LANE_IMM0_7(x) ((x) & 0b111)
|
|
756
|
+
#define LANE_IMM0_15(x) ((x) & 0b1111)
|
|
757
|
+
#endif
|
|
758
|
+
|
|
759
|
+
#define msa_get_lane_u8(__a, __b) ((uint8_t)(__a)[LANE_IMM0_7(__b)])
|
|
760
|
+
#define msa_get_lane_s8(__a, __b) ((int8_t)(__a)[LANE_IMM0_7(__b)])
|
|
761
|
+
#define msa_get_lane_u16(__a, __b) ((uint16_t)(__a)[LANE_IMM0_3(__b)])
|
|
762
|
+
#define msa_get_lane_s16(__a, __b) ((int16_t)(__a)[LANE_IMM0_3(__b)])
|
|
763
|
+
#define msa_get_lane_u32(__a, __b) ((uint32_t)(__a)[LANE_IMM0_1(__b)])
|
|
764
|
+
#define msa_get_lane_s32(__a, __b) ((int32_t)(__a)[LANE_IMM0_1(__b)])
|
|
765
|
+
#define msa_get_lane_f32(__a, __b) ((float)(__a)[LANE_IMM0_3(__b)])
|
|
766
|
+
#define msa_get_lane_s64(__a, __b) ((int64_t)(__a)[LANE_IMM0_1(__b)])
|
|
767
|
+
#define msa_get_lane_u64(__a, __b) ((uint64_t)(__a)[LANE_IMM0_1(__b)])
|
|
768
|
+
#define msa_get_lane_f64(__a, __b) ((double)(__a)[LANE_IMM0_1(__b)])
|
|
769
|
+
#define msa_getq_lane_u8(__a, imm0_15) \
|
|
770
|
+
((uint8_t)__builtin_msa_copy_u_b((v16i8)(__a), imm0_15))
|
|
771
|
+
#define msa_getq_lane_s8(__a, imm0_15) \
|
|
772
|
+
((int8_t)__builtin_msa_copy_s_b(__a, imm0_15))
|
|
773
|
+
#define msa_getq_lane_u16(__a, imm0_7) \
|
|
774
|
+
((uint16_t)__builtin_msa_copy_u_h((v8i16)(__a), imm0_7))
|
|
775
|
+
#define msa_getq_lane_s16(__a, imm0_7) \
|
|
776
|
+
((int16_t)__builtin_msa_copy_s_h(__a, imm0_7))
|
|
777
|
+
#define msa_getq_lane_u32(__a, imm0_3) \
|
|
778
|
+
__builtin_msa_copy_u_w((v4i32)(__a), imm0_3)
|
|
779
|
+
#define msa_getq_lane_s32 __builtin_msa_copy_s_w
|
|
780
|
+
#define msa_getq_lane_f32(__a, __b) ((float)(__a)[LANE_IMM0_3(__b)])
|
|
781
|
+
#define msa_getq_lane_f64(__a, __b) ((double)(__a)[LANE_IMM0_1(__b)])
|
|
782
|
+
#if (__mips == 64)
|
|
783
|
+
#define msa_getq_lane_u64(__a, imm0_1) \
|
|
784
|
+
__builtin_msa_copy_u_d((v2i64)(__a), imm0_1)
|
|
785
|
+
#define msa_getq_lane_s64 __builtin_msa_copy_s_d
|
|
786
|
+
#else
|
|
787
|
+
#define msa_getq_lane_u64(__a, imm0_1) ((uint64_t)(__a)[LANE_IMM0_1(imm0_1)])
|
|
788
|
+
#define msa_getq_lane_s64(__a, imm0_1) ((int64_t)(__a)[LANE_IMM0_1(imm0_1)])
|
|
789
|
+
#endif
|
|
790
|
+
|
|
791
|
+
/* combine */
|
|
792
|
+
#if (__mips == 64)
|
|
793
|
+
#define __COMBINE_64_64(__TYPE, a, b) \
|
|
794
|
+
((__TYPE)((v2u64){((v1u64)(a))[0], ((v1u64)(b))[0]}))
|
|
795
|
+
#else
|
|
796
|
+
#define __COMBINE_64_64(__TYPE, a, b) \
|
|
797
|
+
((__TYPE)((v4u32){((v2u32)(a))[0], ((v2u32)(a))[1], ((v2u32)(b))[0], \
|
|
798
|
+
((v2u32)(b))[1]}))
|
|
799
|
+
#endif
|
|
800
|
+
|
|
801
|
+
/* v16i8 msa_combine_s8 (v8i8 __a, v8i8 __b) */
|
|
802
|
+
#define msa_combine_s8(__a, __b) __COMBINE_64_64(v16i8, __a, __b)
|
|
803
|
+
|
|
804
|
+
/* v8i16 msa_combine_s16(v4i16 __a, v4i16 __b) */
|
|
805
|
+
#define msa_combine_s16(__a, __b) __COMBINE_64_64(v8i16, __a, __b)
|
|
806
|
+
|
|
807
|
+
/* v4i32 msa_combine_s32(v2i32 __a, v2i32 __b) */
|
|
808
|
+
#define msa_combine_s32(__a, __b) __COMBINE_64_64(v4i32, __a, __b)
|
|
809
|
+
|
|
810
|
+
/* v2i64 msa_combine_s64(v1i64 __a, v1i64 __b) */
|
|
811
|
+
#define msa_combine_s64(__a, __b) __COMBINE_64_64(v2i64, __a, __b)
|
|
812
|
+
|
|
813
|
+
/* v4f32 msa_combine_f32(v2f32 __a, v2f32 __b) */
|
|
814
|
+
#define msa_combine_f32(__a, __b) __COMBINE_64_64(v4f32, __a, __b)
|
|
815
|
+
|
|
816
|
+
/* v16u8 msa_combine_u8(v8u8 __a, v8u8 __b) */
|
|
817
|
+
#define msa_combine_u8(__a, __b) __COMBINE_64_64(v16u8, __a, __b)
|
|
818
|
+
|
|
819
|
+
/* v8u16 msa_combine_u16(v4u16 __a, v4u16 __b) */
|
|
820
|
+
#define msa_combine_u16(__a, __b) __COMBINE_64_64(v8u16, __a, __b)
|
|
821
|
+
|
|
822
|
+
/* v4u32 msa_combine_u32(v2u32 __a, v2u32 __b) */
|
|
823
|
+
#define msa_combine_u32(__a, __b) __COMBINE_64_64(v4u32, __a, __b)
|
|
824
|
+
|
|
825
|
+
/* v2u64 msa_combine_u64(v1u64 __a, v1u64 __b) */
|
|
826
|
+
#define msa_combine_u64(__a, __b) __COMBINE_64_64(v2u64, __a, __b)
|
|
827
|
+
|
|
828
|
+
/* v2f64 msa_combine_f64(v1f64 __a, v1f64 __b) */
|
|
829
|
+
#define msa_combine_f64(__a, __b) __COMBINE_64_64(v2f64, __a, __b)
|
|
830
|
+
|
|
831
|
+
/* get_low, get_high */
|
|
832
|
+
#if (__mips == 64)
|
|
833
|
+
#define __GET_LOW(__TYPE, a) \
|
|
834
|
+
((__TYPE)((v1u64)(__builtin_msa_copy_u_d((v2i64)(a), 0))))
|
|
835
|
+
#define __GET_HIGH(__TYPE, a) \
|
|
836
|
+
((__TYPE)((v1u64)(__builtin_msa_copy_u_d((v2i64)(a), 1))))
|
|
837
|
+
#else
|
|
838
|
+
#define __GET_LOW(__TYPE, a) ((__TYPE)(((v2u64)(a))[0]))
|
|
839
|
+
#define __GET_HIGH(__TYPE, a) ((__TYPE)(((v2u64)(a))[1]))
|
|
840
|
+
#endif
|
|
841
|
+
|
|
842
|
+
/* v8i8 msa_get_low_s8(v16i8 __a) */
|
|
843
|
+
#define msa_get_low_s8(__a) __GET_LOW(v8i8, __a)
|
|
844
|
+
|
|
845
|
+
/* v4i16 msa_get_low_s16(v8i16 __a) */
|
|
846
|
+
#define msa_get_low_s16(__a) __GET_LOW(v4i16, __a)
|
|
847
|
+
|
|
848
|
+
/* v2i32 msa_get_low_s32(v4i32 __a) */
|
|
849
|
+
#define msa_get_low_s32(__a) __GET_LOW(v2i32, __a)
|
|
850
|
+
|
|
851
|
+
/* v1i64 msa_get_low_s64(v2i64 __a) */
|
|
852
|
+
#define msa_get_low_s64(__a) __GET_LOW(v1i64, __a)
|
|
853
|
+
|
|
854
|
+
/* v8u8 msa_get_low_u8(v16u8 __a) */
|
|
855
|
+
#define msa_get_low_u8(__a) __GET_LOW(v8u8, __a)
|
|
856
|
+
|
|
857
|
+
/* v4u16 msa_get_low_u16(v8u16 __a) */
|
|
858
|
+
#define msa_get_low_u16(__a) __GET_LOW(v4u16, __a)
|
|
859
|
+
|
|
860
|
+
/* v2u32 msa_get_low_u32(v4u32 __a) */
|
|
861
|
+
#define msa_get_low_u32(__a) __GET_LOW(v2u32, __a)
|
|
862
|
+
|
|
863
|
+
/* v1u64 msa_get_low_u64(v2u64 __a) */
|
|
864
|
+
#define msa_get_low_u64(__a) __GET_LOW(v1u64, __a)
|
|
865
|
+
|
|
866
|
+
/* v2f32 msa_get_low_f32(v4f32 __a) */
|
|
867
|
+
#define msa_get_low_f32(__a) __GET_LOW(v2f32, __a)
|
|
868
|
+
|
|
869
|
+
/* v1f64 msa_get_low_f64(v2f64 __a) */
|
|
870
|
+
#define msa_get_low_f64(__a) __GET_LOW(v1f64, __a)
|
|
871
|
+
|
|
872
|
+
/* v8i8 msa_get_high_s8(v16i8 __a) */
|
|
873
|
+
#define msa_get_high_s8(__a) __GET_HIGH(v8i8, __a)
|
|
874
|
+
|
|
875
|
+
/* v4i16 msa_get_high_s16(v8i16 __a) */
|
|
876
|
+
#define msa_get_high_s16(__a) __GET_HIGH(v4i16, __a)
|
|
877
|
+
|
|
878
|
+
/* v2i32 msa_get_high_s32(v4i32 __a) */
|
|
879
|
+
#define msa_get_high_s32(__a) __GET_HIGH(v2i32, __a)
|
|
880
|
+
|
|
881
|
+
/* v1i64 msa_get_high_s64(v2i64 __a) */
|
|
882
|
+
#define msa_get_high_s64(__a) __GET_HIGH(v1i64, __a)
|
|
883
|
+
|
|
884
|
+
/* v8u8 msa_get_high_u8(v16u8 __a) */
|
|
885
|
+
#define msa_get_high_u8(__a) __GET_HIGH(v8u8, __a)
|
|
886
|
+
|
|
887
|
+
/* v4u16 msa_get_high_u16(v8u16 __a) */
|
|
888
|
+
#define msa_get_high_u16(__a) __GET_HIGH(v4u16, __a)
|
|
889
|
+
|
|
890
|
+
/* v2u32 msa_get_high_u32(v4u32 __a) */
|
|
891
|
+
#define msa_get_high_u32(__a) __GET_HIGH(v2u32, __a)
|
|
892
|
+
|
|
893
|
+
/* v1u64 msa_get_high_u64(v2u64 __a) */
|
|
894
|
+
#define msa_get_high_u64(__a) __GET_HIGH(v1u64, __a)
|
|
895
|
+
|
|
896
|
+
/* v2f32 msa_get_high_f32(v4f32 __a) */
|
|
897
|
+
#define msa_get_high_f32(__a) __GET_HIGH(v2f32, __a)
|
|
898
|
+
|
|
899
|
+
/* v1f64 msa_get_high_f64(v2f64 __a) */
|
|
900
|
+
#define msa_get_high_f64(__a) __GET_HIGH(v1f64, __a)
|
|
901
|
+
|
|
902
|
+
/* ri = ai * b[lane] */
|
|
903
|
+
/* v4f32 msa_mulq_lane_f32(v4f32 __a, v4f32 __b, const int __lane) */
|
|
904
|
+
#define msa_mulq_lane_f32(__a, __b, __lane) \
|
|
905
|
+
((__a) * msa_getq_lane_f32(__b, __lane))
|
|
906
|
+
|
|
907
|
+
/* ri = ai + bi * c[lane] */
|
|
908
|
+
/* v4f32 msa_mlaq_lane_f32(v4f32 __a, v4f32 __b, v4f32 __c, const int __lane) */
|
|
909
|
+
#define msa_mlaq_lane_f32(__a, __b, __c, __lane) \
|
|
910
|
+
((__a) + ((__b) * msa_getq_lane_f32(__c, __lane)))
|
|
911
|
+
|
|
912
|
+
/* uint16_t msa_sum_u16(v8u16 __a)*/
|
|
913
|
+
#define msa_sum_u16(__a) \
|
|
914
|
+
({ \
|
|
915
|
+
v4u32 _b; \
|
|
916
|
+
v2u64 _c; \
|
|
917
|
+
_b = __builtin_msa_hadd_u_w(__a, __a); \
|
|
918
|
+
_c = __builtin_msa_hadd_u_d(_b, _b); \
|
|
919
|
+
(uint16_t)(_c[0] + _c[1]); \
|
|
920
|
+
})
|
|
921
|
+
|
|
922
|
+
/* int16_t msa_sum_s16(v8i16 __a) */
|
|
923
|
+
#define msa_sum_s16(__a) \
|
|
924
|
+
({ \
|
|
925
|
+
v4i32 _b; \
|
|
926
|
+
v2i64 _c; \
|
|
927
|
+
_b = __builtin_msa_hadd_s_w(__a, __a); \
|
|
928
|
+
_c = __builtin_msa_hadd_s_d(_b, _b); \
|
|
929
|
+
(int32_t)(_c[0] + _c[1]); \
|
|
930
|
+
})
|
|
931
|
+
|
|
932
|
+
/* uint32_t msa_sum_u32(v4u32 __a)*/
|
|
933
|
+
#define msa_sum_u32(__a) \
|
|
934
|
+
({ \
|
|
935
|
+
v2u64 _b; \
|
|
936
|
+
_b = __builtin_msa_hadd_u_d(__a, __a); \
|
|
937
|
+
(uint32_t)(_b[0] + _b[1]); \
|
|
938
|
+
})
|
|
939
|
+
|
|
940
|
+
/* int32_t msa_sum_s32(v4i32 __a)*/
|
|
941
|
+
#define msa_sum_s32(__a) \
|
|
942
|
+
({ \
|
|
943
|
+
v2i64 _b; \
|
|
944
|
+
_b = __builtin_msa_hadd_s_d(__a, __a); \
|
|
945
|
+
(int64_t)(_b[0] + _b[1]); \
|
|
946
|
+
})
|
|
947
|
+
|
|
948
|
+
/* uint8_t msa_sum_u8(v16u8 __a)*/
|
|
949
|
+
#define msa_sum_u8(__a) \
|
|
950
|
+
({ \
|
|
951
|
+
v8u16 _b16; \
|
|
952
|
+
v4u32 _c32; \
|
|
953
|
+
_b16 = __builtin_msa_hadd_u_h(__a, __a); \
|
|
954
|
+
_c32 = __builtin_msa_hadd_u_w(_b16, _b16); \
|
|
955
|
+
(uint8_t)msa_sum_u32(_c32); \
|
|
956
|
+
})
|
|
957
|
+
|
|
958
|
+
/* int8_t msa_sum_s8(v16s8 __a)*/
|
|
959
|
+
#define msa_sum_s8(__a) \
|
|
960
|
+
({ \
|
|
961
|
+
v8i16 _b16; \
|
|
962
|
+
v4i32 _c32; \
|
|
963
|
+
_b16 = __builtin_msa_hadd_s_h(__a, __a); \
|
|
964
|
+
_c32 = __builtin_msa_hadd_s_w(_b16, _b16); \
|
|
965
|
+
(int16_t)msa_sum_s32(_c32); \
|
|
966
|
+
})
|
|
967
|
+
|
|
968
|
+
/* float msa_sum_f32(v4f32 __a)*/
|
|
969
|
+
#define msa_sum_f32(__a) ((__a)[0] + (__a)[1] + (__a)[2] + (__a)[3])
|
|
970
|
+
|
|
971
|
+
/* v8u16 msa_paddlq_u8(v16u8 __a) */
|
|
972
|
+
#define msa_paddlq_u8(__a) (__builtin_msa_hadd_u_h(__a, __a))
|
|
973
|
+
|
|
974
|
+
/* v8i16 msa_paddlq_s8(v16i8 __a) */
|
|
975
|
+
#define msa_paddlq_s8(__a) (__builtin_msa_hadd_s_h(__a, __a))
|
|
976
|
+
|
|
977
|
+
/* v4u32 msa_paddlq_u16 (v8u16 __a)*/
|
|
978
|
+
#define msa_paddlq_u16(__a) (__builtin_msa_hadd_u_w(__a, __a))
|
|
979
|
+
|
|
980
|
+
/* v4i32 msa_paddlq_s16 (v8i16 __a)*/
|
|
981
|
+
#define msa_paddlq_s16(__a) (__builtin_msa_hadd_s_w(__a, __a))
|
|
982
|
+
|
|
983
|
+
/* v2u64 msa_paddlq_u32(v4u32 __a) */
|
|
984
|
+
#define msa_paddlq_u32(__a) (__builtin_msa_hadd_u_d(__a, __a))
|
|
985
|
+
|
|
986
|
+
/* v2i64 msa_paddlq_s32(v4i32 __a) */
|
|
987
|
+
#define msa_paddlq_s32(__a) (__builtin_msa_hadd_s_d(__a, __a))
|
|
988
|
+
|
|
989
|
+
#define V8U8_2_V8U16(x) \
|
|
990
|
+
{(uint16_t)x[0], (uint16_t)x[1], (uint16_t)x[2], (uint16_t)x[3], \
|
|
991
|
+
(uint16_t)x[4], (uint16_t)x[5], (uint16_t)x[6], (uint16_t)x[7]}
|
|
992
|
+
#define V8U8_2_V8I16(x) \
|
|
993
|
+
{(int16_t)x[0], (int16_t)x[1], (int16_t)x[2], (int16_t)x[3], \
|
|
994
|
+
(int16_t)x[4], (int16_t)x[5], (int16_t)x[6], (int16_t)x[7]}
|
|
995
|
+
#define V8I8_2_V8I16(x) \
|
|
996
|
+
{(int16_t)x[0], (int16_t)x[1], (int16_t)x[2], (int16_t)x[3], \
|
|
997
|
+
(int16_t)x[4], (int16_t)x[5], (int16_t)x[6], (int16_t)x[7]}
|
|
998
|
+
#define V4U16_2_V4U32(x) \
|
|
999
|
+
{(uint32_t)x[0], (uint32_t)x[1], (uint32_t)x[2], (uint32_t)x[3]}
|
|
1000
|
+
#define V4U16_2_V4I32(x) \
|
|
1001
|
+
{(int32_t)x[0], (int32_t)x[1], (int32_t)x[2], (int32_t)x[3]}
|
|
1002
|
+
#define V4I16_2_V4I32(x) \
|
|
1003
|
+
{(int32_t)x[0], (int32_t)x[1], (int32_t)x[2], (int32_t)x[3]}
|
|
1004
|
+
#define V2U32_2_V2U64(x) {(uint64_t)x[0], (uint64_t)x[1]}
|
|
1005
|
+
#define V2U32_2_V2I64(x) {(int64_t)x[0], (int64_t)x[1]}
|
|
1006
|
+
|
|
1007
|
+
/* v8u16 msa_mull_u8(v8u8 __a, v8u8 __b) */
|
|
1008
|
+
#define msa_mull_u8(__a, __b) \
|
|
1009
|
+
((v8u16)__builtin_msa_mulv_h((v8i16)V8U8_2_V8I16(__a), \
|
|
1010
|
+
(v8i16)V8U8_2_V8I16(__b)))
|
|
1011
|
+
|
|
1012
|
+
/* v8i16 msa_mull_s8(v8i8 __a, v8i8 __b)*/
|
|
1013
|
+
#define msa_mull_s8(__a, __b) \
|
|
1014
|
+
(__builtin_msa_mulv_h((v8i16)V8I8_2_V8I16(__a), (v8i16)V8I8_2_V8I16(__b)))
|
|
1015
|
+
|
|
1016
|
+
/* v4u32 msa_mull_u16(v4u16 __a, v4u16 __b) */
|
|
1017
|
+
#define msa_mull_u16(__a, __b) \
|
|
1018
|
+
((v4u32)__builtin_msa_mulv_w((v4i32)V4U16_2_V4I32(__a), \
|
|
1019
|
+
(v4i32)V4U16_2_V4I32(__b)))
|
|
1020
|
+
|
|
1021
|
+
/* v4i32 msa_mull_s16(v4i16 __a, v4i16 __b) */
|
|
1022
|
+
#define msa_mull_s16(__a, __b) \
|
|
1023
|
+
(__builtin_msa_mulv_w((v4i32)V4I16_2_V4I32(__a), (v4i32)V4I16_2_V4I32(__b)))
|
|
1024
|
+
|
|
1025
|
+
/* v2u64 msa_mull_u32(v2u32 __a, v2u32 __b) */
|
|
1026
|
+
#define msa_mull_u32(__a, __b) \
|
|
1027
|
+
((v2u64)__builtin_msa_mulv_d((v2i64)V2U32_2_V2I64(__a), \
|
|
1028
|
+
(v2i64)V2U32_2_V2I64(__b)))
|
|
1029
|
+
|
|
1030
|
+
/* bitwise and: __builtin_msa_and_v */
|
|
1031
|
+
#define msa_andq_u8(__a, __b) \
|
|
1032
|
+
((v16u8)__builtin_msa_and_v((v16u8)(__a), (v16u8)(__b)))
|
|
1033
|
+
#define msa_andq_s8(__a, __b) \
|
|
1034
|
+
((v16i8)__builtin_msa_and_v((v16u8)(__a), (v16u8)(__b)))
|
|
1035
|
+
#define msa_andq_u16(__a, __b) \
|
|
1036
|
+
((v8u16)__builtin_msa_and_v((v16u8)(__a), (v16u8)(__b)))
|
|
1037
|
+
#define msa_andq_s16(__a, __b) \
|
|
1038
|
+
((v8i16)__builtin_msa_and_v((v16u8)(__a), (v16u8)(__b)))
|
|
1039
|
+
#define msa_andq_u32(__a, __b) \
|
|
1040
|
+
((v4u32)__builtin_msa_and_v((v16u8)(__a), (v16u8)(__b)))
|
|
1041
|
+
#define msa_andq_s32(__a, __b) \
|
|
1042
|
+
((v4i32)__builtin_msa_and_v((v16u8)(__a), (v16u8)(__b)))
|
|
1043
|
+
#define msa_andq_u64(__a, __b) \
|
|
1044
|
+
((v2u64)__builtin_msa_and_v((v16u8)(__a), (v16u8)(__b)))
|
|
1045
|
+
#define msa_andq_s64(__a, __b) \
|
|
1046
|
+
((v2i64)__builtin_msa_and_v((v16u8)(__a), (v16u8)(__b)))
|
|
1047
|
+
|
|
1048
|
+
/* bitwise or: __builtin_msa_or_v */
|
|
1049
|
+
#define msa_orrq_u8(__a, __b) \
|
|
1050
|
+
((v16u8)__builtin_msa_or_v((v16u8)(__a), (v16u8)(__b)))
|
|
1051
|
+
#define msa_orrq_s8(__a, __b) \
|
|
1052
|
+
((v16i8)__builtin_msa_or_v((v16u8)(__a), (v16u8)(__b)))
|
|
1053
|
+
#define msa_orrq_u16(__a, __b) \
|
|
1054
|
+
((v8u16)__builtin_msa_or_v((v16u8)(__a), (v16u8)(__b)))
|
|
1055
|
+
#define msa_orrq_s16(__a, __b) \
|
|
1056
|
+
((v8i16)__builtin_msa_or_v((v16u8)(__a), (v16u8)(__b)))
|
|
1057
|
+
#define msa_orrq_u32(__a, __b) \
|
|
1058
|
+
((v4u32)__builtin_msa_or_v((v16u8)(__a), (v16u8)(__b)))
|
|
1059
|
+
#define msa_orrq_s32(__a, __b) \
|
|
1060
|
+
((v4i32)__builtin_msa_or_v((v16u8)(__a), (v16u8)(__b)))
|
|
1061
|
+
#define msa_orrq_u64(__a, __b) \
|
|
1062
|
+
((v2u64)__builtin_msa_or_v((v16u8)(__a), (v16u8)(__b)))
|
|
1063
|
+
#define msa_orrq_s64(__a, __b) \
|
|
1064
|
+
((v2i64)__builtin_msa_or_v((v16u8)(__a), (v16u8)(__b)))
|
|
1065
|
+
|
|
1066
|
+
/* bitwise xor: __builtin_msa_xor_v */
|
|
1067
|
+
#define msa_eorq_u8(__a, __b) \
|
|
1068
|
+
((v16u8)__builtin_msa_xor_v((v16u8)(__a), (v16u8)(__b)))
|
|
1069
|
+
#define msa_eorq_s8(__a, __b) \
|
|
1070
|
+
((v16i8)__builtin_msa_xor_v((v16u8)(__a), (v16u8)(__b)))
|
|
1071
|
+
#define msa_eorq_u16(__a, __b) \
|
|
1072
|
+
((v8u16)__builtin_msa_xor_v((v16u8)(__a), (v16u8)(__b)))
|
|
1073
|
+
#define msa_eorq_s16(__a, __b) \
|
|
1074
|
+
((v8i16)__builtin_msa_xor_v((v16u8)(__a), (v16u8)(__b)))
|
|
1075
|
+
#define msa_eorq_u32(__a, __b) \
|
|
1076
|
+
((v4u32)__builtin_msa_xor_v((v16u8)(__a), (v16u8)(__b)))
|
|
1077
|
+
#define msa_eorq_s32(__a, __b) \
|
|
1078
|
+
((v4i32)__builtin_msa_xor_v((v16u8)(__a), (v16u8)(__b)))
|
|
1079
|
+
#define msa_eorq_u64(__a, __b) \
|
|
1080
|
+
((v2u64)__builtin_msa_xor_v((v16u8)(__a), (v16u8)(__b)))
|
|
1081
|
+
#define msa_eorq_s64(__a, __b) \
|
|
1082
|
+
((v2i64)__builtin_msa_xor_v((v16u8)(__a), (v16u8)(__b)))
|
|
1083
|
+
|
|
1084
|
+
/* bitwise not: v16u8 __builtin_msa_xori_b (v16u8, 0xff) */
|
|
1085
|
+
#define msa_mvnq_u8(__a) ((v16u8)__builtin_msa_xori_b((v16u8)(__a), 0xFF))
|
|
1086
|
+
#define msa_mvnq_s8(__a) ((v16i8)__builtin_msa_xori_b((v16u8)(__a), 0xFF))
|
|
1087
|
+
#define msa_mvnq_u16(__a) ((v8u16)__builtin_msa_xori_b((v16u8)(__a), 0xFF))
|
|
1088
|
+
#define msa_mvnq_s16(__a) ((v8i16)__builtin_msa_xori_b((v16u8)(__a), 0xFF))
|
|
1089
|
+
#define msa_mvnq_u32(__a) ((v4u32)__builtin_msa_xori_b((v16u8)(__a), 0xFF))
|
|
1090
|
+
#define msa_mvnq_s32(__a) ((v4i32)__builtin_msa_xori_b((v16u8)(__a), 0xFF))
|
|
1091
|
+
#define msa_mvnq_u64(__a) ((v2u64)__builtin_msa_xori_b((v16u8)(__a), 0xFF))
|
|
1092
|
+
#define msa_mvnq_s64(__a) ((v2i64)__builtin_msa_xori_b((v16u8)(__a), 0xFF))
|
|
1093
|
+
|
|
1094
|
+
/* compare equal: ceq -> ri = ai == bi ? 1...1:0...0 */
|
|
1095
|
+
#define msa_ceqq_u8(__a, __b) \
|
|
1096
|
+
((v16u8)__builtin_msa_ceq_b((v16i8)(__a), (v16i8)(__b)))
|
|
1097
|
+
#define msa_ceqq_s8(__a, __b) \
|
|
1098
|
+
((v16u8)__builtin_msa_ceq_b((v16i8)(__a), (v16i8)(__b)))
|
|
1099
|
+
#define msa_ceqq_u16(__a, __b) \
|
|
1100
|
+
((v8u16)__builtin_msa_ceq_h((v8i16)(__a), (v8i16)(__b)))
|
|
1101
|
+
#define msa_ceqq_s16(__a, __b) \
|
|
1102
|
+
((v8u16)__builtin_msa_ceq_h((v8i16)(__a), (v8i16)(__b)))
|
|
1103
|
+
#define msa_ceqq_u32(__a, __b) \
|
|
1104
|
+
((v4u32)__builtin_msa_ceq_w((v4i32)(__a), (v4i32)(__b)))
|
|
1105
|
+
#define msa_ceqq_s32(__a, __b) \
|
|
1106
|
+
((v4u32)__builtin_msa_ceq_w((v4i32)(__a), (v4i32)(__b)))
|
|
1107
|
+
#define msa_ceqq_f32(__a, __b) \
|
|
1108
|
+
((v4u32)__builtin_msa_fceq_w((v4f32)(__a), (v4f32)(__b)))
|
|
1109
|
+
#define msa_ceqq_u64(__a, __b) \
|
|
1110
|
+
((v2u64)__builtin_msa_ceq_d((v2i64)(__a), (v2i64)(__b)))
|
|
1111
|
+
#define msa_ceqq_s64(__a, __b) \
|
|
1112
|
+
((v2u64)__builtin_msa_ceq_d((v2i64)(__a), (v2i64)(__b)))
|
|
1113
|
+
#define msa_ceqq_f64(__a, __b) \
|
|
1114
|
+
((v2u64)__builtin_msa_fceq_d((v2f64)(__a), (v2f64)(__b)))
|
|
1115
|
+
|
|
1116
|
+
/* Compare less-than: clt -> ri = ai < bi ? 1...1:0...0 */
|
|
1117
|
+
#define msa_cltq_u8(__a, __b) \
|
|
1118
|
+
((v16u8)__builtin_msa_clt_u_b((v16u8)(__a), (v16u8)(__b)))
|
|
1119
|
+
#define msa_cltq_s8(__a, __b) \
|
|
1120
|
+
((v16u8)__builtin_msa_clt_s_b((v16i8)(__a), (v16i8)(__b)))
|
|
1121
|
+
#define msa_cltq_u16(__a, __b) \
|
|
1122
|
+
((v8u16)__builtin_msa_clt_u_h((v8u16)(__a), (v8u16)(__b)))
|
|
1123
|
+
#define msa_cltq_s16(__a, __b) \
|
|
1124
|
+
((v8u16)__builtin_msa_clt_s_h((v8i16)(__a), (v8i16)(__b)))
|
|
1125
|
+
#define msa_cltq_u32(__a, __b) \
|
|
1126
|
+
((v4u32)__builtin_msa_clt_u_w((v4u32)(__a), (v4u32)(__b)))
|
|
1127
|
+
#define msa_cltq_s32(__a, __b) \
|
|
1128
|
+
((v4u32)__builtin_msa_clt_s_w((v4i32)(__a), (v4i32)(__b)))
|
|
1129
|
+
#define msa_cltq_f32(__a, __b) \
|
|
1130
|
+
((v4u32)__builtin_msa_fclt_w((v4f32)(__a), (v4f32)(__b)))
|
|
1131
|
+
#define msa_cltq_u64(__a, __b) \
|
|
1132
|
+
((v2u64)__builtin_msa_clt_u_d((v2u64)(__a), (v2u64)(__b)))
|
|
1133
|
+
#define msa_cltq_s64(__a, __b) \
|
|
1134
|
+
((v2u64)__builtin_msa_clt_s_d((v2i64)(__a), (v2i64)(__b)))
|
|
1135
|
+
#define msa_cltq_f64(__a, __b) \
|
|
1136
|
+
((v2u64)__builtin_msa_fclt_d((v2f64)(__a), (v2f64)(__b)))
|
|
1137
|
+
|
|
1138
|
+
/* compare greater-than: cgt -> ri = ai > bi ? 1...1:0...0 */
|
|
1139
|
+
#define msa_cgtq_u8(__a, __b) \
|
|
1140
|
+
((v16u8)__builtin_msa_clt_u_b((v16u8)(__b), (v16u8)(__a)))
|
|
1141
|
+
#define msa_cgtq_s8(__a, __b) \
|
|
1142
|
+
((v16u8)__builtin_msa_clt_s_b((v16i8)(__b), (v16i8)(__a)))
|
|
1143
|
+
#define msa_cgtq_u16(__a, __b) \
|
|
1144
|
+
((v8u16)__builtin_msa_clt_u_h((v8u16)(__b), (v8u16)(__a)))
|
|
1145
|
+
#define msa_cgtq_s16(__a, __b) \
|
|
1146
|
+
((v8u16)__builtin_msa_clt_s_h((v8i16)(__b), (v8i16)(__a)))
|
|
1147
|
+
#define msa_cgtq_u32(__a, __b) \
|
|
1148
|
+
((v4u32)__builtin_msa_clt_u_w((v4u32)(__b), (v4u32)(__a)))
|
|
1149
|
+
#define msa_cgtq_s32(__a, __b) \
|
|
1150
|
+
((v4u32)__builtin_msa_clt_s_w((v4i32)(__b), (v4i32)(__a)))
|
|
1151
|
+
#define msa_cgtq_f32(__a, __b) \
|
|
1152
|
+
((v4u32)__builtin_msa_fclt_w((v4f32)(__b), (v4f32)(__a)))
|
|
1153
|
+
#define msa_cgtq_u64(__a, __b) \
|
|
1154
|
+
((v2u64)__builtin_msa_clt_u_d((v2u64)(__b), (v2u64)(__a)))
|
|
1155
|
+
#define msa_cgtq_s64(__a, __b) \
|
|
1156
|
+
((v2u64)__builtin_msa_clt_s_d((v2i64)(__b), (v2i64)(__a)))
|
|
1157
|
+
#define msa_cgtq_f64(__a, __b) \
|
|
1158
|
+
((v2u64)__builtin_msa_fclt_d((v2f64)(__b), (v2f64)(__a)))
|
|
1159
|
+
|
|
1160
|
+
/* compare less-equal: cle -> ri = ai <= bi ? 1...1:0...0 */
|
|
1161
|
+
#define msa_cleq_u8(__a, __b) \
|
|
1162
|
+
((v16u8)__builtin_msa_cle_u_b((v16u8)(__a), (v16u8)(__b)))
|
|
1163
|
+
#define msa_cleq_s8(__a, __b) \
|
|
1164
|
+
((v16u8)__builtin_msa_cle_s_b((v16i8)(__a), (v16i8)(__b)))
|
|
1165
|
+
#define msa_cleq_u16(__a, __b) \
|
|
1166
|
+
((v8u16)__builtin_msa_cle_u_h((v8u16)(__a), (v8u16)(__b)))
|
|
1167
|
+
#define msa_cleq_s16(__a, __b) \
|
|
1168
|
+
((v8u16)__builtin_msa_cle_s_h((v8i16)(__a), (v8i16)(__b)))
|
|
1169
|
+
#define msa_cleq_u32(__a, __b) \
|
|
1170
|
+
((v4u32)__builtin_msa_cle_u_w((v4u32)(__a), (v4u32)(__b)))
|
|
1171
|
+
#define msa_cleq_s32(__a, __b) \
|
|
1172
|
+
((v4u32)__builtin_msa_cle_s_w((v4i32)(__a), (v4i32)(__b)))
|
|
1173
|
+
#define msa_cleq_f32(__a, __b) \
|
|
1174
|
+
((v4u32)__builtin_msa_fcle_w((v4f32)(__a), (v4f32)(__b)))
|
|
1175
|
+
#define msa_cleq_u64(__a, __b) \
|
|
1176
|
+
((v2u64)__builtin_msa_cle_u_d((v2u64)(__a), (v2u64)(__b)))
|
|
1177
|
+
#define msa_cleq_s64(__a, __b) \
|
|
1178
|
+
((v2u64)__builtin_msa_cle_s_d((v2i64)(__a), (v2i64)(__b)))
|
|
1179
|
+
#define msa_cleq_f64(__a, __b) \
|
|
1180
|
+
((v2u64)__builtin_msa_fcle_d((v2f64)(__a), (v2f64)(__b)))
|
|
1181
|
+
|
|
1182
|
+
/* compare greater-equal: cge -> ri = ai >= bi ? 1...1:0...0 */
|
|
1183
|
+
#define msa_cgeq_u8(__a, __b) \
|
|
1184
|
+
((v16u8)__builtin_msa_cle_u_b((v16u8)(__b), (v16u8)(__a)))
|
|
1185
|
+
#define msa_cgeq_s8(__a, __b) \
|
|
1186
|
+
((v16u8)__builtin_msa_cle_s_b((v16i8)(__b), (v16i8)(__a)))
|
|
1187
|
+
#define msa_cgeq_u16(__a, __b) \
|
|
1188
|
+
((v8u16)__builtin_msa_cle_u_h((v8u16)(__b), (v8u16)(__a)))
|
|
1189
|
+
#define msa_cgeq_s16(__a, __b) \
|
|
1190
|
+
((v8u16)__builtin_msa_cle_s_h((v8i16)(__b), (v8i16)(__a)))
|
|
1191
|
+
#define msa_cgeq_u32(__a, __b) \
|
|
1192
|
+
((v4u32)__builtin_msa_cle_u_w((v4u32)(__b), (v4u32)(__a)))
|
|
1193
|
+
#define msa_cgeq_s32(__a, __b) \
|
|
1194
|
+
((v4u32)__builtin_msa_cle_s_w((v4i32)(__b), (v4i32)(__a)))
|
|
1195
|
+
#define msa_cgeq_f32(__a, __b) \
|
|
1196
|
+
((v4u32)__builtin_msa_fcle_w((v4f32)(__b), (v4f32)(__a)))
|
|
1197
|
+
#define msa_cgeq_u64(__a, __b) \
|
|
1198
|
+
((v2u64)__builtin_msa_cle_u_d((v2u64)(__b), (v2u64)(__a)))
|
|
1199
|
+
#define msa_cgeq_s64(__a, __b) \
|
|
1200
|
+
((v2u64)__builtin_msa_cle_s_d((v2i64)(__b), (v2i64)(__a)))
|
|
1201
|
+
#define msa_cgeq_f64(__a, __b) \
|
|
1202
|
+
((v2u64)__builtin_msa_fcle_d((v2f64)(__b), (v2f64)(__a)))
|
|
1203
|
+
|
|
1204
|
+
/* Shift Left Logical: shl -> ri = ai << bi; */
|
|
1205
|
+
#define msa_shlq_u8(__a, __b) \
|
|
1206
|
+
((v16u8)__builtin_msa_sll_b((v16i8)(__a), (v16i8)(__b)))
|
|
1207
|
+
#define msa_shlq_s8(__a, __b) \
|
|
1208
|
+
((v16i8)__builtin_msa_sll_b((v16i8)(__a), (v16i8)(__b)))
|
|
1209
|
+
#define msa_shlq_u16(__a, __b) \
|
|
1210
|
+
((v8u16)__builtin_msa_sll_h((v8i16)(__a), (v8i16)(__b)))
|
|
1211
|
+
#define msa_shlq_s16(__a, __b) \
|
|
1212
|
+
((v8i16)__builtin_msa_sll_h((v8i16)(__a), (v8i16)(__b)))
|
|
1213
|
+
#define msa_shlq_u32(__a, __b) \
|
|
1214
|
+
((v4u32)__builtin_msa_sll_w((v4i32)(__a), (v4i32)(__b)))
|
|
1215
|
+
#define msa_shlq_s32(__a, __b) \
|
|
1216
|
+
((v4i32)__builtin_msa_sll_w((v4i32)(__a), (v4i32)(__b)))
|
|
1217
|
+
#define msa_shlq_u64(__a, __b) \
|
|
1218
|
+
((v2u64)__builtin_msa_sll_d((v2i64)(__a), (v2i64)(__b)))
|
|
1219
|
+
#define msa_shlq_s64(__a, __b) \
|
|
1220
|
+
((v2i64)__builtin_msa_sll_d((v2i64)(__a), (v2i64)(__b)))
|
|
1221
|
+
|
|
1222
|
+
/* Immediate Shift Left Logical: shl -> ri = ai << imm; */
|
|
1223
|
+
#define msa_shlq_n_u8(__a, __imm) \
|
|
1224
|
+
((v16u8)__builtin_msa_slli_b((v16i8)(__a), __imm))
|
|
1225
|
+
#define msa_shlq_n_s8(__a, __imm) \
|
|
1226
|
+
((v16i8)__builtin_msa_slli_b((v16i8)(__a), __imm))
|
|
1227
|
+
#define msa_shlq_n_u16(__a, __imm) \
|
|
1228
|
+
((v8u16)__builtin_msa_slli_h((v8i16)(__a), __imm))
|
|
1229
|
+
#define msa_shlq_n_s16(__a, __imm) \
|
|
1230
|
+
((v8i16)__builtin_msa_slli_h((v8i16)(__a), __imm))
|
|
1231
|
+
#define msa_shlq_n_u32(__a, __imm) \
|
|
1232
|
+
((v4u32)__builtin_msa_slli_w((v4i32)(__a), __imm))
|
|
1233
|
+
#define msa_shlq_n_s32(__a, __imm) \
|
|
1234
|
+
((v4i32)__builtin_msa_slli_w((v4i32)(__a), __imm))
|
|
1235
|
+
#define msa_shlq_n_u64(__a, __imm) \
|
|
1236
|
+
((v2u64)__builtin_msa_slli_d((v2i64)(__a), __imm))
|
|
1237
|
+
#define msa_shlq_n_s64(__a, __imm) \
|
|
1238
|
+
((v2i64)__builtin_msa_slli_d((v2i64)(__a), __imm))
|
|
1239
|
+
|
|
1240
|
+
/* shift right: shrq -> ri = ai >> bi; */
|
|
1241
|
+
#define msa_shrq_u8(__a, __b) \
|
|
1242
|
+
((v16u8)__builtin_msa_srl_b((v16i8)(__a), (v16i8)(__b)))
|
|
1243
|
+
#define msa_shrq_s8(__a, __b) \
|
|
1244
|
+
((v16i8)__builtin_msa_sra_b((v16i8)(__a), (v16i8)(__b)))
|
|
1245
|
+
#define msa_shrq_u16(__a, __b) \
|
|
1246
|
+
((v8u16)__builtin_msa_srl_h((v8i16)(__a), (v8i16)(__b)))
|
|
1247
|
+
#define msa_shrq_s16(__a, __b) \
|
|
1248
|
+
((v8i16)__builtin_msa_sra_h((v8i16)(__a), (v8i16)(__b)))
|
|
1249
|
+
#define msa_shrq_u32(__a, __b) \
|
|
1250
|
+
((v4u32)__builtin_msa_srl_w((v4i32)(__a), (v4i32)(__b)))
|
|
1251
|
+
#define msa_shrq_s32(__a, __b) \
|
|
1252
|
+
((v4i32)__builtin_msa_sra_w((v4i32)(__a), (v4i32)(__b)))
|
|
1253
|
+
#define msa_shrq_u64(__a, __b) \
|
|
1254
|
+
((v2u64)__builtin_msa_srl_d((v2i64)(__a), (v2i64)(__b)))
|
|
1255
|
+
#define msa_shrq_s64(__a, __b) \
|
|
1256
|
+
((v2i64)__builtin_msa_sra_d((v2i64)(__a), (v2i64)(__b)))
|
|
1257
|
+
|
|
1258
|
+
/* Immediate Shift Right: shr -> ri = ai >> imm; */
|
|
1259
|
+
#define msa_shrq_n_u8(__a, __imm) \
|
|
1260
|
+
((v16u8)__builtin_msa_srli_b((v16i8)(__a), __imm))
|
|
1261
|
+
#define msa_shrq_n_s8(__a, __imm) \
|
|
1262
|
+
((v16i8)__builtin_msa_srai_b((v16i8)(__a), __imm))
|
|
1263
|
+
#define msa_shrq_n_u16(__a, __imm) \
|
|
1264
|
+
((v8u16)__builtin_msa_srli_h((v8i16)(__a), __imm))
|
|
1265
|
+
#define msa_shrq_n_s16(__a, __imm) \
|
|
1266
|
+
((v8i16)__builtin_msa_srai_h((v8i16)(__a), __imm))
|
|
1267
|
+
#define msa_shrq_n_u32(__a, __imm) \
|
|
1268
|
+
((v4u32)__builtin_msa_srli_w((v4i32)(__a), __imm))
|
|
1269
|
+
#define msa_shrq_n_s32(__a, __imm) \
|
|
1270
|
+
((v4i32)__builtin_msa_srai_w((v4i32)(__a), __imm))
|
|
1271
|
+
#define msa_shrq_n_u64(__a, __imm) \
|
|
1272
|
+
((v2u64)__builtin_msa_srli_d((v2i64)(__a), __imm))
|
|
1273
|
+
#define msa_shrq_n_s64(__a, __imm) \
|
|
1274
|
+
((v2i64)__builtin_msa_srai_d((v2i64)(__a), __imm))
|
|
1275
|
+
|
|
1276
|
+
/* Immediate Shift Right Rounded: shr -> ri = ai >> (rounded)imm; */
|
|
1277
|
+
#define msa_rshrq_n_u8(__a, __imm) \
|
|
1278
|
+
((v16u8)__builtin_msa_srlri_b((v16i8)(__a), __imm))
|
|
1279
|
+
#define msa_rshrq_n_s8(__a, __imm) \
|
|
1280
|
+
((v16i8)__builtin_msa_srari_b((v16i8)(__a), __imm))
|
|
1281
|
+
#define msa_rshrq_n_u16(__a, __imm) \
|
|
1282
|
+
((v8u16)__builtin_msa_srlri_h((v8i16)(__a), __imm))
|
|
1283
|
+
#define msa_rshrq_n_s16(__a, __imm) \
|
|
1284
|
+
((v8i16)__builtin_msa_srari_h((v8i16)(__a), __imm))
|
|
1285
|
+
#define msa_rshrq_n_u32(__a, __imm) \
|
|
1286
|
+
((v4u32)__builtin_msa_srlri_w((v4i32)(__a), __imm))
|
|
1287
|
+
#define msa_rshrq_n_s32(__a, __imm) \
|
|
1288
|
+
((v4i32)__builtin_msa_srari_w((v4i32)(__a), __imm))
|
|
1289
|
+
#define msa_rshrq_n_u64(__a, __imm) \
|
|
1290
|
+
((v2u64)__builtin_msa_srlri_d((v2i64)(__a), __imm))
|
|
1291
|
+
#define msa_rshrq_n_s64(__a, __imm) \
|
|
1292
|
+
((v2i64)__builtin_msa_srari_d((v2i64)(__a), __imm))
|
|
1293
|
+
|
|
1294
|
+
/* Vector saturating rounding shift left, qrshl -> ri = ai << bi; */
|
|
1295
|
+
#define msa_qrshrq_s32(a, b) ((v4i32)__msa_srar_w((v4i32)(a), (v4i32)(b)))
|
|
1296
|
+
|
|
1297
|
+
/* Rename the msa builtin func to unify the name style for intrin_msa.hpp */
|
|
1298
|
+
#define msa_qaddq_u8 __builtin_msa_adds_u_b
|
|
1299
|
+
#define msa_qaddq_s8 __builtin_msa_adds_s_b
|
|
1300
|
+
#define msa_qaddq_u16 __builtin_msa_adds_u_h
|
|
1301
|
+
#define msa_qaddq_s16 __builtin_msa_adds_s_h
|
|
1302
|
+
#define msa_qaddq_u32 __builtin_msa_adds_u_w
|
|
1303
|
+
#define msa_qaddq_s32 __builtin_msa_adds_s_w
|
|
1304
|
+
#define msa_qaddq_u64 __builtin_msa_adds_u_d
|
|
1305
|
+
#define msa_qaddq_s64 __builtin_msa_adds_s_d
|
|
1306
|
+
#define msa_addq_u8(a, b) ((v16u8)__builtin_msa_addv_b((v16i8)(a), (v16i8)(b)))
|
|
1307
|
+
#define msa_addq_s8 __builtin_msa_addv_b
|
|
1308
|
+
#define msa_addq_u16(a, b) ((v8u16)__builtin_msa_addv_h((v8i16)(a), (v8i16)(b)))
|
|
1309
|
+
#define msa_addq_s16 __builtin_msa_addv_h
|
|
1310
|
+
#define msa_addq_u32(a, b) ((v4u32)__builtin_msa_addv_w((v4i32)(a), (v4i32)(b)))
|
|
1311
|
+
#define msa_addq_s32 __builtin_msa_addv_w
|
|
1312
|
+
#define msa_addq_f32 __builtin_msa_fadd_w
|
|
1313
|
+
#define msa_addq_u64(a, b) ((v2u64)__builtin_msa_addv_d((v2i64)(a), (v2i64)(b)))
|
|
1314
|
+
#define msa_addq_s64 __builtin_msa_addv_d
|
|
1315
|
+
#define msa_addq_f64 __builtin_msa_fadd_d
|
|
1316
|
+
#define msa_qsubq_u8 __builtin_msa_subs_u_b
|
|
1317
|
+
#define msa_qsubq_s8 __builtin_msa_subs_s_b
|
|
1318
|
+
#define msa_qsubq_u16 __builtin_msa_subs_u_h
|
|
1319
|
+
#define msa_qsubq_s16 __builtin_msa_subs_s_h
|
|
1320
|
+
#define msa_subq_u8(a, b) ((v16u8)__builtin_msa_subv_b((v16i8)(a), (v16i8)(b)))
|
|
1321
|
+
#define msa_subq_s8 __builtin_msa_subv_b
|
|
1322
|
+
#define msa_subq_u16(a, b) ((v8u16)__builtin_msa_subv_h((v8i16)(a), (v8i16)(b)))
|
|
1323
|
+
#define msa_subq_s16 __builtin_msa_subv_h
|
|
1324
|
+
#define msa_subq_u32(a, b) ((v4u32)__builtin_msa_subv_w((v4i32)(a), (v4i32)(b)))
|
|
1325
|
+
#define msa_subq_s32 __builtin_msa_subv_w
|
|
1326
|
+
#define msa_subq_f32 __builtin_msa_fsub_w
|
|
1327
|
+
#define msa_subq_u64(a, b) ((v2u64)__builtin_msa_subv_d((v2i64)(a), (v2i64)(b)))
|
|
1328
|
+
#define msa_subq_s64 __builtin_msa_subv_d
|
|
1329
|
+
#define msa_subq_f64 __builtin_msa_fsub_d
|
|
1330
|
+
#define msa_mulq_u8(a, b) ((v16u8)__builtin_msa_mulv_b((v16i8)(a), (v16i8)(b)))
|
|
1331
|
+
#define msa_mulq_s8(a, b) ((v16i8)__builtin_msa_mulv_b((v16i8)(a), (v16i8)(b)))
|
|
1332
|
+
#define msa_mulq_u16(a, b) ((v8u16)__builtin_msa_mulv_h((v8i16)(a), (v8i16)(b)))
|
|
1333
|
+
#define msa_mulq_s16(a, b) ((v8i16)__builtin_msa_mulv_h((v8i16)(a), (v8i16)(b)))
|
|
1334
|
+
#define msa_mulq_u32(a, b) ((v4u32)__builtin_msa_mulv_w((v4i32)(a), (v4i32)(b)))
|
|
1335
|
+
#define msa_mulq_s32(a, b) ((v4i32)__builtin_msa_mulv_w((v4i32)(a), (v4i32)(b)))
|
|
1336
|
+
#define msa_mulq_u64(a, b) ((v2u64)__builtin_msa_mulv_d((v2i64)(a), (v2i64)(b)))
|
|
1337
|
+
#define msa_mulq_s64(a, b) ((v2i64)__builtin_msa_mulv_d((v2i64)(a), (v2i64)(b)))
|
|
1338
|
+
#define msa_mulq_f32 __builtin_msa_fmul_w
|
|
1339
|
+
#define msa_mulq_f64 __builtin_msa_fmul_d
|
|
1340
|
+
#define msa_divq_f32 __builtin_msa_fdiv_w
|
|
1341
|
+
#define msa_divq_f64 __builtin_msa_fdiv_d
|
|
1342
|
+
#define msa_dotp_s_h __builtin_msa_dotp_s_h
|
|
1343
|
+
#define msa_dotp_s_w __builtin_msa_dotp_s_w
|
|
1344
|
+
#define msa_dotp_s_d __builtin_msa_dotp_s_d
|
|
1345
|
+
#define msa_dotp_u_h __builtin_msa_dotp_u_h
|
|
1346
|
+
#define msa_dotp_u_w __builtin_msa_dotp_u_w
|
|
1347
|
+
#define msa_dotp_u_d __builtin_msa_dotp_u_d
|
|
1348
|
+
#define msa_dpadd_s_h __builtin_msa_dpadd_s_h
|
|
1349
|
+
#define msa_dpadd_s_w __builtin_msa_dpadd_s_w
|
|
1350
|
+
#define msa_dpadd_s_d __builtin_msa_dpadd_s_d
|
|
1351
|
+
#define msa_dpadd_u_h __builtin_msa_dpadd_u_h
|
|
1352
|
+
#define msa_dpadd_u_w __builtin_msa_dpadd_u_w
|
|
1353
|
+
#define msa_dpadd_u_d __builtin_msa_dpadd_u_d
|
|
1354
|
+
|
|
1355
|
+
#define ILVRL_B2(RTYPE, in0, in1, low, hi) \
|
|
1356
|
+
do { \
|
|
1357
|
+
low = (RTYPE)__builtin_msa_ilvr_b((v16i8)(in0), (v16i8)(in1)); \
|
|
1358
|
+
hi = (RTYPE)__builtin_msa_ilvl_b((v16i8)(in0), (v16i8)(in1)); \
|
|
1359
|
+
} while (0)
|
|
1360
|
+
#define ILVRL_B2_UB(...) ILVRL_B2(v16u8, __VA_ARGS__)
|
|
1361
|
+
#define ILVRL_B2_SB(...) ILVRL_B2(v16i8, __VA_ARGS__)
|
|
1362
|
+
#define ILVRL_B2_UH(...) ILVRL_B2(v8u16, __VA_ARGS__)
|
|
1363
|
+
#define ILVRL_B2_SH(...) ILVRL_B2(v8i16, __VA_ARGS__)
|
|
1364
|
+
#define ILVRL_B2_SW(...) ILVRL_B2(v4i32, __VA_ARGS__)
|
|
1365
|
+
|
|
1366
|
+
#define ILVRL_H2(RTYPE, in0, in1, low, hi) \
|
|
1367
|
+
do { \
|
|
1368
|
+
low = (RTYPE)__builtin_msa_ilvr_h((v8i16)(in0), (v8i16)(in1)); \
|
|
1369
|
+
hi = (RTYPE)__builtin_msa_ilvl_h((v8i16)(in0), (v8i16)(in1)); \
|
|
1370
|
+
} while (0)
|
|
1371
|
+
#define ILVRL_H2_UB(...) ILVRL_H2(v16u8, __VA_ARGS__)
|
|
1372
|
+
#define ILVRL_H2_SB(...) ILVRL_H2(v16i8, __VA_ARGS__)
|
|
1373
|
+
#define ILVRL_H2_UH(...) ILVRL_H2(v8u16, __VA_ARGS__)
|
|
1374
|
+
#define ILVRL_H2_SH(...) ILVRL_H2(v8i16, __VA_ARGS__)
|
|
1375
|
+
#define ILVRL_H2_SW(...) ILVRL_H2(v4i32, __VA_ARGS__)
|
|
1376
|
+
#define ILVRL_H2_UW(...) ILVRL_H2(v4u32, __VA_ARGS__)
|
|
1377
|
+
|
|
1378
|
+
#define ILVRL_W2(RTYPE, in0, in1, low, hi) \
|
|
1379
|
+
do { \
|
|
1380
|
+
low = (RTYPE)__builtin_msa_ilvr_w((v4i32)(in0), (v4i32)(in1)); \
|
|
1381
|
+
hi = (RTYPE)__builtin_msa_ilvl_w((v4i32)(in0), (v4i32)(in1)); \
|
|
1382
|
+
} while (0)
|
|
1383
|
+
#define ILVRL_W2_UB(...) ILVRL_W2(v16u8, __VA_ARGS__)
|
|
1384
|
+
#define ILVRL_W2_SH(...) ILVRL_W2(v8i16, __VA_ARGS__)
|
|
1385
|
+
#define ILVRL_W2_SW(...) ILVRL_W2(v4i32, __VA_ARGS__)
|
|
1386
|
+
#define ILVRL_W2_UW(...) ILVRL_W2(v4u32, __VA_ARGS__)
|
|
1387
|
+
|
|
1388
|
+
/* absq, qabsq (r = |a|;) */
|
|
1389
|
+
#define msa_absq_s8(a) __builtin_msa_add_a_b(a, __builtin_msa_fill_b(0))
|
|
1390
|
+
#define msa_absq_s16(a) __builtin_msa_add_a_h(a, __builtin_msa_fill_h(0))
|
|
1391
|
+
#define msa_absq_s32(a) __builtin_msa_add_a_w(a, __builtin_msa_fill_w(0))
|
|
1392
|
+
#define msa_absq_s64(a) __builtin_msa_add_a_d(a, __builtin_msa_fill_d(0))
|
|
1393
|
+
#define msa_absq_f32(a) ((v4f32)__builtin_msa_bclri_w((v4u32)(a), 31))
|
|
1394
|
+
#define msa_absq_f64(a) ((v2f64)__builtin_msa_bclri_d((v2u64)(a), 63))
|
|
1395
|
+
#define msa_qabsq_s8(a) __builtin_msa_adds_a_b(a, __builtin_msa_fill_b(0))
|
|
1396
|
+
#define msa_qabsq_s16(a) __builtin_msa_adds_a_h(a, __builtin_msa_fill_h(0))
|
|
1397
|
+
#define msa_qabsq_s32(a) __builtin_msa_adds_a_w(a, __builtin_msa_fill_w(0))
|
|
1398
|
+
#define msa_qabsq_s64(a) __builtin_msa_adds_a_d(a, __builtin_msa_fill_d(0))
|
|
1399
|
+
|
|
1400
|
+
/* abdq, qabdq (r = |a - b|;) */
|
|
1401
|
+
#define msa_abdq_u8 __builtin_msa_asub_u_b
|
|
1402
|
+
#define msa_abdq_s8 __builtin_msa_asub_s_b
|
|
1403
|
+
#define msa_abdq_u16 __builtin_msa_asub_u_h
|
|
1404
|
+
#define msa_abdq_s16 __builtin_msa_asub_s_h
|
|
1405
|
+
#define msa_abdq_u32 __builtin_msa_asub_u_w
|
|
1406
|
+
#define msa_abdq_s32 __builtin_msa_asub_s_w
|
|
1407
|
+
#define msa_abdq_u64 __builtin_msa_asub_u_d
|
|
1408
|
+
#define msa_abdq_s64 __builtin_msa_asub_s_d
|
|
1409
|
+
#define msa_abdq_f32(a, b) msa_absq_f32(__builtin_msa_fsub_w(a, b))
|
|
1410
|
+
#define msa_abdq_f64(a, b) msa_absq_f64(__builtin_msa_fsub_d(a, b))
|
|
1411
|
+
#define msa_qabdq_s8(a, b) msa_qabsq_s8(__builtin_msa_subs_s_b(a, b))
|
|
1412
|
+
#define msa_qabdq_s16(a, b) msa_qabsq_s16(__builtin_msa_subs_s_h(a, b))
|
|
1413
|
+
#define msa_qabdq_s32(a, b) msa_qabsq_s32(__builtin_msa_subs_s_w(a, b))
|
|
1414
|
+
#define msa_qabdq_s64(a, b) msa_qabsq_s64(__builtin_msa_subs_s_d(a, b))
|
|
1415
|
+
|
|
1416
|
+
/* sqrtq, rsqrtq */
|
|
1417
|
+
#define msa_sqrtq_f32 __builtin_msa_fsqrt_w
|
|
1418
|
+
#define msa_sqrtq_f64 __builtin_msa_fsqrt_d
|
|
1419
|
+
#define msa_rsqrtq_f32 __builtin_msa_frsqrt_w
|
|
1420
|
+
#define msa_rsqrtq_f64 __builtin_msa_frsqrt_d
|
|
1421
|
+
|
|
1422
|
+
/* mlaq: r = a + b * c; */
|
|
1423
|
+
__extension__ extern __inline v4i32
|
|
1424
|
+
__attribute__((__always_inline__, __gnu_inline__, __artificial__))
|
|
1425
|
+
msa_mlaq_s32(v4i32 __a, v4i32 __b, v4i32 __c) {
|
|
1426
|
+
__asm__ volatile("maddv.w %w[__a], %w[__b], %w[__c]\n"
|
|
1427
|
+
// Outputs
|
|
1428
|
+
: [__a] "+f"(__a)
|
|
1429
|
+
// Inputs
|
|
1430
|
+
: [__b] "f"(__b), [__c] "f"(__c));
|
|
1431
|
+
return __a;
|
|
1432
|
+
}
|
|
1433
|
+
|
|
1434
|
+
__extension__ extern __inline v2i64
|
|
1435
|
+
__attribute__((__always_inline__, __gnu_inline__, __artificial__))
|
|
1436
|
+
msa_mlaq_s64(v2i64 __a, v2i64 __b, v2i64 __c) {
|
|
1437
|
+
__asm__ volatile("maddv.d %w[__a], %w[__b], %w[__c]\n"
|
|
1438
|
+
// Outputs
|
|
1439
|
+
: [__a] "+f"(__a)
|
|
1440
|
+
// Inputs
|
|
1441
|
+
: [__b] "f"(__b), [__c] "f"(__c));
|
|
1442
|
+
return __a;
|
|
1443
|
+
}
|
|
1444
|
+
|
|
1445
|
+
__extension__ extern __inline v4f32
|
|
1446
|
+
__attribute__((__always_inline__, __gnu_inline__, __artificial__))
|
|
1447
|
+
msa_mlaq_f32(v4f32 __a, v4f32 __b, v4f32 __c) {
|
|
1448
|
+
__asm__ volatile("fmadd.w %w[__a], %w[__b], %w[__c]\n"
|
|
1449
|
+
// Outputs
|
|
1450
|
+
: [__a] "+f"(__a)
|
|
1451
|
+
// Inputs
|
|
1452
|
+
: [__b] "f"(__b), [__c] "f"(__c));
|
|
1453
|
+
return __a;
|
|
1454
|
+
}
|
|
1455
|
+
|
|
1456
|
+
__extension__ extern __inline v2f64
|
|
1457
|
+
__attribute__((__always_inline__, __gnu_inline__, __artificial__))
|
|
1458
|
+
msa_mlaq_f64(v2f64 __a, v2f64 __b, v2f64 __c) {
|
|
1459
|
+
__asm__ volatile("fmadd.d %w[__a], %w[__b], %w[__c]\n"
|
|
1460
|
+
// Outputs
|
|
1461
|
+
: [__a] "+f"(__a)
|
|
1462
|
+
// Inputs
|
|
1463
|
+
: [__b] "f"(__b), [__c] "f"(__c));
|
|
1464
|
+
return __a;
|
|
1465
|
+
}
|
|
1466
|
+
|
|
1467
|
+
/* cntq */
|
|
1468
|
+
#define msa_cntq_s8 __builtin_msa_pcnt_b
|
|
1469
|
+
#define msa_cntq_s16 __builtin_msa_pcnt_h
|
|
1470
|
+
#define msa_cntq_s32 __builtin_msa_pcnt_w
|
|
1471
|
+
#define msa_cntq_s64 __builtin_msa_pcnt_d
|
|
1472
|
+
|
|
1473
|
+
/* bslq (a: mask; r = b(if a == 0); r = c(if a == 1);) */
|
|
1474
|
+
#define msa_bslq_u8 __builtin_msa_bsel_v
|
|
1475
|
+
|
|
1476
|
+
/* ilvrq, ilvlq (For EL only, ilvrq: b0, a0, b1, a1; ilvlq: b2, a2, b3, a3;) */
|
|
1477
|
+
#define msa_ilvrq_s8 __builtin_msa_ilvr_b
|
|
1478
|
+
#define msa_ilvrq_s16 __builtin_msa_ilvr_h
|
|
1479
|
+
#define msa_ilvrq_s32 __builtin_msa_ilvr_w
|
|
1480
|
+
#define msa_ilvrq_s64 __builtin_msa_ilvr_d
|
|
1481
|
+
#define msa_ilvlq_s8 __builtin_msa_ilvl_b
|
|
1482
|
+
#define msa_ilvlq_s16 __builtin_msa_ilvl_h
|
|
1483
|
+
#define msa_ilvlq_s32 __builtin_msa_ilvl_w
|
|
1484
|
+
#define msa_ilvlq_s64 __builtin_msa_ilvl_d
|
|
1485
|
+
|
|
1486
|
+
/* ilvevq, ilvodq (ilvevq: b0, a0, b2, a2; ilvodq: b1, a1, b3, a3; ) */
|
|
1487
|
+
#define msa_ilvevq_s8 __builtin_msa_ilvev_b
|
|
1488
|
+
#define msa_ilvevq_s16 __builtin_msa_ilvev_h
|
|
1489
|
+
#define msa_ilvevq_s32 __builtin_msa_ilvev_w
|
|
1490
|
+
#define msa_ilvevq_s64 __builtin_msa_ilvev_d
|
|
1491
|
+
#define msa_ilvodq_s8 __builtin_msa_ilvod_b
|
|
1492
|
+
#define msa_ilvodq_s16 __builtin_msa_ilvod_h
|
|
1493
|
+
#define msa_ilvodq_s32 __builtin_msa_ilvod_w
|
|
1494
|
+
#define msa_ilvodq_s64 __builtin_msa_ilvod_d
|
|
1495
|
+
|
|
1496
|
+
/* extq (r = (a || b); a concatenation b and get elements from index c) */
|
|
1497
|
+
#ifdef _MIPSEB
|
|
1498
|
+
#define msa_extq_s8(a, b, c) \
|
|
1499
|
+
(__builtin_msa_vshf_b( \
|
|
1500
|
+
__builtin_msa_subv_b( \
|
|
1501
|
+
(v16i8)((v2i64){0x1716151413121110, 0x1F1E1D1C1B1A1918}), \
|
|
1502
|
+
__builtin_msa_fill_b(c)), \
|
|
1503
|
+
a, b))
|
|
1504
|
+
#define msa_extq_s16(a, b, c) \
|
|
1505
|
+
(__builtin_msa_vshf_h( \
|
|
1506
|
+
__builtin_msa_subv_h( \
|
|
1507
|
+
(v8i16)((v2i64){0x000B000A00090008, 0x000F000E000D000C}), \
|
|
1508
|
+
__builtin_msa_fill_h(c)), \
|
|
1509
|
+
a, b))
|
|
1510
|
+
#define msa_extq_s32(a, b, c) \
|
|
1511
|
+
(__builtin_msa_vshf_w( \
|
|
1512
|
+
__builtin_msa_subv_w( \
|
|
1513
|
+
(v4i32)((v2i64){0x0000000500000004, 0x0000000700000006}), \
|
|
1514
|
+
__builtin_msa_fill_w(c)), \
|
|
1515
|
+
a, b))
|
|
1516
|
+
#define msa_extq_s64(a, b, c) \
|
|
1517
|
+
(__builtin_msa_vshf_d( \
|
|
1518
|
+
__builtin_msa_subv_d((v2i64){0x0000000000000002, 0x0000000000000003}, \
|
|
1519
|
+
__builtin_msa_fill_d(c)), \
|
|
1520
|
+
a, b))
|
|
1521
|
+
#else
|
|
1522
|
+
#define msa_extq_s8(a, b, c) \
|
|
1523
|
+
(__builtin_msa_vshf_b( \
|
|
1524
|
+
__builtin_msa_addv_b( \
|
|
1525
|
+
(v16i8)((v2i64){0x0706050403020100, 0x0F0E0D0C0B0A0908}), \
|
|
1526
|
+
__builtin_msa_fill_b(c)), \
|
|
1527
|
+
b, a))
|
|
1528
|
+
#define msa_extq_s16(a, b, c) \
|
|
1529
|
+
(__builtin_msa_vshf_h( \
|
|
1530
|
+
__builtin_msa_addv_h( \
|
|
1531
|
+
(v8i16)((v2i64){0x0003000200010000, 0x0007000600050004}), \
|
|
1532
|
+
__builtin_msa_fill_h(c)), \
|
|
1533
|
+
b, a))
|
|
1534
|
+
#define msa_extq_s32(a, b, c) \
|
|
1535
|
+
(__builtin_msa_vshf_w( \
|
|
1536
|
+
__builtin_msa_addv_w( \
|
|
1537
|
+
(v4i32)((v2i64){0x0000000100000000, 0x0000000300000002}), \
|
|
1538
|
+
__builtin_msa_fill_w(c)), \
|
|
1539
|
+
b, a))
|
|
1540
|
+
#define msa_extq_s64(a, b, c) \
|
|
1541
|
+
(__builtin_msa_vshf_d( \
|
|
1542
|
+
__builtin_msa_addv_d((v2i64){0x0000000000000000, 0x0000000000000001}, \
|
|
1543
|
+
__builtin_msa_fill_d(c)), \
|
|
1544
|
+
b, a))
|
|
1545
|
+
#endif /* _MIPSEB */
|
|
1546
|
+
|
|
1547
|
+
/* cvttruncq, cvttintq, cvtrintq */
|
|
1548
|
+
#define msa_cvttruncq_u32_f32 __builtin_msa_ftrunc_u_w
|
|
1549
|
+
#define msa_cvttruncq_s32_f32 __builtin_msa_ftrunc_s_w
|
|
1550
|
+
#define msa_cvttruncq_u64_f64 __builtin_msa_ftrunc_u_d
|
|
1551
|
+
#define msa_cvttruncq_s64_f64 __builtin_msa_ftrunc_s_d
|
|
1552
|
+
#define msa_cvttintq_u32_f32 __builtin_msa_ftint_u_w
|
|
1553
|
+
#define msa_cvttintq_s32_f32 __builtin_msa_ftint_s_w
|
|
1554
|
+
#define msa_cvttintq_u64_f64 __builtin_msa_ftint_u_d
|
|
1555
|
+
#define msa_cvttintq_s64_f64 __builtin_msa_ftint_s_d
|
|
1556
|
+
#define msa_cvtrintq_f32 __builtin_msa_frint_w
|
|
1557
|
+
#define msa_cvtrintq_f64 __builtin_msa_frint_d
|
|
1558
|
+
|
|
1559
|
+
/* cvtfintq, cvtfq */
|
|
1560
|
+
#define msa_cvtfintq_f32_u32 __builtin_msa_ffint_u_w
|
|
1561
|
+
#define msa_cvtfintq_f32_s32 __builtin_msa_ffint_s_w
|
|
1562
|
+
#define msa_cvtfintq_f64_u64 __builtin_msa_ffint_u_d
|
|
1563
|
+
#define msa_cvtfintq_f64_s64 __builtin_msa_ffint_s_d
|
|
1564
|
+
#define msa_cvtfq_f32_f64 __builtin_msa_fexdo_w
|
|
1565
|
+
#define msa_cvtflq_f64_f32 __builtin_msa_fexupr_d
|
|
1566
|
+
#define msa_cvtfhq_f64_f32 __builtin_msa_fexupl_d
|
|
1567
|
+
|
|
1568
|
+
#define msa_addl_u8(a, b) \
|
|
1569
|
+
((v8u16)__builtin_msa_addv_h((v8i16)V8U8_2_V8I16(a), (v8i16)V8U8_2_V8I16(b)))
|
|
1570
|
+
#define msa_addl_s8(a, b) \
|
|
1571
|
+
(__builtin_msa_addv_h((v8i16)V8I8_2_V8I16(a), (v8i16)V8I8_2_V8I16(b)))
|
|
1572
|
+
#define msa_addl_u16(a, b) \
|
|
1573
|
+
((v4u32)__builtin_msa_addv_w((v4i32)V4U16_2_V4I32(a), \
|
|
1574
|
+
(v4i32)V4U16_2_V4I32(b)))
|
|
1575
|
+
#define msa_addl_s16(a, b) \
|
|
1576
|
+
(__builtin_msa_addv_w((v4i32)V4I16_2_V4I32(a), (v4i32)V4I16_2_V4I32(b)))
|
|
1577
|
+
#define msa_subl_s16(a, b) \
|
|
1578
|
+
(__builtin_msa_subv_w((v4i32)V4I16_2_V4I32(a), (v4i32)V4I16_2_V4I32(b)))
|
|
1579
|
+
#define msa_recpeq_f32 __builtin_msa_frcp_w
|
|
1580
|
+
#define msa_recpsq_f32(a, b) \
|
|
1581
|
+
(__builtin_msa_fsub_w(msa_dupq_n_f32(2.0f), __builtin_msa_fmul_w(a, b)))
|
|
1582
|
+
|
|
1583
|
+
#define MSA_INTERLEAVED_IMPL_LOAD2_STORE2(_Tp, _Tpv, _Tpvs, suffix, df, \
|
|
1584
|
+
nlanes) \
|
|
1585
|
+
__extension__ extern __inline void \
|
|
1586
|
+
__attribute__((__always_inline__, __gnu_inline__, \
|
|
1587
|
+
__artificial__)) msa_ld2q_##suffix(const _Tp *ptr, \
|
|
1588
|
+
_Tpv *a, _Tpv *b) { \
|
|
1589
|
+
_Tpv v0 = msa_ld1q_##suffix(ptr); \
|
|
1590
|
+
_Tpv v1 = msa_ld1q_##suffix(ptr + nlanes); \
|
|
1591
|
+
*a = (_Tpv)__builtin_msa_pckev_##df((_Tpvs)v1, (_Tpvs)v0); \
|
|
1592
|
+
*b = (_Tpv)__builtin_msa_pckod_##df((_Tpvs)v1, (_Tpvs)v0); \
|
|
1593
|
+
} \
|
|
1594
|
+
__extension__ extern __inline void \
|
|
1595
|
+
__attribute__((__always_inline__, __gnu_inline__, \
|
|
1596
|
+
__artificial__)) msa_st2q_##suffix(_Tp *ptr, \
|
|
1597
|
+
const _Tpv a, \
|
|
1598
|
+
const _Tpv b) { \
|
|
1599
|
+
msa_st1q_##suffix(ptr, (_Tpv)__builtin_msa_ilvr_##df((_Tpvs)b, (_Tpvs)a)); \
|
|
1600
|
+
msa_st1q_##suffix(ptr + nlanes, \
|
|
1601
|
+
(_Tpv)__builtin_msa_ilvl_##df((_Tpvs)b, (_Tpvs)a)); \
|
|
1602
|
+
}
|
|
1603
|
+
|
|
1604
|
+
MSA_INTERLEAVED_IMPL_LOAD2_STORE2(uint8_t, v16u8, v16i8, u8, b, 16)
|
|
1605
|
+
MSA_INTERLEAVED_IMPL_LOAD2_STORE2(int8_t, v16i8, v16i8, s8, b, 16)
|
|
1606
|
+
MSA_INTERLEAVED_IMPL_LOAD2_STORE2(uint16_t, v8u16, v8i16, u16, h, 8)
|
|
1607
|
+
MSA_INTERLEAVED_IMPL_LOAD2_STORE2(int16_t, v8i16, v8i16, s16, h, 8)
|
|
1608
|
+
MSA_INTERLEAVED_IMPL_LOAD2_STORE2(uint32_t, v4u32, v4i32, u32, w, 4)
|
|
1609
|
+
MSA_INTERLEAVED_IMPL_LOAD2_STORE2(int32_t, v4i32, v4i32, s32, w, 4)
|
|
1610
|
+
MSA_INTERLEAVED_IMPL_LOAD2_STORE2(float, v4f32, v4i32, f32, w, 4)
|
|
1611
|
+
MSA_INTERLEAVED_IMPL_LOAD2_STORE2(uint64_t, v2u64, v2i64, u64, d, 2)
|
|
1612
|
+
MSA_INTERLEAVED_IMPL_LOAD2_STORE2(int64_t, v2i64, v2i64, s64, d, 2)
|
|
1613
|
+
MSA_INTERLEAVED_IMPL_LOAD2_STORE2(double, v2f64, v2i64, f64, d, 2)
|
|
1614
|
+
|
|
1615
|
+
#ifdef _MIPSEB
|
|
1616
|
+
#define MSA_INTERLEAVED_IMPL_LOAD3_8(_Tp, _Tpv, _Tpvs, suffix) \
|
|
1617
|
+
__extension__ extern __inline void \
|
|
1618
|
+
__attribute__((__always_inline__, __gnu_inline__, \
|
|
1619
|
+
__artificial__)) msa_ld3q_##suffix(const _Tp *ptr, \
|
|
1620
|
+
_Tpv *a, _Tpv *b, \
|
|
1621
|
+
_Tpv *c) { \
|
|
1622
|
+
_Tpv v0 = msa_ld1q_##suffix(ptr); \
|
|
1623
|
+
_Tpv v1 = msa_ld1q_##suffix(ptr + 16); \
|
|
1624
|
+
_Tpv v2 = msa_ld1q_##suffix(ptr + 32); \
|
|
1625
|
+
_Tpvs v3 = __builtin_msa_vshf_b( \
|
|
1626
|
+
(_Tpvs)((v2i64){0x0704011F1F1F1F1F, 0x1F1C191613100D0A}), (_Tpvs)v0, \
|
|
1627
|
+
(_Tpvs)v1); \
|
|
1628
|
+
*a = (_Tpv)__builtin_msa_vshf_b( \
|
|
1629
|
+
(_Tpvs)((v2i64){0x1716150E0B080502, 0x1F1E1D1C1B1A1918}), v3, \
|
|
1630
|
+
(_Tpvs)v2); \
|
|
1631
|
+
v3 = __builtin_msa_vshf_b( \
|
|
1632
|
+
(_Tpvs)((v2i64){0x0603001F1F1F1F1F, 0x1E1B1815120F0C09}), (_Tpvs)v0, \
|
|
1633
|
+
(_Tpvs)v1); \
|
|
1634
|
+
*b = (_Tpv)__builtin_msa_vshf_b( \
|
|
1635
|
+
(_Tpvs)((v2i64){0x1716150D0A070401, 0x1F1E1D1C1B1A1918}), v3, \
|
|
1636
|
+
(_Tpvs)v2); \
|
|
1637
|
+
v3 = __builtin_msa_vshf_b( \
|
|
1638
|
+
(_Tpvs)((v2i64){0x05021F1F1F1F1F1F, 0x1D1A1714110E0B08}), (_Tpvs)v0, \
|
|
1639
|
+
(_Tpvs)v1); \
|
|
1640
|
+
*c = (_Tpv)__builtin_msa_vshf_b( \
|
|
1641
|
+
(_Tpvs)((v2i64){0x17160F0C09060300, 0x1F1E1D1C1B1A1918}), v3, \
|
|
1642
|
+
(_Tpvs)v2); \
|
|
1643
|
+
}
|
|
1644
|
+
#else
|
|
1645
|
+
#define MSA_INTERLEAVED_IMPL_LOAD3_8(_Tp, _Tpv, _Tpvs, suffix) \
|
|
1646
|
+
__extension__ extern __inline void \
|
|
1647
|
+
__attribute__((__always_inline__, __gnu_inline__, \
|
|
1648
|
+
__artificial__)) msa_ld3q_##suffix(const _Tp *ptr, \
|
|
1649
|
+
_Tpv *a, _Tpv *b, \
|
|
1650
|
+
_Tpv *c) { \
|
|
1651
|
+
_Tpv v0 = msa_ld1q_##suffix(ptr); \
|
|
1652
|
+
_Tpv v1 = msa_ld1q_##suffix(ptr + 16); \
|
|
1653
|
+
_Tpv v2 = msa_ld1q_##suffix(ptr + 32); \
|
|
1654
|
+
_Tpvs v3 = __builtin_msa_vshf_b( \
|
|
1655
|
+
(_Tpvs)((v2i64){0x15120F0C09060300, 0x00000000001E1B18}), (_Tpvs)v1, \
|
|
1656
|
+
(_Tpvs)v0); \
|
|
1657
|
+
*a = (_Tpv)__builtin_msa_vshf_b( \
|
|
1658
|
+
(_Tpvs)((v2i64){0x0706050403020100, 0x1D1A1714110A0908}), (_Tpvs)v2, \
|
|
1659
|
+
v3); \
|
|
1660
|
+
v3 = __builtin_msa_vshf_b( \
|
|
1661
|
+
(_Tpvs)((v2i64){0x1613100D0A070401, 0x00000000001F1C19}), (_Tpvs)v1, \
|
|
1662
|
+
(_Tpvs)v0); \
|
|
1663
|
+
*b = (_Tpv)__builtin_msa_vshf_b( \
|
|
1664
|
+
(_Tpvs)((v2i64){0x0706050403020100, 0x1E1B1815120A0908}), (_Tpvs)v2, \
|
|
1665
|
+
v3); \
|
|
1666
|
+
v3 = __builtin_msa_vshf_b( \
|
|
1667
|
+
(_Tpvs)((v2i64){0x1714110E0B080502, 0x0000000000001D1A}), (_Tpvs)v1, \
|
|
1668
|
+
(_Tpvs)v0); \
|
|
1669
|
+
*c = (_Tpv)__builtin_msa_vshf_b( \
|
|
1670
|
+
(_Tpvs)((v2i64){0x0706050403020100, 0x1F1C191613100908}), (_Tpvs)v2, \
|
|
1671
|
+
v3); \
|
|
1672
|
+
}
|
|
1673
|
+
#endif
|
|
1674
|
+
|
|
1675
|
+
MSA_INTERLEAVED_IMPL_LOAD3_8(uint8_t, v16u8, v16i8, u8)
|
|
1676
|
+
MSA_INTERLEAVED_IMPL_LOAD3_8(int8_t, v16i8, v16i8, s8)
|
|
1677
|
+
|
|
1678
|
+
#ifdef _MIPSEB
|
|
1679
|
+
#define MSA_INTERLEAVED_IMPL_LOAD3_16(_Tp, _Tpv, _Tpvs, suffix) \
|
|
1680
|
+
__extension__ extern __inline void \
|
|
1681
|
+
__attribute__((__always_inline__, __gnu_inline__, \
|
|
1682
|
+
__artificial__)) msa_ld3q_##suffix(const _Tp *ptr, \
|
|
1683
|
+
_Tpv *a, _Tpv *b, \
|
|
1684
|
+
_Tpv *c) { \
|
|
1685
|
+
_Tpv v0 = msa_ld1q_##suffix(ptr); \
|
|
1686
|
+
_Tpv v1 = msa_ld1q_##suffix(ptr + 8); \
|
|
1687
|
+
_Tpv v2 = msa_ld1q_##suffix(ptr + 16); \
|
|
1688
|
+
_Tpvs v3 = __builtin_msa_vshf_h( \
|
|
1689
|
+
(_Tpvs)((v2i64){0x00030000000F000F, 0x000F000C00090006}), (_Tpvs)v1, \
|
|
1690
|
+
(_Tpvs)v0); \
|
|
1691
|
+
*a = (_Tpv)__builtin_msa_vshf_h( \
|
|
1692
|
+
(_Tpvs)((v2i64){0x000B000A00050002, 0x000F000E000D000C}), (_Tpvs)v2, \
|
|
1693
|
+
v3); \
|
|
1694
|
+
v3 = __builtin_msa_vshf_h( \
|
|
1695
|
+
(_Tpvs)((v2i64){0x0002000F000F000F, 0x000E000B00080005}), (_Tpvs)v1, \
|
|
1696
|
+
(_Tpvs)v0); \
|
|
1697
|
+
*b = (_Tpv)__builtin_msa_vshf_h( \
|
|
1698
|
+
(_Tpvs)((v2i64){0x000B000700040001, 0x000F000E000D000C}), (_Tpvs)v2, \
|
|
1699
|
+
v3); \
|
|
1700
|
+
v3 = __builtin_msa_vshf_h( \
|
|
1701
|
+
(_Tpvs)((v2i64){0x0001000F000F000F, 0x000D000A00070004}), (_Tpvs)v1, \
|
|
1702
|
+
(_Tpvs)v0); \
|
|
1703
|
+
*c = (_Tpv)__builtin_msa_vshf_h( \
|
|
1704
|
+
(_Tpvs)((v2i64){0x000B000600030000, 0x000F000E000D000C}), (_Tpvs)v2, \
|
|
1705
|
+
v3); \
|
|
1706
|
+
}
|
|
1707
|
+
#else
|
|
1708
|
+
#define MSA_INTERLEAVED_IMPL_LOAD3_16(_Tp, _Tpv, _Tpvs, suffix) \
|
|
1709
|
+
__extension__ extern __inline void \
|
|
1710
|
+
__attribute__((__always_inline__, __gnu_inline__, \
|
|
1711
|
+
__artificial__)) msa_ld3q_##suffix(const _Tp *ptr, \
|
|
1712
|
+
_Tpv *a, _Tpv *b, \
|
|
1713
|
+
_Tpv *c) { \
|
|
1714
|
+
_Tpv v0 = msa_ld1q_##suffix(ptr); \
|
|
1715
|
+
_Tpv v1 = msa_ld1q_##suffix(ptr + 8); \
|
|
1716
|
+
_Tpv v2 = msa_ld1q_##suffix(ptr + 16); \
|
|
1717
|
+
_Tpvs v3 = __builtin_msa_vshf_h( \
|
|
1718
|
+
(_Tpvs)((v2i64){0x0009000600030000, 0x00000000000F000C}), (_Tpvs)v1, \
|
|
1719
|
+
(_Tpvs)v0); \
|
|
1720
|
+
*a = (_Tpv)__builtin_msa_vshf_h( \
|
|
1721
|
+
(_Tpvs)((v2i64){0x0003000200010000, 0x000D000A00050004}), (_Tpvs)v2, \
|
|
1722
|
+
v3); \
|
|
1723
|
+
v3 = __builtin_msa_vshf_h( \
|
|
1724
|
+
(_Tpvs)((v2i64){0x000A000700040001, 0x000000000000000D}), (_Tpvs)v1, \
|
|
1725
|
+
(_Tpvs)v0); \
|
|
1726
|
+
*b = (_Tpv)__builtin_msa_vshf_h( \
|
|
1727
|
+
(_Tpvs)((v2i64){0x0003000200010000, 0x000E000B00080004}), (_Tpvs)v2, \
|
|
1728
|
+
v3); \
|
|
1729
|
+
v3 = __builtin_msa_vshf_h( \
|
|
1730
|
+
(_Tpvs)((v2i64){0x000B000800050002, 0x000000000000000E}), (_Tpvs)v1, \
|
|
1731
|
+
(_Tpvs)v0); \
|
|
1732
|
+
*c = (_Tpv)__builtin_msa_vshf_h( \
|
|
1733
|
+
(_Tpvs)((v2i64){0x0003000200010000, 0x000F000C00090004}), (_Tpvs)v2, \
|
|
1734
|
+
v3); \
|
|
1735
|
+
}
|
|
1736
|
+
#endif
|
|
1737
|
+
|
|
1738
|
+
MSA_INTERLEAVED_IMPL_LOAD3_16(uint16_t, v8u16, v8i16, u16)
|
|
1739
|
+
MSA_INTERLEAVED_IMPL_LOAD3_16(int16_t, v8i16, v8i16, s16)
|
|
1740
|
+
|
|
1741
|
+
#define MSA_INTERLEAVED_IMPL_LOAD3_32(_Tp, _Tpv, _Tpvs, suffix) \
|
|
1742
|
+
__extension__ extern __inline void \
|
|
1743
|
+
__attribute__((__always_inline__, __gnu_inline__, \
|
|
1744
|
+
__artificial__)) msa_ld3q_##suffix(const _Tp *ptr, \
|
|
1745
|
+
_Tpv *a, _Tpv *b, \
|
|
1746
|
+
_Tpv *c) { \
|
|
1747
|
+
_Tpv v00 = msa_ld1q_##suffix(ptr); \
|
|
1748
|
+
_Tpv v01 = msa_ld1q_##suffix(ptr + 4); \
|
|
1749
|
+
_Tpv v02 = msa_ld1q_##suffix(ptr + 8); \
|
|
1750
|
+
_Tpvs v10 = __builtin_msa_ilvr_w( \
|
|
1751
|
+
(_Tpvs)__builtin_msa_ilvl_d((v2i64)v01, (v2i64)v01), (_Tpvs)v00); \
|
|
1752
|
+
_Tpvs v11 = __builtin_msa_ilvr_w( \
|
|
1753
|
+
(_Tpvs)v02, (_Tpvs)__builtin_msa_ilvl_d((v2i64)v00, (v2i64)v00)); \
|
|
1754
|
+
_Tpvs v12 = __builtin_msa_ilvr_w( \
|
|
1755
|
+
(_Tpvs)__builtin_msa_ilvl_d((v2i64)v02, (v2i64)v02), (_Tpvs)v01); \
|
|
1756
|
+
*a = (_Tpv)__builtin_msa_ilvr_w( \
|
|
1757
|
+
(_Tpvs)__builtin_msa_ilvl_d((v2i64)v11, (v2i64)v11), v10); \
|
|
1758
|
+
*b = (_Tpv)__builtin_msa_ilvr_w( \
|
|
1759
|
+
v12, (_Tpvs)__builtin_msa_ilvl_d((v2i64)v10, (v2i64)v10)); \
|
|
1760
|
+
*c = (_Tpv)__builtin_msa_ilvr_w( \
|
|
1761
|
+
(_Tpvs)__builtin_msa_ilvl_d((v2i64)v12, (v2i64)v12), v11); \
|
|
1762
|
+
}
|
|
1763
|
+
|
|
1764
|
+
MSA_INTERLEAVED_IMPL_LOAD3_32(uint32_t, v4u32, v4i32, u32)
|
|
1765
|
+
MSA_INTERLEAVED_IMPL_LOAD3_32(int32_t, v4i32, v4i32, s32)
|
|
1766
|
+
MSA_INTERLEAVED_IMPL_LOAD3_32(float, v4f32, v4i32, f32)
|
|
1767
|
+
|
|
1768
|
+
#define MSA_INTERLEAVED_IMPL_LOAD3_64(_Tp, _Tpv, suffix) \
|
|
1769
|
+
__extension__ extern __inline void \
|
|
1770
|
+
__attribute__((__always_inline__, __gnu_inline__, \
|
|
1771
|
+
__artificial__)) msa_ld3q_##suffix(const _Tp *ptr, \
|
|
1772
|
+
_Tpv *a, _Tpv *b, \
|
|
1773
|
+
_Tpv *c) { \
|
|
1774
|
+
*((_Tp *)a) = *ptr; \
|
|
1775
|
+
*((_Tp *)b) = *(ptr + 1); \
|
|
1776
|
+
*((_Tp *)c) = *(ptr + 2); \
|
|
1777
|
+
*((_Tp *)a + 1) = *(ptr + 3); \
|
|
1778
|
+
*((_Tp *)b + 1) = *(ptr + 4); \
|
|
1779
|
+
*((_Tp *)c + 1) = *(ptr + 5); \
|
|
1780
|
+
}
|
|
1781
|
+
|
|
1782
|
+
MSA_INTERLEAVED_IMPL_LOAD3_64(uint64_t, v2u64, u64)
|
|
1783
|
+
MSA_INTERLEAVED_IMPL_LOAD3_64(int64_t, v2i64, s64)
|
|
1784
|
+
MSA_INTERLEAVED_IMPL_LOAD3_64(double, v2f64, f64)
|
|
1785
|
+
|
|
1786
|
+
#ifdef _MIPSEB
|
|
1787
|
+
#define MSA_INTERLEAVED_IMPL_STORE3_8(_Tp, _Tpv, _Tpvs, suffix) \
|
|
1788
|
+
__extension__ extern __inline void __attribute__(( \
|
|
1789
|
+
__always_inline__, __gnu_inline__, \
|
|
1790
|
+
__artificial__)) msa_st3q_##suffix(_Tp *ptr, const _Tpv a, const _Tpv b, \
|
|
1791
|
+
const _Tpv c) { \
|
|
1792
|
+
_Tpvs v0 = __builtin_msa_vshf_b( \
|
|
1793
|
+
(_Tpvs)((v2i64){0x0F0E0D0C0B1F1F1F, 0x1F1E1D1C1B1A1F1F}), (_Tpvs)b, \
|
|
1794
|
+
(_Tpvs)a); \
|
|
1795
|
+
_Tpvs v1 = __builtin_msa_vshf_b( \
|
|
1796
|
+
(_Tpvs)((v2i64){0x0D1C140C1B130B1A, 0x1F170F1E160E1D15}), (_Tpvs)c, \
|
|
1797
|
+
(_Tpvs)v0); \
|
|
1798
|
+
msa_st1q_##suffix(ptr, (_Tpv)v1); \
|
|
1799
|
+
v0 = __builtin_msa_vshf_b( \
|
|
1800
|
+
(_Tpvs)((v2i64){0x0A09080706051F1F, 0x19181716151F1F1F}), (_Tpvs)b, \
|
|
1801
|
+
(_Tpvs)a); \
|
|
1802
|
+
v1 = __builtin_msa_vshf_b( \
|
|
1803
|
+
(_Tpvs)((v2i64){0x1D14071C13061B12, 0x170A1F16091E1508}), (_Tpvs)c, \
|
|
1804
|
+
(_Tpvs)v0); \
|
|
1805
|
+
msa_st1q_##suffix(ptr + 16, (_Tpv)v1); \
|
|
1806
|
+
v0 = __builtin_msa_vshf_b( \
|
|
1807
|
+
(_Tpvs)((v2i64){0x04030201001F1F1F, 0x14131211101F1F1F}), (_Tpvs)b, \
|
|
1808
|
+
(_Tpvs)a); \
|
|
1809
|
+
v1 = __builtin_msa_vshf_b( \
|
|
1810
|
+
(_Tpvs)((v2i64){0x15021C14011B1300, 0x051F17041E16031D}), (_Tpvs)c, \
|
|
1811
|
+
(_Tpvs)v0); \
|
|
1812
|
+
msa_st1q_##suffix(ptr + 32, (_Tpv)v1); \
|
|
1813
|
+
}
|
|
1814
|
+
#else
|
|
1815
|
+
#define MSA_INTERLEAVED_IMPL_STORE3_8(_Tp, _Tpv, _Tpvs, suffix) \
|
|
1816
|
+
__extension__ extern __inline void __attribute__(( \
|
|
1817
|
+
__always_inline__, __gnu_inline__, \
|
|
1818
|
+
__artificial__)) msa_st3q_##suffix(_Tp *ptr, const _Tpv a, const _Tpv b, \
|
|
1819
|
+
const _Tpv c) { \
|
|
1820
|
+
_Tpvs v0 = __builtin_msa_vshf_b( \
|
|
1821
|
+
(_Tpvs)((v2i64){0x0000050403020100, 0x0000001413121110}), (_Tpvs)b, \
|
|
1822
|
+
(_Tpvs)a); \
|
|
1823
|
+
_Tpvs v1 = __builtin_msa_vshf_b( \
|
|
1824
|
+
(_Tpvs)((v2i64){0x0A02110901100800, 0x05140C04130B0312}), (_Tpvs)c, \
|
|
1825
|
+
(_Tpvs)v0); \
|
|
1826
|
+
msa_st1q_##suffix(ptr, (_Tpv)v1); \
|
|
1827
|
+
v0 = __builtin_msa_vshf_b( \
|
|
1828
|
+
(_Tpvs)((v2i64){0x0000000A09080706, 0x00001A1918171615}), (_Tpvs)b, \
|
|
1829
|
+
(_Tpvs)a); \
|
|
1830
|
+
v1 = __builtin_msa_vshf_b( \
|
|
1831
|
+
(_Tpvs)((v2i64){0x170A011609001508, 0x0D04190C03180B02}), (_Tpvs)c, \
|
|
1832
|
+
(_Tpvs)v0); \
|
|
1833
|
+
msa_st1q_##suffix(ptr + 16, (_Tpv)v1); \
|
|
1834
|
+
v0 = __builtin_msa_vshf_b( \
|
|
1835
|
+
(_Tpvs)((v2i64){0x0000000F0E0D0C0B, 0x0000001F1E1D1C1B}), (_Tpvs)b, \
|
|
1836
|
+
(_Tpvs)a); \
|
|
1837
|
+
v1 = __builtin_msa_vshf_b( \
|
|
1838
|
+
(_Tpvs)((v2i64){0x021C09011B08001A, 0x1F0C041E0B031D0A}), (_Tpvs)c, \
|
|
1839
|
+
(_Tpvs)v0); \
|
|
1840
|
+
msa_st1q_##suffix(ptr + 32, (_Tpv)v1); \
|
|
1841
|
+
}
|
|
1842
|
+
#endif
|
|
1843
|
+
|
|
1844
|
+
MSA_INTERLEAVED_IMPL_STORE3_8(uint8_t, v16u8, v16i8, u8)
|
|
1845
|
+
MSA_INTERLEAVED_IMPL_STORE3_8(int8_t, v16i8, v16i8, s8)
|
|
1846
|
+
|
|
1847
|
+
#ifdef _MIPSEB
|
|
1848
|
+
#define MSA_INTERLEAVED_IMPL_STORE3_16(_Tp, _Tpv, _Tpvs, suffix) \
|
|
1849
|
+
__extension__ extern __inline void __attribute__(( \
|
|
1850
|
+
__always_inline__, __gnu_inline__, \
|
|
1851
|
+
__artificial__)) msa_st3q_##suffix(_Tp *ptr, const _Tpv a, const _Tpv b, \
|
|
1852
|
+
const _Tpv c) { \
|
|
1853
|
+
_Tpvs v0 = __builtin_msa_vshf_h( \
|
|
1854
|
+
(_Tpvs)((v2i64){0x000700060005000F, 0x000F000E000D000F}), (_Tpvs)b, \
|
|
1855
|
+
(_Tpvs)a); \
|
|
1856
|
+
_Tpvs v1 = __builtin_msa_vshf_h( \
|
|
1857
|
+
(_Tpvs)((v2i64){0x000A0006000D0009, 0x000F000B0007000E}), (_Tpvs)c, \
|
|
1858
|
+
(_Tpvs)v0); \
|
|
1859
|
+
msa_st1q_##suffix(ptr, (_Tpv)v1); \
|
|
1860
|
+
v0 = __builtin_msa_vshf_h( \
|
|
1861
|
+
(_Tpvs)((v2i64){0x00040003000F000F, 0x000C000B000A000F}), (_Tpvs)b, \
|
|
1862
|
+
(_Tpvs)a); \
|
|
1863
|
+
v1 = __builtin_msa_vshf_h( \
|
|
1864
|
+
(_Tpvs)((v2i64){0x000E000A0003000D, 0x0005000F000B0004}), (_Tpvs)c, \
|
|
1865
|
+
(_Tpvs)v0); \
|
|
1866
|
+
msa_st1q_##suffix(ptr + 8, (_Tpv)v1); \
|
|
1867
|
+
v0 = __builtin_msa_vshf_h( \
|
|
1868
|
+
(_Tpvs)((v2i64){0x000200010000000F, 0x00090008000F000F}), (_Tpvs)b, \
|
|
1869
|
+
(_Tpvs)a); \
|
|
1870
|
+
v1 = __builtin_msa_vshf_h( \
|
|
1871
|
+
(_Tpvs)((v2i64){0x0001000E00090000, 0x000B0002000F000A}), (_Tpvs)c, \
|
|
1872
|
+
(_Tpvs)v0); \
|
|
1873
|
+
msa_st1q_##suffix(ptr + 16, (_Tpv)v1); \
|
|
1874
|
+
}
|
|
1875
|
+
#else
|
|
1876
|
+
#define MSA_INTERLEAVED_IMPL_STORE3_16(_Tp, _Tpv, _Tpvs, suffix) \
|
|
1877
|
+
__extension__ extern __inline void __attribute__(( \
|
|
1878
|
+
__always_inline__, __gnu_inline__, \
|
|
1879
|
+
__artificial__)) msa_st3q_##suffix(_Tp *ptr, const _Tpv a, const _Tpv b, \
|
|
1880
|
+
const _Tpv c) { \
|
|
1881
|
+
_Tpvs v0 = __builtin_msa_vshf_h( \
|
|
1882
|
+
(_Tpvs)((v2i64){0x0000000200010000, 0x0000000A00090008}), (_Tpvs)b, \
|
|
1883
|
+
(_Tpvs)a); \
|
|
1884
|
+
_Tpvs v1 = __builtin_msa_vshf_h( \
|
|
1885
|
+
(_Tpvs)((v2i64){0x0001000800040000, 0x0006000200090005}), (_Tpvs)c, \
|
|
1886
|
+
(_Tpvs)v0); \
|
|
1887
|
+
msa_st1q_##suffix(ptr, (_Tpv)v1); \
|
|
1888
|
+
v0 = __builtin_msa_vshf_h( \
|
|
1889
|
+
(_Tpvs)((v2i64){0x0000000500040003, 0x00000000000C000B}), (_Tpvs)b, \
|
|
1890
|
+
(_Tpvs)a); \
|
|
1891
|
+
v1 = __builtin_msa_vshf_h( \
|
|
1892
|
+
(_Tpvs)((v2i64){0x000B00040000000A, 0x0002000C00050001}), (_Tpvs)c, \
|
|
1893
|
+
(_Tpvs)v0); \
|
|
1894
|
+
msa_st1q_##suffix(ptr + 8, (_Tpv)v1); \
|
|
1895
|
+
v0 = __builtin_msa_vshf_h( \
|
|
1896
|
+
(_Tpvs)((v2i64){0x0000000000070006, 0x0000000F000E000D}), (_Tpvs)b, \
|
|
1897
|
+
(_Tpvs)a); \
|
|
1898
|
+
v1 = __builtin_msa_vshf_h( \
|
|
1899
|
+
(_Tpvs)((v2i64){0x00050000000D0004, 0x000F00060001000E}), (_Tpvs)c, \
|
|
1900
|
+
(_Tpvs)v0); \
|
|
1901
|
+
msa_st1q_##suffix(ptr + 16, (_Tpv)v1); \
|
|
1902
|
+
}
|
|
1903
|
+
#endif
|
|
1904
|
+
|
|
1905
|
+
MSA_INTERLEAVED_IMPL_STORE3_16(uint16_t, v8u16, v8i16, u16)
|
|
1906
|
+
MSA_INTERLEAVED_IMPL_STORE3_16(int16_t, v8i16, v8i16, s16)
|
|
1907
|
+
|
|
1908
|
+
#ifdef _MIPSEB
|
|
1909
|
+
#define MSA_INTERLEAVED_IMPL_STORE3_32(_Tp, _Tpv, _Tpvs, suffix) \
|
|
1910
|
+
__extension__ extern __inline void __attribute__(( \
|
|
1911
|
+
__always_inline__, __gnu_inline__, \
|
|
1912
|
+
__artificial__)) msa_st3q_##suffix(_Tp *ptr, const _Tpv a, const _Tpv b, \
|
|
1913
|
+
const _Tpv c) { \
|
|
1914
|
+
_Tpvs v0 = __builtin_msa_vshf_w( \
|
|
1915
|
+
(_Tpvs)((v2i64){0x0000000300000007, 0x0000000700000006}), (_Tpvs)b, \
|
|
1916
|
+
(_Tpvs)a); \
|
|
1917
|
+
_Tpvs v1 = __builtin_msa_vshf_w( \
|
|
1918
|
+
(_Tpvs)((v2i64){0x0000000300000006, 0x0000000700000005}), (_Tpvs)c, \
|
|
1919
|
+
(_Tpvs)v0); \
|
|
1920
|
+
msa_st1q_##suffix(ptr, (_Tpv)v1); \
|
|
1921
|
+
v0 = __builtin_msa_vshf_w( \
|
|
1922
|
+
(_Tpvs)((v2i64){0x0000000200000001, 0x0000000500000007}), (_Tpvs)b, \
|
|
1923
|
+
(_Tpvs)a); \
|
|
1924
|
+
v1 = __builtin_msa_vshf_w( \
|
|
1925
|
+
(_Tpvs)((v2i64){0x0000000700000004, 0x0000000500000002}), (_Tpvs)c, \
|
|
1926
|
+
(_Tpvs)v0); \
|
|
1927
|
+
msa_st1q_##suffix(ptr + 4, (_Tpv)v1); \
|
|
1928
|
+
v0 = __builtin_msa_vshf_w( \
|
|
1929
|
+
(_Tpvs)((v2i64){0x0000000000000007, 0x0000000400000007}), (_Tpvs)b, \
|
|
1930
|
+
(_Tpvs)a); \
|
|
1931
|
+
v1 = __builtin_msa_vshf_w( \
|
|
1932
|
+
(_Tpvs)((v2i64){0x0000000500000000, 0x0000000100000007}), (_Tpvs)c, \
|
|
1933
|
+
(_Tpvs)v0); \
|
|
1934
|
+
msa_st1q_##suffix(ptr + 8, (_Tpv)v1); \
|
|
1935
|
+
}
|
|
1936
|
+
#else
|
|
1937
|
+
#define MSA_INTERLEAVED_IMPL_STORE3_32(_Tp, _Tpv, _Tpvs, suffix) \
|
|
1938
|
+
__extension__ extern __inline void __attribute__(( \
|
|
1939
|
+
__always_inline__, __gnu_inline__, \
|
|
1940
|
+
__artificial__)) msa_st3q_##suffix(_Tp *ptr, const _Tpv a, const _Tpv b, \
|
|
1941
|
+
const _Tpv c) { \
|
|
1942
|
+
_Tpvs v0 = __builtin_msa_vshf_w( \
|
|
1943
|
+
(_Tpvs)((v2i64){0x0000000100000000, 0x0000000000000004}), (_Tpvs)b, \
|
|
1944
|
+
(_Tpvs)a); \
|
|
1945
|
+
_Tpvs v1 = __builtin_msa_vshf_w( \
|
|
1946
|
+
(_Tpvs)((v2i64){0x0000000200000000, 0x0000000100000004}), (_Tpvs)c, \
|
|
1947
|
+
(_Tpvs)v0); \
|
|
1948
|
+
msa_st1q_##suffix(ptr, (_Tpv)v1); \
|
|
1949
|
+
v0 = __builtin_msa_vshf_w( \
|
|
1950
|
+
(_Tpvs)((v2i64){0x0000000000000002, 0x0000000600000005}), (_Tpvs)b, \
|
|
1951
|
+
(_Tpvs)a); \
|
|
1952
|
+
v1 = __builtin_msa_vshf_w( \
|
|
1953
|
+
(_Tpvs)((v2i64){0x0000000500000002, 0x0000000300000000}), (_Tpvs)c, \
|
|
1954
|
+
(_Tpvs)v0); \
|
|
1955
|
+
msa_st1q_##suffix(ptr + 4, (_Tpv)v1); \
|
|
1956
|
+
v0 = __builtin_msa_vshf_w( \
|
|
1957
|
+
(_Tpvs)((v2i64){0x0000000000000003, 0x0000000000000007}), (_Tpvs)b, \
|
|
1958
|
+
(_Tpvs)a); \
|
|
1959
|
+
v1 = __builtin_msa_vshf_w( \
|
|
1960
|
+
(_Tpvs)((v2i64){0x0000000000000006, 0x0000000700000002}), (_Tpvs)c, \
|
|
1961
|
+
(_Tpvs)v0); \
|
|
1962
|
+
msa_st1q_##suffix(ptr + 8, (_Tpv)v1); \
|
|
1963
|
+
}
|
|
1964
|
+
#endif
|
|
1965
|
+
|
|
1966
|
+
MSA_INTERLEAVED_IMPL_STORE3_32(uint32_t, v4u32, v4i32, u32)
|
|
1967
|
+
MSA_INTERLEAVED_IMPL_STORE3_32(int32_t, v4i32, v4i32, s32)
|
|
1968
|
+
MSA_INTERLEAVED_IMPL_STORE3_32(float, v4f32, v4i32, f32)
|
|
1969
|
+
|
|
1970
|
+
#define MSA_INTERLEAVED_IMPL_STORE3_64(_Tp, _Tpv, suffix) \
|
|
1971
|
+
__extension__ extern __inline void __attribute__(( \
|
|
1972
|
+
__always_inline__, __gnu_inline__, \
|
|
1973
|
+
__artificial__)) msa_st3q_##suffix(_Tp *ptr, const _Tpv a, const _Tpv b, \
|
|
1974
|
+
const _Tpv c) { \
|
|
1975
|
+
*ptr = a[0]; \
|
|
1976
|
+
*(ptr + 1) = b[0]; \
|
|
1977
|
+
*(ptr + 2) = c[0]; \
|
|
1978
|
+
*(ptr + 3) = a[1]; \
|
|
1979
|
+
*(ptr + 4) = b[1]; \
|
|
1980
|
+
*(ptr + 5) = c[1]; \
|
|
1981
|
+
}
|
|
1982
|
+
|
|
1983
|
+
MSA_INTERLEAVED_IMPL_STORE3_64(uint64_t, v2u64, u64)
|
|
1984
|
+
MSA_INTERLEAVED_IMPL_STORE3_64(int64_t, v2i64, s64)
|
|
1985
|
+
MSA_INTERLEAVED_IMPL_STORE3_64(double, v2f64, f64)
|
|
1986
|
+
|
|
1987
|
+
#define MSA_INTERLEAVED_IMPL_LOAD4_STORE4(_Tp, _Tpv, _Tpvs, suffix, df, \
|
|
1988
|
+
nlanes) \
|
|
1989
|
+
__extension__ extern __inline void \
|
|
1990
|
+
__attribute__((__always_inline__, __gnu_inline__, \
|
|
1991
|
+
__artificial__)) msa_ld4q_##suffix(const _Tp *ptr, \
|
|
1992
|
+
_Tpv *a, _Tpv *b, \
|
|
1993
|
+
_Tpv *c, _Tpv *d) { \
|
|
1994
|
+
_Tpv v0 = msa_ld1q_##suffix(ptr); \
|
|
1995
|
+
_Tpv v1 = msa_ld1q_##suffix(ptr + nlanes); \
|
|
1996
|
+
_Tpv v2 = msa_ld1q_##suffix(ptr + nlanes * 2); \
|
|
1997
|
+
_Tpv v3 = msa_ld1q_##suffix(ptr + nlanes * 3); \
|
|
1998
|
+
_Tpvs t0 = __builtin_msa_pckev_##df((_Tpvs)v1, (_Tpvs)v0); \
|
|
1999
|
+
_Tpvs t1 = __builtin_msa_pckev_##df((_Tpvs)v3, (_Tpvs)v2); \
|
|
2000
|
+
_Tpvs t2 = __builtin_msa_pckod_##df((_Tpvs)v1, (_Tpvs)v0); \
|
|
2001
|
+
_Tpvs t3 = __builtin_msa_pckod_##df((_Tpvs)v3, (_Tpvs)v2); \
|
|
2002
|
+
*a = (_Tpv)__builtin_msa_pckev_##df(t1, t0); \
|
|
2003
|
+
*b = (_Tpv)__builtin_msa_pckev_##df(t3, t2); \
|
|
2004
|
+
*c = (_Tpv)__builtin_msa_pckod_##df(t1, t0); \
|
|
2005
|
+
*d = (_Tpv)__builtin_msa_pckod_##df(t3, t2); \
|
|
2006
|
+
} \
|
|
2007
|
+
__extension__ extern __inline void __attribute__(( \
|
|
2008
|
+
__always_inline__, __gnu_inline__, \
|
|
2009
|
+
__artificial__)) msa_st4q_##suffix(_Tp *ptr, const _Tpv a, const _Tpv b, \
|
|
2010
|
+
const _Tpv c, const _Tpv d) { \
|
|
2011
|
+
_Tpvs v0 = __builtin_msa_ilvr_##df((_Tpvs)c, (_Tpvs)a); \
|
|
2012
|
+
_Tpvs v1 = __builtin_msa_ilvr_##df((_Tpvs)d, (_Tpvs)b); \
|
|
2013
|
+
_Tpvs v2 = __builtin_msa_ilvl_##df((_Tpvs)c, (_Tpvs)a); \
|
|
2014
|
+
_Tpvs v3 = __builtin_msa_ilvl_##df((_Tpvs)d, (_Tpvs)b); \
|
|
2015
|
+
msa_st1q_##suffix(ptr, (_Tpv)__builtin_msa_ilvr_##df(v1, v0)); \
|
|
2016
|
+
msa_st1q_##suffix(ptr + nlanes, (_Tpv)__builtin_msa_ilvl_##df(v1, v0)); \
|
|
2017
|
+
msa_st1q_##suffix(ptr + 2 * nlanes, \
|
|
2018
|
+
(_Tpv)__builtin_msa_ilvr_##df(v3, v2)); \
|
|
2019
|
+
msa_st1q_##suffix(ptr + 3 * nlanes, \
|
|
2020
|
+
(_Tpv)__builtin_msa_ilvl_##df(v3, v2)); \
|
|
2021
|
+
}
|
|
2022
|
+
|
|
2023
|
+
MSA_INTERLEAVED_IMPL_LOAD4_STORE4(uint8_t, v16u8, v16i8, u8, b, 16)
|
|
2024
|
+
MSA_INTERLEAVED_IMPL_LOAD4_STORE4(int8_t, v16i8, v16i8, s8, b, 16)
|
|
2025
|
+
MSA_INTERLEAVED_IMPL_LOAD4_STORE4(uint16_t, v8u16, v8i16, u16, h, 8)
|
|
2026
|
+
MSA_INTERLEAVED_IMPL_LOAD4_STORE4(int16_t, v8i16, v8i16, s16, h, 8)
|
|
2027
|
+
MSA_INTERLEAVED_IMPL_LOAD4_STORE4(uint32_t, v4u32, v4i32, u32, w, 4)
|
|
2028
|
+
MSA_INTERLEAVED_IMPL_LOAD4_STORE4(int32_t, v4i32, v4i32, s32, w, 4)
|
|
2029
|
+
MSA_INTERLEAVED_IMPL_LOAD4_STORE4(float, v4f32, v4i32, f32, w, 4)
|
|
2030
|
+
|
|
2031
|
+
#define MSA_INTERLEAVED_IMPL_LOAD4_STORE4_64(_Tp, _Tpv, _Tpvs, suffix) \
|
|
2032
|
+
__extension__ extern __inline void \
|
|
2033
|
+
__attribute__((__always_inline__, __gnu_inline__, \
|
|
2034
|
+
__artificial__)) msa_ld4q_##suffix(const _Tp *ptr, \
|
|
2035
|
+
_Tpv *a, _Tpv *b, \
|
|
2036
|
+
_Tpv *c, _Tpv *d) { \
|
|
2037
|
+
_Tpv v0 = msa_ld1q_##suffix(ptr); \
|
|
2038
|
+
_Tpv v1 = msa_ld1q_##suffix(ptr + 2); \
|
|
2039
|
+
_Tpv v2 = msa_ld1q_##suffix(ptr + 4); \
|
|
2040
|
+
_Tpv v3 = msa_ld1q_##suffix(ptr + 6); \
|
|
2041
|
+
*a = (_Tpv)__builtin_msa_ilvr_d((_Tpvs)v2, (_Tpvs)v0); \
|
|
2042
|
+
*b = (_Tpv)__builtin_msa_ilvl_d((_Tpvs)v2, (_Tpvs)v0); \
|
|
2043
|
+
*c = (_Tpv)__builtin_msa_ilvr_d((_Tpvs)v3, (_Tpvs)v1); \
|
|
2044
|
+
*d = (_Tpv)__builtin_msa_ilvl_d((_Tpvs)v3, (_Tpvs)v1); \
|
|
2045
|
+
} \
|
|
2046
|
+
__extension__ extern __inline void __attribute__(( \
|
|
2047
|
+
__always_inline__, __gnu_inline__, \
|
|
2048
|
+
__artificial__)) msa_st4q_##suffix(_Tp *ptr, const _Tpv a, const _Tpv b, \
|
|
2049
|
+
const _Tpv c, const _Tpv d) { \
|
|
2050
|
+
msa_st1q_##suffix(ptr, (_Tpv)__builtin_msa_ilvr_d((_Tpvs)b, (_Tpvs)a)); \
|
|
2051
|
+
msa_st1q_##suffix(ptr + 2, \
|
|
2052
|
+
(_Tpv)__builtin_msa_ilvr_d((_Tpvs)d, (_Tpvs)c)); \
|
|
2053
|
+
msa_st1q_##suffix(ptr + 4, \
|
|
2054
|
+
(_Tpv)__builtin_msa_ilvl_d((_Tpvs)b, (_Tpvs)a)); \
|
|
2055
|
+
msa_st1q_##suffix(ptr + 6, \
|
|
2056
|
+
(_Tpv)__builtin_msa_ilvl_d((_Tpvs)d, (_Tpvs)c)); \
|
|
2057
|
+
}
|
|
2058
|
+
|
|
2059
|
+
MSA_INTERLEAVED_IMPL_LOAD4_STORE4_64(uint64_t, v2u64, v2i64, u64)
|
|
2060
|
+
MSA_INTERLEAVED_IMPL_LOAD4_STORE4_64(int64_t, v2i64, v2i64, s64)
|
|
2061
|
+
MSA_INTERLEAVED_IMPL_LOAD4_STORE4_64(double, v2f64, v2i64, f64)
|
|
2062
|
+
|
|
2063
|
+
__extension__ extern __inline v8i16
|
|
2064
|
+
__attribute__((__always_inline__, __gnu_inline__, __artificial__))
|
|
2065
|
+
msa_qdmulhq_n_s16(v8i16 a, int16_t b) {
|
|
2066
|
+
v8i16 a_lo, a_hi;
|
|
2067
|
+
ILVRL_H2_SH(a, msa_dupq_n_s16(0), a_lo, a_hi);
|
|
2068
|
+
return msa_packr_s32(
|
|
2069
|
+
msa_shlq_n_s32(msa_mulq_s32(msa_paddlq_s16(a_lo), msa_dupq_n_s32(b)), 1),
|
|
2070
|
+
msa_shlq_n_s32(msa_mulq_s32(msa_paddlq_s16(a_hi), msa_dupq_n_s32(b)), 1),
|
|
2071
|
+
16);
|
|
2072
|
+
}
|
|
2073
|
+
|
|
2074
|
+
#ifdef __cplusplus
|
|
2075
|
+
} // extern "C"
|
|
2076
|
+
#endif
|
|
2077
|
+
|
|
2078
|
+
#endif /*__mips_msa*/
|
|
2079
|
+
#endif /* OPENCV_CORE_MSA_MACROS_H */
|