Nuitka-winsvc 2.4.11__cp311-cp311-win_amd64.whl → 2.5.6__cp311-cp311-win_amd64.whl
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.
Potentially problematic release.
This version of Nuitka-winsvc might be problematic. Click here for more details.
- {Nuitka_winsvc-2.4.11.dist-info → Nuitka_winsvc-2.5.6.dist-info}/METADATA +56 -109
- {Nuitka_winsvc-2.4.11.dist-info → Nuitka_winsvc-2.5.6.dist-info}/RECORD +304 -280
- {Nuitka_winsvc-2.4.11.dist-info → Nuitka_winsvc-2.5.6.dist-info}/WHEEL +1 -1
- nuitka/Builtins.py +31 -0
- nuitka/HardImportRegistry.py +8 -0
- nuitka/MainControl.py +9 -4
- nuitka/OptionParsing.py +108 -54
- nuitka/Options.py +69 -13
- nuitka/OutputDirectories.py +7 -2
- nuitka/PostProcessing.py +69 -38
- nuitka/Progress.py +16 -1
- nuitka/PythonVersions.py +2 -1
- nuitka/Serialization.py +4 -2
- nuitka/Tracing.py +69 -1
- nuitka/Version.py +2 -2
- nuitka/build/Backend.scons +45 -5
- nuitka/build/CCompilerVersion.scons +6 -0
- nuitka/build/Onefile.scons +6 -0
- nuitka/build/SconsCaching.py +4 -0
- nuitka/build/SconsCompilerSettings.py +14 -3
- nuitka/build/SconsInterface.py +3 -0
- nuitka/build/SconsUtils.py +5 -0
- nuitka/build/include/nuitka/allocator.h +124 -1
- nuitka/build/include/nuitka/calling.h +6 -6
- nuitka/build/include/nuitka/compiled_asyncgen.h +10 -7
- nuitka/build/include/nuitka/compiled_frame.h +2 -1
- nuitka/build/include/nuitka/constants.h +8 -0
- nuitka/build/include/nuitka/debug_settings.h +60 -0
- nuitka/build/include/nuitka/exceptions.h +264 -121
- nuitka/build/include/nuitka/helper/attributes.h +0 -4
- nuitka/build/include/nuitka/helper/calling_generated.h +52 -52
- nuitka/build/include/nuitka/helper/comparisons_dual_eq.h +47 -0
- nuitka/build/include/nuitka/helper/comparisons_dual_ge.h +39 -0
- nuitka/build/include/nuitka/helper/comparisons_dual_gt.h +39 -0
- nuitka/build/include/nuitka/helper/comparisons_dual_le.h +47 -0
- nuitka/build/include/nuitka/helper/comparisons_dual_lt.h +47 -0
- nuitka/build/include/nuitka/helper/comparisons_dual_ne.h +39 -0
- nuitka/build/include/nuitka/helper/dictionaries.h +75 -31
- nuitka/build/include/nuitka/helper/ints.h +86 -37
- nuitka/build/include/nuitka/helper/iterators.h +82 -34
- nuitka/build/include/nuitka/helper/operations.h +3 -0
- nuitka/build/include/nuitka/helper/operations_binary_add.h +6 -0
- nuitka/build/include/nuitka/helper/operations_binary_dual_add.h +34 -0
- nuitka/build/include/nuitka/helper/operations_binary_sub.h +6 -0
- nuitka/build/include/nuitka/helper/operations_inplace_add.h +3 -0
- nuitka/build/include/nuitka/helper/operations_inplace_sub.h +3 -0
- nuitka/build/include/nuitka/helper/raising.h +47 -28
- nuitka/build/include/nuitka/helper/richcomparisons.h +7 -0
- nuitka/build/include/nuitka/helper/tuples.h +12 -0
- nuitka/build/include/nuitka/helpers.h +12 -2
- nuitka/build/include/nuitka/prelude.h +36 -25
- nuitka/build/include/nuitka/printing.h +9 -7
- nuitka/build/include/nuitka/threading.h +15 -1
- nuitka/build/include/nuitka/type_aliases.h +3 -0
- nuitka/build/inline_copy/stubgen/astunparse.py +938 -0
- nuitka/build/inline_copy/stubgen/six.py +998 -0
- nuitka/build/inline_copy/stubgen/stubgen.py +307 -0
- nuitka/build/static_src/CompiledAsyncgenType.c +45 -39
- nuitka/build/static_src/CompiledCellType.c +6 -4
- nuitka/build/static_src/CompiledCodeHelpers.c +106 -40
- nuitka/build/static_src/CompiledCoroutineType.c +41 -31
- nuitka/build/static_src/CompiledFrameType.c +110 -79
- nuitka/build/static_src/CompiledFunctionType.c +173 -151
- nuitka/build/static_src/CompiledGeneratorType.c +51 -49
- nuitka/build/static_src/CompiledGeneratorTypeUncompiledIntegration.c +433 -46
- nuitka/build/static_src/CompiledMethodType.c +6 -12
- nuitka/build/static_src/HelpersAllocator.c +266 -28
- nuitka/build/static_src/HelpersAttributes.c +0 -21
- nuitka/build/static_src/HelpersBuiltin.c +23 -14
- nuitka/build/static_src/HelpersCalling.c +7 -7
- nuitka/build/static_src/HelpersCallingGenerated.c +70 -70
- nuitka/build/static_src/HelpersComparisonDualEq.c +183 -0
- nuitka/build/static_src/HelpersComparisonDualGe.c +121 -0
- nuitka/build/static_src/HelpersComparisonDualGt.c +121 -0
- nuitka/build/static_src/HelpersComparisonDualLe.c +183 -0
- nuitka/build/static_src/HelpersComparisonDualLt.c +183 -0
- nuitka/build/static_src/HelpersComparisonDualNe.c +121 -0
- nuitka/build/static_src/HelpersComparisonEq.c +18 -4
- nuitka/build/static_src/HelpersComparisonGe.c +18 -4
- nuitka/build/static_src/HelpersComparisonGt.c +18 -4
- nuitka/build/static_src/HelpersComparisonLe.c +18 -4
- nuitka/build/static_src/HelpersComparisonLt.c +18 -4
- nuitka/build/static_src/HelpersComparisonNe.c +18 -4
- nuitka/build/static_src/HelpersConsole.c +34 -8
- nuitka/build/static_src/HelpersConstantsBlob.c +4 -2
- nuitka/build/static_src/HelpersDeepcopy.c +1 -0
- nuitka/build/static_src/HelpersDictionaries.c +195 -36
- nuitka/build/static_src/HelpersDictionariesGenerated.c +12 -107
- nuitka/build/static_src/HelpersExceptions.c +24 -50
- nuitka/build/static_src/HelpersFiles.c +79 -5
- nuitka/build/static_src/HelpersImport.c +13 -9
- nuitka/build/static_src/HelpersImportHard.c +23 -46
- nuitka/build/static_src/HelpersLists.c +98 -9
- nuitka/build/static_src/HelpersOperationBinaryAdd.c +224 -6
- nuitka/build/static_src/HelpersOperationBinaryAddUtils.c +3 -0
- nuitka/build/static_src/HelpersOperationBinaryBitand.c +5 -5
- nuitka/build/static_src/HelpersOperationBinaryBitor.c +5 -5
- nuitka/build/static_src/HelpersOperationBinaryBitxor.c +5 -5
- nuitka/build/static_src/HelpersOperationBinaryDivmod.c +8 -2
- nuitka/build/static_src/HelpersOperationBinaryDualAdd.c +172 -0
- nuitka/build/static_src/HelpersOperationBinaryFloordiv.c +14 -8
- nuitka/build/static_src/HelpersOperationBinaryLshift.c +36 -36
- nuitka/build/static_src/HelpersOperationBinaryMatmult.c +1 -0
- nuitka/build/static_src/HelpersOperationBinaryMod.c +22 -10
- nuitka/build/static_src/HelpersOperationBinaryMult.c +17 -7
- nuitka/build/static_src/HelpersOperationBinaryOlddiv.c +14 -8
- nuitka/build/static_src/HelpersOperationBinaryPow.c +24 -24
- nuitka/build/static_src/HelpersOperationBinaryRshift.c +4 -4
- nuitka/build/static_src/HelpersOperationBinarySub.c +229 -8
- nuitka/build/static_src/HelpersOperationBinaryTruediv.c +8 -2
- nuitka/build/static_src/HelpersOperationInplaceAdd.c +162 -10
- nuitka/build/static_src/HelpersOperationInplaceBitand.c +5 -5
- nuitka/build/static_src/HelpersOperationInplaceBitor.c +5 -5
- nuitka/build/static_src/HelpersOperationInplaceBitxor.c +5 -5
- nuitka/build/static_src/HelpersOperationInplaceFloordiv.c +11 -6
- nuitka/build/static_src/HelpersOperationInplaceLshift.c +20 -20
- nuitka/build/static_src/HelpersOperationInplaceMatmult.c +1 -0
- nuitka/build/static_src/HelpersOperationInplaceMod.c +11 -6
- nuitka/build/static_src/HelpersOperationInplaceMult.c +11 -6
- nuitka/build/static_src/HelpersOperationInplaceOlddiv.c +11 -6
- nuitka/build/static_src/HelpersOperationInplacePow.c +20 -20
- nuitka/build/static_src/HelpersOperationInplaceRshift.c +4 -4
- nuitka/build/static_src/HelpersOperationInplaceSub.c +163 -10
- nuitka/build/static_src/HelpersOperationInplaceTruediv.c +6 -1
- nuitka/build/static_src/HelpersProfiling.c +1 -1
- nuitka/build/static_src/HelpersRaising.c +255 -310
- nuitka/build/static_src/HelpersStrings.c +1 -1
- nuitka/build/static_src/HelpersTuples.c +2 -2
- nuitka/build/static_src/HelpersTypes.c +98 -2
- nuitka/build/static_src/MainProgram.c +132 -28
- nuitka/build/static_src/MetaPathBasedLoader.c +18 -19
- nuitka/build/static_src/MetaPathBasedLoaderResourceReaderFiles.c +134 -11
- nuitka/build/static_src/OnefileBootstrap.c +6 -1
- nuitka/code_generation/AsyncgenCodes.py +2 -6
- nuitka/code_generation/BinaryOperationHelperDefinitions.py +269 -167
- nuitka/code_generation/BuiltinCodes.py +9 -1
- nuitka/code_generation/CallCodes.py +16 -16
- nuitka/code_generation/CodeGeneration.py +14 -2
- nuitka/code_generation/CodeHelperSelection.py +1 -1
- nuitka/code_generation/CodeHelpers.py +4 -1
- nuitka/code_generation/CodeObjectCodes.py +2 -2
- nuitka/code_generation/ComparisonCodes.py +13 -2
- nuitka/code_generation/ComparisonHelperDefinitions.py +23 -8
- nuitka/code_generation/Contexts.py +28 -16
- nuitka/code_generation/CoroutineCodes.py +2 -6
- nuitka/code_generation/DictCodes.py +3 -3
- nuitka/code_generation/ErrorCodes.py +34 -50
- nuitka/code_generation/ExceptionCodes.py +165 -96
- nuitka/code_generation/ExpressionCTypeSelectionHelpers.py +25 -10
- nuitka/code_generation/FrameCodes.py +4 -11
- nuitka/code_generation/FunctionCodes.py +2 -6
- nuitka/code_generation/GeneratorCodes.py +2 -6
- nuitka/code_generation/GlobalConstants.py +8 -2
- nuitka/code_generation/GlobalsLocalsCodes.py +2 -2
- nuitka/code_generation/IteratorCodes.py +67 -54
- nuitka/code_generation/LineNumberCodes.py +1 -3
- nuitka/code_generation/ModuleCodes.py +28 -4
- nuitka/code_generation/OperationCodes.py +51 -20
- nuitka/code_generation/PackageResourceCodes.py +37 -0
- nuitka/code_generation/RaisingCodes.py +164 -90
- nuitka/code_generation/Reports.py +13 -5
- nuitka/code_generation/ReturnCodes.py +2 -16
- nuitka/code_generation/TryCodes.py +12 -24
- nuitka/code_generation/TypeAliasCodes.py +48 -0
- nuitka/code_generation/VariableCodes.py +99 -40
- nuitka/code_generation/VariableDeclarations.py +8 -8
- nuitka/code_generation/YieldCodes.py +1 -1
- nuitka/code_generation/c_types/CTypeBases.py +10 -2
- nuitka/code_generation/c_types/CTypeModuleDictVariables.py +3 -0
- nuitka/code_generation/c_types/CTypeNuitkaBooleans.py +3 -4
- nuitka/code_generation/c_types/CTypeNuitkaInts.py +70 -25
- nuitka/code_generation/c_types/CTypeNuitkaVoids.py +1 -1
- nuitka/code_generation/c_types/CTypePyObjectPointers.py +16 -6
- nuitka/code_generation/templates/CodeTemplatesAsyncgens.py +2 -2
- nuitka/code_generation/templates/CodeTemplatesConstants.py +11 -3
- nuitka/code_generation/templates/CodeTemplatesCoroutines.py +2 -2
- nuitka/code_generation/templates/CodeTemplatesExceptions.py +15 -16
- nuitka/code_generation/templates/CodeTemplatesFrames.py +18 -10
- nuitka/code_generation/templates/CodeTemplatesFunction.py +2 -2
- nuitka/code_generation/templates/CodeTemplatesGeneratorFunction.py +2 -2
- nuitka/code_generation/templates/CodeTemplatesIterators.py +1 -35
- nuitka/code_generation/templates/CodeTemplatesModules.py +34 -4
- nuitka/code_generation/templates/CodeTemplatesVariables.py +76 -0
- nuitka/code_generation/templates_c/CodeTemplateCallsMixed.c.j2 +3 -3
- nuitka/code_generation/templates_c/CodeTemplateCallsPositional.c.j2 +3 -3
- nuitka/code_generation/templates_c/HelperDictionaryCopy.c.j2 +4 -106
- nuitka/code_generation/templates_c/HelperImportHard.c.j2 +1 -2
- nuitka/code_generation/templates_c/HelperLongTools.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperOperationBinaryDual.c.j2 +115 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonBytes.c.j2 +9 -9
- nuitka/code_generation/templates_c/HelperOperationComparisonDual.c.j2 +86 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonFloat.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperOperationComparisonInt.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperOperationComparisonList.c.j2 +9 -9
- nuitka/code_generation/templates_c/HelperOperationComparisonLong.c.j2 +7 -7
- nuitka/code_generation/templates_c/HelperOperationComparisonStr.c.j2 +9 -9
- nuitka/code_generation/templates_c/HelperOperationComparisonTuple.c.j2 +7 -7
- nuitka/code_generation/templates_c/HelperOperationComparisonUnicode.c.j2 +4 -4
- nuitka/code_generation/templates_c/HelperSlotsBinary.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperSlotsInt.c.j2 +31 -31
- nuitka/code_generation/templates_c/HelperSlotsLong.c.j2 +1 -1
- nuitka/containers/Namedtuples.py +6 -0
- nuitka/containers/OrderedSets.py +105 -5
- nuitka/distutils/Build.py +14 -0
- nuitka/distutils/DistutilCommands.py +50 -10
- nuitka/finalizations/Finalization.py +3 -3
- nuitka/finalizations/FinalizeMarkups.py +10 -14
- nuitka/freezer/DependsExe.py +5 -2
- nuitka/freezer/DllDependenciesMacOS.py +18 -1
- nuitka/freezer/DllDependenciesWin32.py +26 -12
- nuitka/freezer/ImportDetection.py +6 -0
- nuitka/freezer/IncludedDataFiles.py +37 -6
- nuitka/freezer/Onefile.py +1 -0
- nuitka/freezer/Standalone.py +72 -18
- nuitka/importing/Importing.py +33 -6
- nuitka/importing/Recursion.py +5 -2
- nuitka/importing/StandardLibrary.py +57 -59
- nuitka/nodes/AsyncgenNodes.py +3 -6
- nuitka/nodes/BuiltinIteratorNodes.py +2 -2
- nuitka/nodes/BuiltinRefNodes.py +14 -30
- nuitka/nodes/ChildrenHavingMixins.py +439 -46
- nuitka/nodes/ConditionalNodes.py +3 -2
- nuitka/nodes/CoroutineNodes.py +3 -6
- nuitka/nodes/DictionaryNodes.py +1 -1
- nuitka/nodes/ExceptionNodes.py +102 -26
- nuitka/nodes/ExpressionBasesGenerated.py +288 -4
- nuitka/nodes/FrameNodes.py +22 -11
- nuitka/nodes/FunctionNodes.py +3 -3
- nuitka/nodes/GeneratorNodes.py +3 -6
- nuitka/nodes/HardImportNodesGenerated.py +182 -0
- nuitka/nodes/ImportNodes.py +2 -2
- nuitka/nodes/NodeBases.py +28 -1
- nuitka/nodes/NodeMakingHelpers.py +71 -50
- nuitka/nodes/OperatorNodesUnary.py +128 -3
- nuitka/nodes/OsSysNodes.py +37 -6
- nuitka/nodes/OutlineNodes.py +2 -2
- nuitka/nodes/StatementBasesGenerated.py +0 -2
- nuitka/nodes/StatementNodes.py +8 -7
- nuitka/nodes/SubscriptNodes.py +1 -1
- nuitka/nodes/TypeNodes.py +28 -1
- nuitka/nodes/VariableAssignNodes.py +2 -1
- nuitka/nodes/shapes/BuiltinTypeShapes.py +24 -7
- nuitka/nodes/shapes/IteratorShapes.py +71 -0
- nuitka/nodes/shapes/ShapeMixins.py +18 -0
- nuitka/nodes/shapes/StandardShapes.py +47 -44
- nuitka/optimizations/BytecodeDemotion.py +2 -1
- nuitka/plugins/PluginBase.py +64 -22
- nuitka/plugins/Plugins.py +16 -3
- nuitka/plugins/standard/AntiBloatPlugin.py +23 -12
- nuitka/plugins/standard/DllFilesPlugin.py +78 -2
- nuitka/plugins/standard/ImplicitImports.py +5 -15
- nuitka/plugins/standard/KivyPlugin.py +3 -12
- nuitka/plugins/standard/MatplotlibPlugin.py +12 -1
- nuitka/plugins/standard/MultiprocessingPlugin.py +11 -20
- nuitka/plugins/standard/OptionsNannyPlugin.py +5 -4
- nuitka/plugins/standard/PlaywrightPlugin.py +184 -0
- nuitka/plugins/standard/PySidePyQtPlugin.py +8 -0
- nuitka/plugins/standard/TkinterPlugin.py +23 -3
- nuitka/plugins/standard/TransformersPlugin.py +70 -275
- nuitka/plugins/standard/standard.nuitka-package.config.yml +413 -30
- nuitka/plugins/standard/stdlib3.nuitka-package.config.yml +35 -2
- nuitka/reports/CompilationReportReader.py +12 -0
- nuitka/reports/Reports.py +11 -0
- nuitka/specs/BuiltinParameterSpecs.py +5 -1
- nuitka/specs/HardImportSpecs.py +7 -0
- nuitka/specs/ParameterSpecs.py +4 -4
- nuitka/tools/environments/Virtualenv.py +13 -5
- nuitka/tools/general/dll_report/__main__.py +10 -1
- nuitka/tools/onefile_compressor/OnefileCompressor.py +1 -1
- nuitka/tools/podman/__main__.py +4 -2
- nuitka/tools/specialize/CTypeDescriptions.py +158 -9
- nuitka/tools/specialize/SpecializeC.py +218 -56
- nuitka/tools/testing/Common.py +69 -62
- nuitka/tools/testing/compare_with_cpython/__main__.py +3 -1
- nuitka/tools/testing/measure_construct_performance/__main__.py +1 -8
- nuitka/tools/testing/run_nuitka_tests/__main__.py +77 -11
- nuitka/tools/watch/AutoStage.py +1 -0
- nuitka/tree/Building.py +10 -37
- nuitka/tree/ComplexCallHelperFunctions.py +4 -0
- nuitka/tree/ReformulationAssertStatements.py +31 -14
- nuitka/tree/ReformulationAssignmentStatements.py +5 -1
- nuitka/tree/ReformulationClasses3.py +94 -19
- nuitka/tree/ReformulationDictionaryCreation.py +1 -0
- nuitka/tree/ReformulationFunctionStatements.py +1 -1
- nuitka/tree/ReformulationMatchStatements.py +3 -1
- nuitka/tree/ReformulationYieldExpressions.py +23 -5
- nuitka/utils/CommandLineOptions.py +27 -3
- nuitka/utils/Download.py +2 -2
- nuitka/utils/Execution.py +36 -31
- nuitka/utils/FileOperations.py +18 -39
- nuitka/utils/Hashing.py +5 -1
- nuitka/utils/Importing.py +2 -14
- nuitka/utils/InlineCopies.py +52 -0
- nuitka/utils/InstalledPythons.py +9 -4
- nuitka/utils/Json.py +2 -2
- nuitka/utils/PackageResources.py +44 -0
- nuitka/utils/SharedLibraries.py +24 -0
- nuitka/utils/Signing.py +9 -1
- nuitka/utils/Utils.py +1 -0
- {Nuitka_winsvc-2.4.11.data → Nuitka_winsvc-2.5.6.data}/scripts/nuitka-run.cmd +0 -0
- {Nuitka_winsvc-2.4.11.data → Nuitka_winsvc-2.5.6.data}/scripts/nuitka.cmd +0 -0
- {Nuitka_winsvc-2.4.11.dist-info → Nuitka_winsvc-2.5.6.dist-info}/LICENSE.txt +0 -0
- {Nuitka_winsvc-2.4.11.dist-info → Nuitka_winsvc-2.5.6.dist-info}/entry_points.txt +0 -0
- {Nuitka_winsvc-2.4.11.dist-info → Nuitka_winsvc-2.5.6.dist-info}/top_level.txt +0 -0
|
@@ -46,6 +46,7 @@ static PyObject *_BINARY_OPERATION_SUB_OBJECT_INT_INT(PyObject *operand1, PyObje
|
|
|
46
46
|
clong_result = x;
|
|
47
47
|
goto exit_result_ok_clong;
|
|
48
48
|
}
|
|
49
|
+
|
|
49
50
|
{
|
|
50
51
|
PyObject *operand1_object = operand1;
|
|
51
52
|
PyObject *operand2_object = operand2;
|
|
@@ -58,7 +59,7 @@ static PyObject *_BINARY_OPERATION_SUB_OBJECT_INT_INT(PyObject *operand1, PyObje
|
|
|
58
59
|
}
|
|
59
60
|
|
|
60
61
|
exit_result_ok_clong:
|
|
61
|
-
result =
|
|
62
|
+
result = Nuitka_PyInt_FromLong(clong_result);
|
|
62
63
|
goto exit_result_ok;
|
|
63
64
|
|
|
64
65
|
exit_result_object:
|
|
@@ -253,6 +254,7 @@ static PyObject *_BINARY_OPERATION_SUB_OBJECT_OBJECT_INT(PyObject *operand1, PyO
|
|
|
253
254
|
clong_result = x;
|
|
254
255
|
goto exit_result_ok_clong;
|
|
255
256
|
}
|
|
257
|
+
|
|
256
258
|
{
|
|
257
259
|
PyObject *operand1_object = operand1;
|
|
258
260
|
PyObject *operand2_object = operand2;
|
|
@@ -265,7 +267,7 @@ static PyObject *_BINARY_OPERATION_SUB_OBJECT_OBJECT_INT(PyObject *operand1, PyO
|
|
|
265
267
|
}
|
|
266
268
|
|
|
267
269
|
exit_result_ok_clong:
|
|
268
|
-
result =
|
|
270
|
+
result = Nuitka_PyInt_FromLong(clong_result);
|
|
269
271
|
goto exit_result_ok;
|
|
270
272
|
|
|
271
273
|
exit_result_object:
|
|
@@ -476,6 +478,7 @@ static PyObject *_BINARY_OPERATION_SUB_OBJECT_INT_OBJECT(PyObject *operand1, PyO
|
|
|
476
478
|
clong_result = x;
|
|
477
479
|
goto exit_result_ok_clong;
|
|
478
480
|
}
|
|
481
|
+
|
|
479
482
|
{
|
|
480
483
|
PyObject *operand1_object = operand1;
|
|
481
484
|
PyObject *operand2_object = operand2;
|
|
@@ -488,7 +491,7 @@ static PyObject *_BINARY_OPERATION_SUB_OBJECT_INT_OBJECT(PyObject *operand1, PyO
|
|
|
488
491
|
}
|
|
489
492
|
|
|
490
493
|
exit_result_ok_clong:
|
|
491
|
-
result =
|
|
494
|
+
result = Nuitka_PyInt_FromLong(clong_result);
|
|
492
495
|
goto exit_result_ok;
|
|
493
496
|
|
|
494
497
|
exit_result_object:
|
|
@@ -1841,9 +1844,10 @@ static PyObject *_BINARY_OPERATION_SUB_OBJECT_INT_CLONG(PyObject *operand1, long
|
|
|
1841
1844
|
clong_result = x;
|
|
1842
1845
|
goto exit_result_ok_clong;
|
|
1843
1846
|
}
|
|
1847
|
+
|
|
1844
1848
|
{
|
|
1845
1849
|
PyObject *operand1_object = operand1;
|
|
1846
|
-
PyObject *operand2_object =
|
|
1850
|
+
PyObject *operand2_object = Nuitka_PyLong_FromLong(operand2);
|
|
1847
1851
|
|
|
1848
1852
|
PyObject *r = PyLong_Type.tp_as_number->nb_subtract(operand1_object, operand2_object);
|
|
1849
1853
|
assert(r != Py_NotImplemented);
|
|
@@ -1855,7 +1859,7 @@ static PyObject *_BINARY_OPERATION_SUB_OBJECT_INT_CLONG(PyObject *operand1, long
|
|
|
1855
1859
|
}
|
|
1856
1860
|
|
|
1857
1861
|
exit_result_ok_clong:
|
|
1858
|
-
result =
|
|
1862
|
+
result = Nuitka_PyInt_FromLong(clong_result);
|
|
1859
1863
|
goto exit_result_ok;
|
|
1860
1864
|
|
|
1861
1865
|
exit_result_object:
|
|
@@ -1911,8 +1915,9 @@ static PyObject *_BINARY_OPERATION_SUB_OBJECT_CLONG_INT(long operand1, PyObject
|
|
|
1911
1915
|
clong_result = x;
|
|
1912
1916
|
goto exit_result_ok_clong;
|
|
1913
1917
|
}
|
|
1918
|
+
|
|
1914
1919
|
{
|
|
1915
|
-
PyObject *operand1_object =
|
|
1920
|
+
PyObject *operand1_object = Nuitka_PyLong_FromLong(operand1);
|
|
1916
1921
|
PyObject *operand2_object = operand2;
|
|
1917
1922
|
|
|
1918
1923
|
PyObject *r = PyLong_Type.tp_as_number->nb_subtract(operand1_object, operand2_object);
|
|
@@ -1925,7 +1930,7 @@ static PyObject *_BINARY_OPERATION_SUB_OBJECT_CLONG_INT(long operand1, PyObject
|
|
|
1925
1930
|
}
|
|
1926
1931
|
|
|
1927
1932
|
exit_result_ok_clong:
|
|
1928
|
-
result =
|
|
1933
|
+
result = Nuitka_PyInt_FromLong(clong_result);
|
|
1929
1934
|
goto exit_result_ok;
|
|
1930
1935
|
|
|
1931
1936
|
exit_result_object:
|
|
@@ -2109,6 +2114,221 @@ PyObject *BINARY_OPERATION_SUB_OBJECT_DIGIT_LONG(long operand1, PyObject *operan
|
|
|
2109
2114
|
return _BINARY_OPERATION_SUB_OBJECT_DIGIT_LONG(operand1, operand2);
|
|
2110
2115
|
}
|
|
2111
2116
|
|
|
2117
|
+
/* Code referring to "LONG" corresponds to Python2 'long', Python3 'int' and "CLONG" to C platform long value. */
|
|
2118
|
+
static PyObject *_BINARY_OPERATION_SUB_OBJECT_LONG_CLONG(PyObject *operand1, long operand2) {
|
|
2119
|
+
CHECK_OBJECT(operand1);
|
|
2120
|
+
assert(PyLong_CheckExact(operand1));
|
|
2121
|
+
|
|
2122
|
+
PyObject *result;
|
|
2123
|
+
|
|
2124
|
+
// Not every code path will make use of all possible results.
|
|
2125
|
+
#ifdef _MSC_VER
|
|
2126
|
+
#pragma warning(push)
|
|
2127
|
+
#pragma warning(disable : 4101)
|
|
2128
|
+
#endif
|
|
2129
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
2130
|
+
NUITKA_MAY_BE_UNUSED long clong_result;
|
|
2131
|
+
#ifdef _MSC_VER
|
|
2132
|
+
#pragma warning(pop)
|
|
2133
|
+
#endif
|
|
2134
|
+
|
|
2135
|
+
PyLongObject *operand1_long_object = (PyLongObject *)operand1;
|
|
2136
|
+
|
|
2137
|
+
bool operand2_is_negative;
|
|
2138
|
+
unsigned long operand2_abs_ival;
|
|
2139
|
+
|
|
2140
|
+
if (operand2 < 0) {
|
|
2141
|
+
operand2_abs_ival = (unsigned long)(-1 - operand2) + 1;
|
|
2142
|
+
operand2_is_negative = true;
|
|
2143
|
+
} else {
|
|
2144
|
+
operand2_abs_ival = (unsigned long)operand2;
|
|
2145
|
+
operand2_is_negative = false;
|
|
2146
|
+
}
|
|
2147
|
+
|
|
2148
|
+
Py_ssize_t operand2_digit_count = 0;
|
|
2149
|
+
digit operand2_digits[5] = {0}; // Could be more minimal and depend on sizeof(digit)
|
|
2150
|
+
{
|
|
2151
|
+
unsigned long t = operand2_abs_ival;
|
|
2152
|
+
|
|
2153
|
+
while (t != 0) {
|
|
2154
|
+
operand2_digit_count += 1;
|
|
2155
|
+
assert(operand2_digit_count <= (Py_ssize_t)(sizeof(operand2_digit_count) / sizeof(digit)));
|
|
2156
|
+
|
|
2157
|
+
operand2_digits[operand2_digit_count] = (digit)(t & PyLong_MASK);
|
|
2158
|
+
t >>= PyLong_SHIFT;
|
|
2159
|
+
}
|
|
2160
|
+
}
|
|
2161
|
+
|
|
2162
|
+
NUITKA_MAY_BE_UNUSED Py_ssize_t operand2_size =
|
|
2163
|
+
operand2_is_negative == false ? operand2_digit_count : -operand2_digit_count;
|
|
2164
|
+
|
|
2165
|
+
if (Nuitka_LongGetDigitSize(operand1_long_object) <= 1 && operand2_digit_count <= 1) {
|
|
2166
|
+
long r = (long)(MEDIUM_VALUE(operand1_long_object) - (sdigit)operand2);
|
|
2167
|
+
|
|
2168
|
+
clong_result = r;
|
|
2169
|
+
goto exit_result_ok_clong;
|
|
2170
|
+
}
|
|
2171
|
+
|
|
2172
|
+
{
|
|
2173
|
+
PyLongObject *z;
|
|
2174
|
+
|
|
2175
|
+
digit const *a_digits = Nuitka_LongGetDigitPointer(operand1_long_object);
|
|
2176
|
+
Py_ssize_t a_digit_count = Nuitka_LongGetDigitSize(operand1_long_object);
|
|
2177
|
+
bool a_negative = Nuitka_LongIsNegative(operand1_long_object);
|
|
2178
|
+
digit const *b_digits = operand2_digits;
|
|
2179
|
+
Py_ssize_t b_digit_count = operand2_digit_count;
|
|
2180
|
+
bool b_negative = operand2_is_negative;
|
|
2181
|
+
|
|
2182
|
+
if (a_negative) {
|
|
2183
|
+
if (b_negative) {
|
|
2184
|
+
z = _Nuitka_LongSubDigits(a_digits, a_digit_count, b_digits, b_digit_count);
|
|
2185
|
+
} else {
|
|
2186
|
+
z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);
|
|
2187
|
+
}
|
|
2188
|
+
|
|
2189
|
+
Nuitka_LongFlipSign(z);
|
|
2190
|
+
} else {
|
|
2191
|
+
if (b_negative) {
|
|
2192
|
+
z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);
|
|
2193
|
+
} else {
|
|
2194
|
+
z = _Nuitka_LongSubDigits(a_digits, a_digit_count, b_digits, b_digit_count);
|
|
2195
|
+
}
|
|
2196
|
+
}
|
|
2197
|
+
|
|
2198
|
+
obj_result = (PyObject *)z;
|
|
2199
|
+
goto exit_result_object;
|
|
2200
|
+
}
|
|
2201
|
+
|
|
2202
|
+
exit_result_object:
|
|
2203
|
+
if (unlikely(obj_result == NULL)) {
|
|
2204
|
+
goto exit_result_exception;
|
|
2205
|
+
}
|
|
2206
|
+
result = obj_result;
|
|
2207
|
+
goto exit_result_ok;
|
|
2208
|
+
|
|
2209
|
+
exit_result_ok_clong:
|
|
2210
|
+
result = Nuitka_LongFromCLong(clong_result);
|
|
2211
|
+
goto exit_result_ok;
|
|
2212
|
+
|
|
2213
|
+
exit_result_ok:
|
|
2214
|
+
return result;
|
|
2215
|
+
|
|
2216
|
+
exit_result_exception:
|
|
2217
|
+
return NULL;
|
|
2218
|
+
}
|
|
2219
|
+
|
|
2220
|
+
PyObject *BINARY_OPERATION_SUB_OBJECT_LONG_CLONG(PyObject *operand1, long operand2) {
|
|
2221
|
+
return _BINARY_OPERATION_SUB_OBJECT_LONG_CLONG(operand1, operand2);
|
|
2222
|
+
}
|
|
2223
|
+
|
|
2224
|
+
/* Code referring to "CLONG" corresponds to C platform long value and "LONG" to Python2 'long', Python3 'int'. */
|
|
2225
|
+
static PyObject *_BINARY_OPERATION_SUB_OBJECT_CLONG_LONG(long operand1, PyObject *operand2) {
|
|
2226
|
+
|
|
2227
|
+
CHECK_OBJECT(operand2);
|
|
2228
|
+
assert(PyLong_CheckExact(operand2));
|
|
2229
|
+
|
|
2230
|
+
PyObject *result;
|
|
2231
|
+
|
|
2232
|
+
// Not every code path will make use of all possible results.
|
|
2233
|
+
#ifdef _MSC_VER
|
|
2234
|
+
#pragma warning(push)
|
|
2235
|
+
#pragma warning(disable : 4101)
|
|
2236
|
+
#endif
|
|
2237
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
2238
|
+
NUITKA_MAY_BE_UNUSED long clong_result;
|
|
2239
|
+
#ifdef _MSC_VER
|
|
2240
|
+
#pragma warning(pop)
|
|
2241
|
+
#endif
|
|
2242
|
+
|
|
2243
|
+
bool operand1_is_negative;
|
|
2244
|
+
unsigned long operand1_abs_ival;
|
|
2245
|
+
|
|
2246
|
+
if (operand1 < 0) {
|
|
2247
|
+
operand1_abs_ival = (unsigned long)(-1 - operand1) + 1;
|
|
2248
|
+
operand1_is_negative = true;
|
|
2249
|
+
} else {
|
|
2250
|
+
operand1_abs_ival = (unsigned long)operand1;
|
|
2251
|
+
operand1_is_negative = false;
|
|
2252
|
+
}
|
|
2253
|
+
|
|
2254
|
+
Py_ssize_t operand1_digit_count = 0;
|
|
2255
|
+
digit operand1_digits[5] = {0}; // Could be more minimal and depend on sizeof(digit)
|
|
2256
|
+
{
|
|
2257
|
+
unsigned long t = operand1_abs_ival;
|
|
2258
|
+
|
|
2259
|
+
while (t != 0) {
|
|
2260
|
+
operand1_digit_count += 1;
|
|
2261
|
+
assert(operand1_digit_count <= (Py_ssize_t)(sizeof(operand1_digit_count) / sizeof(digit)));
|
|
2262
|
+
|
|
2263
|
+
operand1_digits[operand1_digit_count] = (digit)(t & PyLong_MASK);
|
|
2264
|
+
t >>= PyLong_SHIFT;
|
|
2265
|
+
}
|
|
2266
|
+
}
|
|
2267
|
+
|
|
2268
|
+
NUITKA_MAY_BE_UNUSED Py_ssize_t operand1_size =
|
|
2269
|
+
operand1_is_negative == false ? operand1_digit_count : -operand1_digit_count;
|
|
2270
|
+
|
|
2271
|
+
PyLongObject *operand2_long_object = (PyLongObject *)operand2;
|
|
2272
|
+
|
|
2273
|
+
if (operand1_digit_count <= 1 && Nuitka_LongGetDigitSize(operand2_long_object) <= 1) {
|
|
2274
|
+
long r = (long)((sdigit)operand1 - MEDIUM_VALUE(operand2_long_object));
|
|
2275
|
+
|
|
2276
|
+
clong_result = r;
|
|
2277
|
+
goto exit_result_ok_clong;
|
|
2278
|
+
}
|
|
2279
|
+
|
|
2280
|
+
{
|
|
2281
|
+
PyLongObject *z;
|
|
2282
|
+
|
|
2283
|
+
digit const *a_digits = operand1_digits;
|
|
2284
|
+
Py_ssize_t a_digit_count = operand1_digit_count;
|
|
2285
|
+
bool a_negative = operand1_is_negative;
|
|
2286
|
+
digit const *b_digits = Nuitka_LongGetDigitPointer(operand2_long_object);
|
|
2287
|
+
Py_ssize_t b_digit_count = Nuitka_LongGetDigitSize(operand2_long_object);
|
|
2288
|
+
bool b_negative = Nuitka_LongIsNegative(operand2_long_object);
|
|
2289
|
+
|
|
2290
|
+
if (a_negative) {
|
|
2291
|
+
if (b_negative) {
|
|
2292
|
+
z = _Nuitka_LongSubDigits(a_digits, a_digit_count, b_digits, b_digit_count);
|
|
2293
|
+
} else {
|
|
2294
|
+
z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);
|
|
2295
|
+
}
|
|
2296
|
+
|
|
2297
|
+
Nuitka_LongFlipSign(z);
|
|
2298
|
+
} else {
|
|
2299
|
+
if (b_negative) {
|
|
2300
|
+
z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);
|
|
2301
|
+
} else {
|
|
2302
|
+
z = _Nuitka_LongSubDigits(a_digits, a_digit_count, b_digits, b_digit_count);
|
|
2303
|
+
}
|
|
2304
|
+
}
|
|
2305
|
+
|
|
2306
|
+
obj_result = (PyObject *)z;
|
|
2307
|
+
goto exit_result_object;
|
|
2308
|
+
}
|
|
2309
|
+
|
|
2310
|
+
exit_result_object:
|
|
2311
|
+
if (unlikely(obj_result == NULL)) {
|
|
2312
|
+
goto exit_result_exception;
|
|
2313
|
+
}
|
|
2314
|
+
result = obj_result;
|
|
2315
|
+
goto exit_result_ok;
|
|
2316
|
+
|
|
2317
|
+
exit_result_ok_clong:
|
|
2318
|
+
result = Nuitka_LongFromCLong(clong_result);
|
|
2319
|
+
goto exit_result_ok;
|
|
2320
|
+
|
|
2321
|
+
exit_result_ok:
|
|
2322
|
+
return result;
|
|
2323
|
+
|
|
2324
|
+
exit_result_exception:
|
|
2325
|
+
return NULL;
|
|
2326
|
+
}
|
|
2327
|
+
|
|
2328
|
+
PyObject *BINARY_OPERATION_SUB_OBJECT_CLONG_LONG(long operand1, PyObject *operand2) {
|
|
2329
|
+
return _BINARY_OPERATION_SUB_OBJECT_CLONG_LONG(operand1, operand2);
|
|
2330
|
+
}
|
|
2331
|
+
|
|
2112
2332
|
/* Code referring to "FLOAT" corresponds to Python 'float' and "CFLOAT" to C platform float value. */
|
|
2113
2333
|
static PyObject *_BINARY_OPERATION_SUB_OBJECT_FLOAT_CFLOAT(PyObject *operand1, double operand2) {
|
|
2114
2334
|
CHECK_OBJECT(operand1);
|
|
@@ -2230,6 +2450,7 @@ static PyObject *_BINARY_OPERATION_SUB_OBJECT_OBJECT_OBJECT(PyObject *operand1,
|
|
|
2230
2450
|
clong_result = x;
|
|
2231
2451
|
goto exit_result_ok_clong;
|
|
2232
2452
|
}
|
|
2453
|
+
|
|
2233
2454
|
{
|
|
2234
2455
|
PyObject *operand1_object = operand1;
|
|
2235
2456
|
PyObject *operand2_object = operand2;
|
|
@@ -2242,7 +2463,7 @@ static PyObject *_BINARY_OPERATION_SUB_OBJECT_OBJECT_OBJECT(PyObject *operand1,
|
|
|
2242
2463
|
}
|
|
2243
2464
|
|
|
2244
2465
|
exit_result_ok_clong:
|
|
2245
|
-
result =
|
|
2466
|
+
result = Nuitka_PyInt_FromLong(clong_result);
|
|
2246
2467
|
goto exit_result_ok;
|
|
2247
2468
|
|
|
2248
2469
|
exit_result_object:
|
|
@@ -68,6 +68,7 @@ static PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_INT_INT(PyObject *operand1, Py
|
|
|
68
68
|
cfloat_result = r;
|
|
69
69
|
goto exit_result_ok_cfloat;
|
|
70
70
|
}
|
|
71
|
+
|
|
71
72
|
{
|
|
72
73
|
PyObject *operand1_object = operand1;
|
|
73
74
|
PyObject *operand2_object = operand2;
|
|
@@ -308,6 +309,7 @@ static PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_INT(PyObject *operand1,
|
|
|
308
309
|
cfloat_result = r;
|
|
309
310
|
goto exit_result_ok_cfloat;
|
|
310
311
|
}
|
|
312
|
+
|
|
311
313
|
{
|
|
312
314
|
PyObject *operand1_object = operand1;
|
|
313
315
|
PyObject *operand2_object = operand2;
|
|
@@ -565,6 +567,7 @@ static PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_INT_OBJECT(PyObject *operand1,
|
|
|
565
567
|
cfloat_result = r;
|
|
566
568
|
goto exit_result_ok_cfloat;
|
|
567
569
|
}
|
|
570
|
+
|
|
568
571
|
{
|
|
569
572
|
PyObject *operand1_object = operand1;
|
|
570
573
|
PyObject *operand2_object = operand2;
|
|
@@ -1885,9 +1888,10 @@ static PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_INT_CLONG(PyObject *operand1,
|
|
|
1885
1888
|
cfloat_result = r;
|
|
1886
1889
|
goto exit_result_ok_cfloat;
|
|
1887
1890
|
}
|
|
1891
|
+
|
|
1888
1892
|
{
|
|
1889
1893
|
PyObject *operand1_object = operand1;
|
|
1890
|
-
PyObject *operand2_object =
|
|
1894
|
+
PyObject *operand2_object = Nuitka_PyLong_FromLong(operand2);
|
|
1891
1895
|
|
|
1892
1896
|
PyObject *r = PyLong_Type.tp_as_number->nb_true_divide(operand1_object, operand2_object);
|
|
1893
1897
|
assert(r != Py_NotImplemented);
|
|
@@ -1987,8 +1991,9 @@ static PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_CLONG_INT(long operand1, PyObj
|
|
|
1987
1991
|
cfloat_result = r;
|
|
1988
1992
|
goto exit_result_ok_cfloat;
|
|
1989
1993
|
}
|
|
1994
|
+
|
|
1990
1995
|
{
|
|
1991
|
-
PyObject *operand1_object =
|
|
1996
|
+
PyObject *operand1_object = Nuitka_PyLong_FromLong(operand1);
|
|
1992
1997
|
PyObject *operand2_object = operand2;
|
|
1993
1998
|
|
|
1994
1999
|
PyObject *r = PyLong_Type.tp_as_number->nb_true_divide(operand1_object, operand2_object);
|
|
@@ -2200,6 +2205,7 @@ static PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_OBJECT(PyObject *operan
|
|
|
2200
2205
|
cfloat_result = r;
|
|
2201
2206
|
goto exit_result_ok_cfloat;
|
|
2202
2207
|
}
|
|
2208
|
+
|
|
2203
2209
|
{
|
|
2204
2210
|
PyObject *operand1_object = operand1;
|
|
2205
2211
|
PyObject *operand2_object = operand2;
|
|
@@ -47,6 +47,7 @@ static inline bool _INPLACE_OPERATION_ADD_INT_INT(PyObject **operand1, PyObject
|
|
|
47
47
|
clong_result = x;
|
|
48
48
|
goto exit_result_ok_clong;
|
|
49
49
|
}
|
|
50
|
+
|
|
50
51
|
{
|
|
51
52
|
PyObject *operand1_object = *operand1;
|
|
52
53
|
PyObject *operand2_object = operand2;
|
|
@@ -65,7 +66,7 @@ exit_result_ok_clong:
|
|
|
65
66
|
|
|
66
67
|
// That's our return value then. As we use a dedicated variable, it's
|
|
67
68
|
// OK that way.
|
|
68
|
-
*operand1 =
|
|
69
|
+
*operand1 = Nuitka_PyInt_FromLong(clong_result);
|
|
69
70
|
goto exit_result_ok;
|
|
70
71
|
|
|
71
72
|
exit_result_object:
|
|
@@ -305,6 +306,7 @@ static inline bool _INPLACE_OPERATION_ADD_OBJECT_INT(PyObject **operand1, PyObje
|
|
|
305
306
|
clong_result = x;
|
|
306
307
|
goto exit_result_ok_clong;
|
|
307
308
|
}
|
|
309
|
+
|
|
308
310
|
{
|
|
309
311
|
PyObject *operand1_object = *operand1;
|
|
310
312
|
PyObject *operand2_object = operand2;
|
|
@@ -323,7 +325,7 @@ static inline bool _INPLACE_OPERATION_ADD_OBJECT_INT(PyObject **operand1, PyObje
|
|
|
323
325
|
|
|
324
326
|
// That's our return value then. As we use a dedicated variable, it's
|
|
325
327
|
// OK that way.
|
|
326
|
-
*operand1 =
|
|
328
|
+
*operand1 = Nuitka_PyInt_FromLong(clong_result);
|
|
327
329
|
goto exit_result_ok;
|
|
328
330
|
|
|
329
331
|
exit_result_object:
|
|
@@ -557,6 +559,7 @@ static inline bool _INPLACE_OPERATION_ADD_INT_OBJECT(PyObject **operand1, PyObje
|
|
|
557
559
|
clong_result = x;
|
|
558
560
|
goto exit_result_ok_clong;
|
|
559
561
|
}
|
|
562
|
+
|
|
560
563
|
{
|
|
561
564
|
PyObject *operand1_object = *operand1;
|
|
562
565
|
PyObject *operand2_object = operand2;
|
|
@@ -575,7 +578,7 @@ static inline bool _INPLACE_OPERATION_ADD_INT_OBJECT(PyObject **operand1, PyObje
|
|
|
575
578
|
|
|
576
579
|
// That's our return value then. As we use a dedicated variable, it's
|
|
577
580
|
// OK that way.
|
|
578
|
-
*operand1 =
|
|
581
|
+
*operand1 = Nuitka_PyInt_FromLong(clong_result);
|
|
579
582
|
goto exit_result_ok;
|
|
580
583
|
|
|
581
584
|
exit_result_object:
|
|
@@ -712,7 +715,7 @@ exit_result_ok_clong:
|
|
|
712
715
|
|
|
713
716
|
// That's our return value then. As we use a dedicated variable, it's
|
|
714
717
|
// OK that way.
|
|
715
|
-
*operand1 =
|
|
718
|
+
*operand1 = Nuitka_PyLong_FromLong(clong_result);
|
|
716
719
|
goto exit_result_ok;
|
|
717
720
|
|
|
718
721
|
exit_result_ok:
|
|
@@ -1017,7 +1020,7 @@ static inline bool _INPLACE_OPERATION_ADD_OBJECT_LONG(PyObject **operand1, PyObj
|
|
|
1017
1020
|
|
|
1018
1021
|
// That's our return value then. As we use a dedicated variable, it's
|
|
1019
1022
|
// OK that way.
|
|
1020
|
-
*operand1 =
|
|
1023
|
+
*operand1 = Nuitka_PyLong_FromLong(clong_result);
|
|
1021
1024
|
goto exit_result_ok;
|
|
1022
1025
|
|
|
1023
1026
|
exit_result_ok:
|
|
@@ -1316,7 +1319,7 @@ static inline bool _INPLACE_OPERATION_ADD_LONG_OBJECT(PyObject **operand1, PyObj
|
|
|
1316
1319
|
|
|
1317
1320
|
// That's our return value then. As we use a dedicated variable, it's
|
|
1318
1321
|
// OK that way.
|
|
1319
|
-
*operand1 =
|
|
1322
|
+
*operand1 = Nuitka_PyLong_FromLong(clong_result);
|
|
1320
1323
|
goto exit_result_ok;
|
|
1321
1324
|
|
|
1322
1325
|
exit_result_ok:
|
|
@@ -2326,9 +2329,10 @@ static inline bool _INPLACE_OPERATION_ADD_INT_CLONG(PyObject **operand1, long op
|
|
|
2326
2329
|
clong_result = x;
|
|
2327
2330
|
goto exit_result_ok_clong;
|
|
2328
2331
|
}
|
|
2332
|
+
|
|
2329
2333
|
{
|
|
2330
2334
|
PyObject *operand1_object = *operand1;
|
|
2331
|
-
PyObject *operand2_object =
|
|
2335
|
+
PyObject *operand2_object = Nuitka_PyLong_FromLong(operand2);
|
|
2332
2336
|
|
|
2333
2337
|
PyObject *r = PyLong_Type.tp_as_number->nb_add(operand1_object, operand2_object);
|
|
2334
2338
|
assert(r != Py_NotImplemented);
|
|
@@ -2346,7 +2350,7 @@ exit_result_ok_clong:
|
|
|
2346
2350
|
|
|
2347
2351
|
// That's our return value then. As we use a dedicated variable, it's
|
|
2348
2352
|
// OK that way.
|
|
2349
|
-
*operand1 =
|
|
2353
|
+
*operand1 = Nuitka_PyInt_FromLong(clong_result);
|
|
2350
2354
|
goto exit_result_ok;
|
|
2351
2355
|
|
|
2352
2356
|
exit_result_object:
|
|
@@ -2478,7 +2482,7 @@ exit_result_ok_clong:
|
|
|
2478
2482
|
|
|
2479
2483
|
// That's our return value then. As we use a dedicated variable, it's
|
|
2480
2484
|
// OK that way.
|
|
2481
|
-
*operand1 =
|
|
2485
|
+
*operand1 = Nuitka_PyLong_FromLong(clong_result);
|
|
2482
2486
|
goto exit_result_ok;
|
|
2483
2487
|
|
|
2484
2488
|
exit_result_ok:
|
|
@@ -2492,6 +2496,153 @@ bool INPLACE_OPERATION_ADD_LONG_DIGIT(PyObject **operand1, long operand2) {
|
|
|
2492
2496
|
return _INPLACE_OPERATION_ADD_LONG_DIGIT(operand1, operand2);
|
|
2493
2497
|
}
|
|
2494
2498
|
|
|
2499
|
+
/* Code referring to "LONG" corresponds to Python2 'long', Python3 'int' and "CLONG" to C platform long value. */
|
|
2500
|
+
static inline bool _INPLACE_OPERATION_ADD_LONG_CLONG(PyObject **operand1, long operand2) {
|
|
2501
|
+
assert(operand1); // Pointer must be non-null.
|
|
2502
|
+
|
|
2503
|
+
CHECK_OBJECT(*operand1);
|
|
2504
|
+
assert(PyLong_CheckExact(*operand1));
|
|
2505
|
+
|
|
2506
|
+
// Not every code path will make use of all possible results.
|
|
2507
|
+
#ifdef _MSC_VER
|
|
2508
|
+
#pragma warning(push)
|
|
2509
|
+
#pragma warning(disable : 4101)
|
|
2510
|
+
#endif
|
|
2511
|
+
NUITKA_MAY_BE_UNUSED PyObject *obj_result;
|
|
2512
|
+
NUITKA_MAY_BE_UNUSED long clong_result;
|
|
2513
|
+
#ifdef _MSC_VER
|
|
2514
|
+
#pragma warning(pop)
|
|
2515
|
+
#endif
|
|
2516
|
+
|
|
2517
|
+
PyLongObject *operand1_long_object = (PyLongObject *)*operand1;
|
|
2518
|
+
|
|
2519
|
+
bool operand2_is_negative;
|
|
2520
|
+
unsigned long operand2_abs_ival;
|
|
2521
|
+
|
|
2522
|
+
if (operand2 < 0) {
|
|
2523
|
+
operand2_abs_ival = (unsigned long)(-1 - operand2) + 1;
|
|
2524
|
+
operand2_is_negative = true;
|
|
2525
|
+
} else {
|
|
2526
|
+
operand2_abs_ival = (unsigned long)operand2;
|
|
2527
|
+
operand2_is_negative = false;
|
|
2528
|
+
}
|
|
2529
|
+
|
|
2530
|
+
Py_ssize_t operand2_digit_count = 0;
|
|
2531
|
+
digit operand2_digits[5] = {0}; // Could be more minimal and depend on sizeof(digit)
|
|
2532
|
+
{
|
|
2533
|
+
unsigned long t = operand2_abs_ival;
|
|
2534
|
+
|
|
2535
|
+
while (t != 0) {
|
|
2536
|
+
operand2_digit_count += 1;
|
|
2537
|
+
assert(operand2_digit_count <= (Py_ssize_t)(sizeof(operand2_digit_count) / sizeof(digit)));
|
|
2538
|
+
|
|
2539
|
+
operand2_digits[operand2_digit_count] = (digit)(t & PyLong_MASK);
|
|
2540
|
+
t >>= PyLong_SHIFT;
|
|
2541
|
+
}
|
|
2542
|
+
}
|
|
2543
|
+
|
|
2544
|
+
NUITKA_MAY_BE_UNUSED Py_ssize_t operand2_size =
|
|
2545
|
+
operand2_is_negative == false ? operand2_digit_count : -operand2_digit_count;
|
|
2546
|
+
|
|
2547
|
+
if (Nuitka_LongGetDigitSize(operand1_long_object) <= 1 && operand2_digit_count <= 1) {
|
|
2548
|
+
long r = (long)(MEDIUM_VALUE(operand1_long_object) + (sdigit)operand2);
|
|
2549
|
+
|
|
2550
|
+
if (Py_REFCNT(*operand1) == 1) {
|
|
2551
|
+
Nuitka_LongUpdateFromCLong(&*operand1, (long)r);
|
|
2552
|
+
goto exit_result_ok;
|
|
2553
|
+
} else {
|
|
2554
|
+
PyObject *obj = Nuitka_LongFromCLong(r);
|
|
2555
|
+
|
|
2556
|
+
obj_result = obj;
|
|
2557
|
+
goto exit_result_object;
|
|
2558
|
+
}
|
|
2559
|
+
clong_result = r;
|
|
2560
|
+
goto exit_result_ok_clong;
|
|
2561
|
+
}
|
|
2562
|
+
|
|
2563
|
+
if (Py_REFCNT(*operand1) == 1) {
|
|
2564
|
+
digit const *b_digits = operand2_digits;
|
|
2565
|
+
Py_ssize_t b_digit_count = operand2_digit_count;
|
|
2566
|
+
|
|
2567
|
+
bool a_negative = Nuitka_LongIsNegative(operand1_long_object);
|
|
2568
|
+
bool b_negative = operand2_is_negative;
|
|
2569
|
+
|
|
2570
|
+
if (a_negative) {
|
|
2571
|
+
if (b_negative) {
|
|
2572
|
+
*operand1 = _Nuitka_LongAddInplaceDigits(*operand1, b_digits, b_digit_count);
|
|
2573
|
+
Nuitka_LongSetSignNegative(*operand1);
|
|
2574
|
+
} else {
|
|
2575
|
+
*operand1 = _Nuitka_LongSubInplaceDigits(*operand1, b_digits, b_digit_count, -1);
|
|
2576
|
+
}
|
|
2577
|
+
} else {
|
|
2578
|
+
if (b_negative) {
|
|
2579
|
+
*operand1 = _Nuitka_LongSubInplaceDigits(*operand1, b_digits, b_digit_count, 1);
|
|
2580
|
+
} else {
|
|
2581
|
+
*operand1 = _Nuitka_LongAddInplaceDigits(*operand1, b_digits, b_digit_count);
|
|
2582
|
+
}
|
|
2583
|
+
}
|
|
2584
|
+
|
|
2585
|
+
goto exit_result_ok;
|
|
2586
|
+
}
|
|
2587
|
+
{
|
|
2588
|
+
PyLongObject *z;
|
|
2589
|
+
|
|
2590
|
+
digit const *a_digits = Nuitka_LongGetDigitPointer(operand1_long_object);
|
|
2591
|
+
Py_ssize_t a_digit_count = Nuitka_LongGetDigitSize(operand1_long_object);
|
|
2592
|
+
bool a_negative = Nuitka_LongIsNegative(operand1_long_object);
|
|
2593
|
+
digit const *b_digits = operand2_digits;
|
|
2594
|
+
Py_ssize_t b_digit_count = operand2_digit_count;
|
|
2595
|
+
bool b_negative = operand2_is_negative;
|
|
2596
|
+
|
|
2597
|
+
if (a_negative) {
|
|
2598
|
+
if (b_negative) {
|
|
2599
|
+
z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);
|
|
2600
|
+
Nuitka_LongFlipSign(z);
|
|
2601
|
+
} else {
|
|
2602
|
+
z = _Nuitka_LongSubDigits(b_digits, b_digit_count, a_digits, a_digit_count);
|
|
2603
|
+
}
|
|
2604
|
+
} else {
|
|
2605
|
+
if (b_negative) {
|
|
2606
|
+
z = _Nuitka_LongSubDigits(a_digits, a_digit_count, b_digits, b_digit_count);
|
|
2607
|
+
} else {
|
|
2608
|
+
z = _Nuitka_LongAddDigits(a_digits, a_digit_count, b_digits, b_digit_count);
|
|
2609
|
+
}
|
|
2610
|
+
}
|
|
2611
|
+
|
|
2612
|
+
obj_result = (PyObject *)z;
|
|
2613
|
+
goto exit_result_object;
|
|
2614
|
+
}
|
|
2615
|
+
|
|
2616
|
+
exit_result_object:
|
|
2617
|
+
if (unlikely(obj_result == NULL)) {
|
|
2618
|
+
goto exit_result_exception;
|
|
2619
|
+
}
|
|
2620
|
+
// We got an object handed, that we have to release.
|
|
2621
|
+
Py_DECREF(*operand1);
|
|
2622
|
+
*operand1 = obj_result;
|
|
2623
|
+
goto exit_result_ok;
|
|
2624
|
+
|
|
2625
|
+
exit_result_ok_clong:
|
|
2626
|
+
|
|
2627
|
+
// We got an object handed, that we have to release.
|
|
2628
|
+
Py_DECREF(*operand1);
|
|
2629
|
+
|
|
2630
|
+
// That's our return value then. As we use a dedicated variable, it's
|
|
2631
|
+
// OK that way.
|
|
2632
|
+
*operand1 = Nuitka_PyLong_FromLong(clong_result);
|
|
2633
|
+
goto exit_result_ok;
|
|
2634
|
+
|
|
2635
|
+
exit_result_ok:
|
|
2636
|
+
return true;
|
|
2637
|
+
|
|
2638
|
+
exit_result_exception:
|
|
2639
|
+
return false;
|
|
2640
|
+
}
|
|
2641
|
+
|
|
2642
|
+
bool INPLACE_OPERATION_ADD_LONG_CLONG(PyObject **operand1, long operand2) {
|
|
2643
|
+
return _INPLACE_OPERATION_ADD_LONG_CLONG(operand1, operand2);
|
|
2644
|
+
}
|
|
2645
|
+
|
|
2495
2646
|
/* Code referring to "FLOAT" corresponds to Python 'float' and "CFLOAT" to C platform float value. */
|
|
2496
2647
|
static inline bool _INPLACE_OPERATION_ADD_FLOAT_CFLOAT(PyObject **operand1, double operand2) {
|
|
2497
2648
|
assert(operand1); // Pointer must be non-null.
|
|
@@ -4678,6 +4829,7 @@ static inline bool _INPLACE_OPERATION_ADD_OBJECT_OBJECT(PyObject **operand1, PyO
|
|
|
4678
4829
|
clong_result = x;
|
|
4679
4830
|
goto exit_result_ok_clong;
|
|
4680
4831
|
}
|
|
4832
|
+
|
|
4681
4833
|
{
|
|
4682
4834
|
PyObject *operand1_object = *operand1;
|
|
4683
4835
|
PyObject *operand2_object = operand2;
|
|
@@ -4696,7 +4848,7 @@ static inline bool _INPLACE_OPERATION_ADD_OBJECT_OBJECT(PyObject **operand1, PyO
|
|
|
4696
4848
|
|
|
4697
4849
|
// That's our return value then. As we use a dedicated variable, it's
|
|
4698
4850
|
// OK that way.
|
|
4699
|
-
*operand1 =
|
|
4851
|
+
*operand1 = Nuitka_PyInt_FromLong(clong_result);
|
|
4700
4852
|
goto exit_result_ok;
|
|
4701
4853
|
|
|
4702
4854
|
exit_result_object:
|
|
@@ -531,7 +531,7 @@ exit_result_ok_clong:
|
|
|
531
531
|
|
|
532
532
|
// That's our return value then. As we use a dedicated variable, it's
|
|
533
533
|
// OK that way.
|
|
534
|
-
*operand1 =
|
|
534
|
+
*operand1 = Nuitka_PyInt_FromLong(clong_result);
|
|
535
535
|
goto exit_result_ok;
|
|
536
536
|
|
|
537
537
|
exit_result_ok:
|
|
@@ -749,7 +749,7 @@ static inline bool _INPLACE_OPERATION_BITAND_OBJECT_INT(PyObject **operand1, PyO
|
|
|
749
749
|
|
|
750
750
|
// That's our return value then. As we use a dedicated variable, it's
|
|
751
751
|
// OK that way.
|
|
752
|
-
*operand1 =
|
|
752
|
+
*operand1 = Nuitka_PyInt_FromLong(clong_result);
|
|
753
753
|
goto exit_result_ok;
|
|
754
754
|
|
|
755
755
|
exit_result_ok:
|
|
@@ -971,7 +971,7 @@ static inline bool _INPLACE_OPERATION_BITAND_INT_OBJECT(PyObject **operand1, PyO
|
|
|
971
971
|
|
|
972
972
|
// That's our return value then. As we use a dedicated variable, it's
|
|
973
973
|
// OK that way.
|
|
974
|
-
*operand1 =
|
|
974
|
+
*operand1 = Nuitka_PyInt_FromLong(clong_result);
|
|
975
975
|
goto exit_result_ok;
|
|
976
976
|
|
|
977
977
|
exit_result_ok:
|
|
@@ -1025,7 +1025,7 @@ exit_result_ok_clong:
|
|
|
1025
1025
|
|
|
1026
1026
|
// That's our return value then. As we use a dedicated variable, it's
|
|
1027
1027
|
// OK that way.
|
|
1028
|
-
*operand1 =
|
|
1028
|
+
*operand1 = Nuitka_PyInt_FromLong(clong_result);
|
|
1029
1029
|
goto exit_result_ok;
|
|
1030
1030
|
|
|
1031
1031
|
exit_result_ok:
|
|
@@ -1614,7 +1614,7 @@ static inline bool _INPLACE_OPERATION_BITAND_OBJECT_OBJECT(PyObject **operand1,
|
|
|
1614
1614
|
|
|
1615
1615
|
// That's our return value then. As we use a dedicated variable, it's
|
|
1616
1616
|
// OK that way.
|
|
1617
|
-
*operand1 =
|
|
1617
|
+
*operand1 = Nuitka_PyInt_FromLong(clong_result);
|
|
1618
1618
|
goto exit_result_ok;
|
|
1619
1619
|
|
|
1620
1620
|
exit_result_ok:
|