├── 978-1-4842-0065-0_SourceCode ├── AppendixA │ ├── Example1 │ │ ├── Example1.sln │ │ └── Example1 │ │ │ ├── Example1.cpp │ │ │ ├── Example1.vcxproj │ │ │ ├── Example1.vcxproj.filters │ │ │ ├── Example1_.asm │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ ├── Example2 │ │ ├── Example2.sln │ │ └── Example2 │ │ │ ├── Example2.cpp │ │ │ ├── Example2.vcxproj │ │ │ ├── Example2.vcxproj.filters │ │ │ ├── Example2_.asm │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ ├── Example3 │ │ ├── Example3.sln │ │ └── Example3 │ │ │ ├── Example3.cpp │ │ │ ├── Example3.vcxproj │ │ │ ├── Example3.vcxproj.filters │ │ │ ├── Example3.vcxproj.user │ │ │ ├── Example3_.asm │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ └── Example4 │ │ ├── Example4.sln │ │ └── Example4 │ │ ├── Example4.cpp │ │ ├── Example4.vcxproj │ │ ├── Example4.vcxproj.filters │ │ ├── Example4_.asm │ │ ├── ReadMe.txt │ │ ├── stdafx.cpp │ │ ├── stdafx.h │ │ └── targetver.h ├── Chapter02 │ ├── CalcArrayCubes │ │ ├── CalcArrayCubes.sln │ │ └── CalcArrayCubes │ │ │ ├── CalcArrayCubes.cpp │ │ │ ├── CalcArrayCubes.vcxproj │ │ │ ├── CalcArrayCubes.vcxproj.filters │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ ├── CalcArraySquares │ │ ├── CalcArraySquares.sln │ │ └── CalcArraySquares │ │ │ ├── CalcArraySquares.cpp │ │ │ ├── CalcArraySquares.vcxproj │ │ │ ├── CalcArraySquares.vcxproj.filters │ │ │ ├── CalcArraySquares_.asm │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ ├── CalcArraySum │ │ ├── CalcArraySum.sln │ │ └── CalcArraySum │ │ │ ├── CalcArraySum.cpp │ │ │ ├── CalcArraySum.vcxproj │ │ │ ├── CalcArraySum.vcxproj.filters │ │ │ ├── CalcArraySum_.asm │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ ├── CalcMatrixCubes │ │ ├── CalcMatrixCubes.sln │ │ └── CalcMatrixCubes │ │ │ ├── CalcMatrixCubes.cpp │ │ │ ├── CalcMatrixCubes.vcxproj │ │ │ ├── CalcMatrixCubes.vcxproj.filters │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ ├── CalcMatrixRowColSums │ │ ├── CalcMatrixRowColSums.sln │ │ └── CalcMatrixRowColSums │ │ │ ├── CalcMatrixRowColSums.cpp │ │ │ ├── CalcMatrixRowColSums.vcxproj │ │ │ ├── CalcMatrixRowColSums.vcxproj.filters │ │ │ ├── CalcMatrixRowColSumsMisc.cpp │ │ │ ├── CalcMatrixRowColSums_.asm │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ ├── CalcStructSum │ │ ├── CalcStructSum.sln │ │ └── CalcStructSum │ │ │ ├── CalcStructSum.cpp │ │ │ ├── CalcStructSum.vcxproj │ │ │ ├── CalcStructSum.vcxproj.filters │ │ │ ├── CalcStructSum_.asm │ │ │ ├── ReadMe.txt │ │ │ ├── TestStruct.h │ │ │ ├── TestStruct_.inc │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ ├── CalcSum │ │ ├── CalcSum.sln │ │ └── CalcSum │ │ │ ├── CalcSum.cpp │ │ │ ├── CalcSum.vcxproj │ │ │ ├── CalcSum.vcxproj.filters │ │ │ ├── CalcSum_.asm │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ ├── CalcSumTest │ │ ├── CalcSumTest.sln │ │ └── CalcSumTest │ │ │ ├── CalcSumTest.cpp │ │ │ ├── CalcSumTest.vcxproj │ │ │ ├── CalcSumTest.vcxproj.filters │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ ├── CallingConvention │ │ ├── CallingConvention.sln │ │ └── CallingConvention │ │ │ ├── CallingConvention.cpp │ │ │ ├── CallingConvention.vcxproj │ │ │ ├── CallingConvention.vcxproj.filters │ │ │ ├── CallingConvention_.asm │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ ├── CompareArrays │ │ ├── CompareArrays.sln │ │ └── CompareArrays │ │ │ ├── CompareArrays.cpp │ │ │ ├── CompareArrays.vcxproj │ │ │ ├── CompareArrays.vcxproj.filters │ │ │ ├── CompareArrays_.asm │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ ├── ConcatStrings │ │ ├── ConcatStrings.sln │ │ └── ConcatStrings │ │ │ ├── ConcatStrings.cpp │ │ │ ├── ConcatStrings.vcxproj │ │ │ ├── ConcatStrings.vcxproj.filters │ │ │ ├── ConcatStrings_.asm │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ ├── ConditionCodes │ │ ├── ConditionCodes.sln │ │ └── ConditionCodes │ │ │ ├── ConditionCodes.cpp │ │ │ ├── ConditionCodes.vcxproj │ │ │ ├── ConditionCodes.vcxproj.filters │ │ │ ├── ConditionCodes_.asm │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ ├── CountChars │ │ ├── CountChars.sln │ │ └── CountChars │ │ │ ├── CountChars.cpp │ │ │ ├── CountChars.vcxproj │ │ │ ├── CountChars.vcxproj.filters │ │ │ ├── CountChars_.asm │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ ├── CreateStruct │ │ ├── CreateStruct.sln │ │ └── CreateStruct │ │ │ ├── CreateStruct.cpp │ │ │ ├── CreateStruct.vcxproj │ │ │ ├── CreateStruct.vcxproj.filters │ │ │ ├── CreateStruct_.asm │ │ │ ├── ReadMe.txt │ │ │ ├── TestStruct.h │ │ │ ├── TestStruct_.inc │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ ├── IntegerAddition │ │ ├── IntegerAddition.sln │ │ └── IntegerAddition │ │ │ ├── IntegerAddition.cpp │ │ │ ├── IntegerAddition.vcxproj │ │ │ ├── IntegerAddition.vcxproj.filters │ │ │ ├── IntegerAddition_.asm │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ ├── IntegerMulDiv │ │ ├── IntegerMulDiv.sln │ │ └── IntegerMulDiv │ │ │ ├── IntegerMulDiv.cpp │ │ │ ├── IntegerMulDiv.vcxproj │ │ │ ├── IntegerMulDiv.vcxproj.filters │ │ │ ├── IntegerMulDiv_.asm │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ ├── MemoryAddressing │ │ ├── MemoryAddressing.sln │ │ └── MemoryAddressing │ │ │ ├── MemoryAddressing.cpp │ │ │ ├── MemoryAddressing.vcxproj │ │ │ ├── MemoryAddressing.vcxproj.filters │ │ │ ├── MemoryAddressing_.asm │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ └── ReverseArray │ │ ├── ReverseArray.sln │ │ └── ReverseArray │ │ ├── ReadMe.txt │ │ ├── ReverseArray.cpp │ │ ├── ReverseArray.vcxproj │ │ ├── ReverseArray.vcxproj.filters │ │ ├── ReverseArray_.asm │ │ ├── stdafx.cpp │ │ ├── stdafx.h │ │ └── targetver.h ├── Chapter04 │ ├── CalcLeastSquares │ │ ├── CalcLeastSquares.sln │ │ └── CalcLeastSquares │ │ │ ├── CalcLeastSquares.cpp │ │ │ ├── CalcLeastSquares.vcxproj │ │ │ ├── CalcLeastSquares.vcxproj.filters │ │ │ ├── CalcLeastSquares_.asm │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ ├── CalcMeanStdev │ │ ├── CalcMeanStdev.sln │ │ └── CalcMeanStdev │ │ │ ├── CalcMeanStdev.cpp │ │ │ ├── CalcMeanStdev.vcxproj │ │ │ ├── CalcMeanStdev.vcxproj.filters │ │ │ ├── CalcMeanStdev_.asm │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ ├── CalcMinMax │ │ ├── CalcMinMax.sln │ │ └── CalcMinMax │ │ │ ├── CalcMinMax.cpp │ │ │ ├── CalcMinMax.vcxproj │ │ │ ├── CalcMinMax.vcxproj.filters │ │ │ ├── CalcMinMax_.asm │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ ├── CalcSphereAreaVolume │ │ ├── CalcSphereAreaVolume.sln │ │ └── CalcSphereAreaVolume │ │ │ ├── CalcSphereAreaVolume.cpp │ │ │ ├── CalcSphereAreaVolume.vcxproj │ │ │ ├── CalcSphereAreaVolume.vcxproj.filters │ │ │ ├── CalcSphereAreaVolume_.asm │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ ├── ConvertCoordinates │ │ ├── ConvertCoordinates.sln │ │ └── ConvertCoordinates │ │ │ ├── ConvertCoordinates.cpp │ │ │ ├── ConvertCoordinates.vcxproj │ │ │ ├── ConvertCoordinates.vcxproj.filters │ │ │ ├── ConvertCoordinates_.asm │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ └── TemperatureConversions │ │ ├── TemperatureConversions.sln │ │ └── TemperatureConversions │ │ ├── ReadMe.txt │ │ ├── TemperatureConversions.cpp │ │ ├── TemperatureConversions.vcxproj │ │ ├── TemperatureConversions.vcxproj.filters │ │ ├── TemperatureConversions_.asm │ │ ├── stdafx.cpp │ │ ├── stdafx.h │ │ └── targetver.h ├── Chapter06 │ ├── MmxAddition │ │ ├── MmxAddition.sln │ │ └── MmxAddition │ │ │ ├── MmxAddition.cpp │ │ │ ├── MmxAddition.vcxproj │ │ │ ├── MmxAddition.vcxproj.filters │ │ │ ├── MmxAddition_.asm │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ ├── MmxCalcMean │ │ ├── MmxCalcMean.sln │ │ └── MmxCalcMean │ │ │ ├── MmxCalcMean.cpp │ │ │ ├── MmxCalcMean.h │ │ │ ├── MmxCalcMean.vcxproj │ │ │ ├── MmxCalcMean.vcxproj.filters │ │ │ ├── MmxCalcMeanTimed.cpp │ │ │ ├── MmxCalcMean_.asm │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ ├── MmxCalcMinMax │ │ ├── MmxCalcMinMax.sln │ │ └── MmxCalcMinMax │ │ │ ├── MmxCalcMinMax.cpp │ │ │ ├── MmxCalcMinMax.h │ │ │ ├── MmxCalcMinMax.vcxproj │ │ │ ├── MmxCalcMinMax.vcxproj.filters │ │ │ ├── MmxCalcMinMaxTimed.cpp │ │ │ ├── MmxCalcMinMax_.asm │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ ├── MmxMultiplication │ │ ├── MmxMultiplication.sln │ │ └── MmxMultiplication │ │ │ ├── MmxMultiplication.cpp │ │ │ ├── MmxMultiplication.vcxproj │ │ │ ├── MmxMultiplication.vcxproj.filters │ │ │ ├── MmxMultiplication_.asm │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ └── MmxShift │ │ ├── MmxShift.sln │ │ └── MmxShift │ │ ├── MmxShift.cpp │ │ ├── MmxShift.vcxproj │ │ ├── MmxShift.vcxproj.filters │ │ ├── MmxShift_.asm │ │ ├── ReadMe.txt │ │ ├── stdafx.cpp │ │ ├── stdafx.h │ │ └── targetver.h ├── Chapter08 │ ├── SseScalarFloatingPointArithmetic │ │ ├── SseScalarFloatingPointArithmetic.sln │ │ └── SseScalarFloatingPointArithmetic │ │ │ ├── ReadMe.txt │ │ │ ├── SseScalarFloatingPointArithmetic.cpp │ │ │ ├── SseScalarFloatingPointArithmetic.vcxproj │ │ │ ├── SseScalarFloatingPointArithmetic.vcxproj.filters │ │ │ ├── SseScalarFloatingPointArithmetic_.asm │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ ├── SseScalarFloatingPointCompare │ │ ├── SseScalarFloatingPointCompare.sln │ │ └── SseScalarFloatingPointCompare │ │ │ ├── ReadMe.txt │ │ │ ├── SseScalarFloatingPointCompare.cpp │ │ │ ├── SseScalarFloatingPointCompare.vcxproj │ │ │ ├── SseScalarFloatingPointCompare.vcxproj.filters │ │ │ ├── SseScalarFloatingPointCompare_.asm │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ ├── SseScalarFloatingPointConversions │ │ ├── SseScalarFloatingPointConversions.sln │ │ └── SseScalarFloatingPointConversions │ │ │ ├── ReadMe.txt │ │ │ ├── SseScalarFloatingPointConversions.cpp │ │ │ ├── SseScalarFloatingPointConversions.vcxproj │ │ │ ├── SseScalarFloatingPointConversions.vcxproj.filters │ │ │ ├── SseScalarFloatingPointConversions_.asm │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ ├── SseScalarFloatingPointParallelograms │ │ ├── SseScalarFloatingPointParallelograms.sln │ │ └── SseScalarFloatingPointParallelograms │ │ │ ├── ReadMe.txt │ │ │ ├── SseScalarFloatingPointParallelograms.cpp │ │ │ ├── SseScalarFloatingPointParallelograms.vcxproj │ │ │ ├── SseScalarFloatingPointParallelograms.vcxproj.filters │ │ │ ├── SseScalarFloatingPointParallelograms_.asm │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ └── SseScalarFloatingPointSpheres │ │ ├── SseScalarFloatingPointSpheres.sln │ │ └── SseScalarFloatingPointSpheres │ │ ├── ReadMe.txt │ │ ├── SseScalarFloatingPointSpheres.cpp │ │ ├── SseScalarFloatingPointSpheres.vcxproj │ │ ├── SseScalarFloatingPointSpheres.vcxproj.filters │ │ ├── SseScalarFloatingPointSpheres_.asm │ │ ├── stdafx.cpp │ │ ├── stdafx.h │ │ └── targetver.h ├── Chapter09 │ ├── SsePackedFloatingPointArithmetic │ │ ├── SsePackedFloatingPointArithmetic.sln │ │ └── SsePackedFloatingPointArithmetic │ │ │ ├── ReadMe.txt │ │ │ ├── SsePackedFloatingPointArithmetic.cpp │ │ │ ├── SsePackedFloatingPointArithmetic.vcxproj │ │ │ ├── SsePackedFloatingPointArithmetic.vcxproj.filters │ │ │ ├── SsePackedFloatingPointArithmetic_.asm │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ ├── SsePackedFloatingPointCompare │ │ ├── SsePackedFloatingPointCompare.sln │ │ └── SsePackedFloatingPointCompare │ │ │ ├── ReadMe.txt │ │ │ ├── SsePackedFloatingPointCompare.cpp │ │ │ ├── SsePackedFloatingPointCompare.vcxproj │ │ │ ├── SsePackedFloatingPointCompare.vcxproj.filters │ │ │ ├── SsePackedFloatingPointCompare_.asm │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ ├── SsePackedFloatingPointConversions │ │ ├── SsePackedFloatingPointConversions.sln │ │ └── SsePackedFloatingPointConversions │ │ │ ├── ReadMe.txt │ │ │ ├── SsePackedFloatingPointConversions.cpp │ │ │ ├── SsePackedFloatingPointConversions.vcxproj │ │ │ ├── SsePackedFloatingPointConversions.vcxproj.filters │ │ │ ├── SsePackedFloatingPointConversions_.asm │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ ├── SsePackedFloatingPointLeastSquares │ │ ├── SsePackedFloatingPointLeastSquares.sln │ │ └── SsePackedFloatingPointLeastSquares │ │ │ ├── ReadMe.txt │ │ │ ├── SsePackedFloatingPointLeastSquares.cpp │ │ │ ├── SsePackedFloatingPointLeastSquares.vcxproj │ │ │ ├── SsePackedFloatingPointLeastSquares.vcxproj.filters │ │ │ ├── SsePackedFloatingPointLeastSquares_.asm │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ └── SsePackedFloatingPointMatrix4x4 │ │ ├── SsePackedFloatingPointMatrix4x4.sln │ │ └── SsePackedFloatingPointMatrix4x4 │ │ ├── ReadMe.txt │ │ ├── SsePackedFloatingPointMatrix4x4.cpp │ │ ├── SsePackedFloatingPointMatrix4x4.h │ │ ├── SsePackedFloatingPointMatrix4x4.vcxproj │ │ ├── SsePackedFloatingPointMatrix4x4.vcxproj.filters │ │ ├── SsePackedFloatingPointMatrix4x4Fig8-3.cpp │ │ ├── SsePackedFloatingPointMatrix4x4Timed.cpp │ │ ├── SsePackedFloatingPointMatrix4x4_.asm │ │ ├── stdafx.cpp │ │ ├── stdafx.h │ │ └── targetver.h ├── Chapter10 │ ├── SsePackedIntegerFundamentals │ │ ├── SsePackedIntegerFundamentals.sln │ │ └── SsePackedIntegerFundamentals │ │ │ ├── ReadMe.txt │ │ │ ├── SsePackedIntegerFundamentals.cpp │ │ │ ├── SsePackedIntegerFundamentals.vcxproj │ │ │ ├── SsePackedIntegerFundamentals.vcxproj.filters │ │ │ ├── SsePackedIntegerFundamentals_.asm │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ ├── SsePackedIntegerHistogram │ │ ├── SsePackedIntegerHistogram.sln │ │ └── SsePackedIntegerHistogram │ │ │ ├── ReadMe.txt │ │ │ ├── SsePackedIntegerHistogram.cpp │ │ │ ├── SsePackedIntegerHistogram.h │ │ │ ├── SsePackedIntegerHistogram.vcxproj │ │ │ ├── SsePackedIntegerHistogram.vcxproj.filters │ │ │ ├── SsePackedIntegerHistogramTimed.cpp │ │ │ ├── SsePackedIntegerHistogram_.asm │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ └── SsePackedIntegerThreshold │ │ ├── SsePackedIntegerThreshold.sln │ │ └── SsePackedIntegerThreshold │ │ ├── ReadMe.txt │ │ ├── SsePackedIntegerThreshold.cpp │ │ ├── SsePackedIntegerThreshold.h │ │ ├── SsePackedIntegerThreshold.vcxproj │ │ ├── SsePackedIntegerThreshold.vcxproj.filters │ │ ├── SsePackedIntegerThresholdTimed.cpp │ │ ├── SsePackedIntegerThreshold_.asm │ │ ├── stdafx.cpp │ │ ├── stdafx.h │ │ └── targetver.h ├── Chapter11 │ ├── SseTextStringCalcLength │ │ ├── SseTextStringCalcLength.sln │ │ └── SseTextStringCalcLength │ │ │ ├── ReadMe.txt │ │ │ ├── SseTextStringCalcLength.cpp │ │ │ ├── SseTextStringCalcLength.vcxproj │ │ │ ├── SseTextStringCalcLength.vcxproj.filters │ │ │ ├── SseTextStringCalcLength_.asm │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ └── SseTextStringReplaceChar │ │ ├── SseTextStringReplaceChar.sln │ │ └── SseTextStringReplaceChar │ │ ├── ReadMe.txt │ │ ├── SseTextStringReplaceChar.cpp │ │ ├── SseTextStringReplaceChar.vcxproj │ │ ├── SseTextStringReplaceChar.vcxproj.filters │ │ ├── SseTextStringReplaceChar_.asm │ │ ├── stdafx.cpp │ │ ├── stdafx.h │ │ └── targetver.h ├── Chapter13 │ ├── AvxScalarFloatingPointArithmetic │ │ ├── AvxScalarFloatingPointArithmetic.sln │ │ └── AvxScalarFloatingPointArithmetic │ │ │ ├── AvxScalarFloatingPointArithmetic.cpp │ │ │ ├── AvxScalarFloatingPointArithmetic.vcxproj │ │ │ ├── AvxScalarFloatingPointArithmetic.vcxproj.filters │ │ │ ├── AvxScalarFloatingPointArithmetic_.asm │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ ├── AvxScalarFloatingPointCompare │ │ ├── AvxScalarFloatingPointCompare.sln │ │ └── AvxScalarFloatingPointCompare │ │ │ ├── AvxFloatingPointCompare_.asm │ │ │ ├── AvxScalarFloatingPointCompare.cpp │ │ │ ├── AvxScalarFloatingPointCompare.vcxproj │ │ │ ├── AvxScalarFloatingPointCompare.vcxproj.filters │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ ├── AvxScalarFloatingPointQuadEqu │ │ ├── AvxScalarFloatingPointQuadEqu.sln │ │ └── AvxScalarFloatingPointQuadEqu │ │ │ ├── AvxScalarFloatingPointQuadEqu.cpp │ │ │ ├── AvxScalarFloatingPointQuadEqu.vcxproj │ │ │ ├── AvxScalarFloatingPointQuadEqu.vcxproj.filters │ │ │ ├── AvxScalarFloatingPointQuadEqu_.asm │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ └── AvxScalarFloatingPointSpherical │ │ ├── AvxScalarFloatingPointSpherical.sln │ │ └── AvxScalarFloatingPointSpherical │ │ ├── AvxScalarFloatingPointSpherical.cpp │ │ ├── AvxScalarFloatingPointSpherical.vcxproj │ │ ├── AvxScalarFloatingPointSpherical.vcxproj.filters │ │ ├── AvxScalarFloatingPointSpherical_.asm │ │ ├── ReadMe.txt │ │ ├── stdafx.cpp │ │ ├── stdafx.h │ │ └── targetver.h ├── Chapter14 │ ├── AvxPackedFloatingPointArithmetic │ │ ├── AvxPackedFloatingPointArithmetic.sln │ │ └── AvxPackedFloatingPointArithmetic │ │ │ ├── AvxPackedFloatingPointArithmetic.cpp │ │ │ ├── AvxPackedFloatingPointArithmetic.vcxproj │ │ │ ├── AvxPackedFloatingPointArithmetic.vcxproj.filters │ │ │ ├── AvxPackedFloatingPointArithmetic_.asm │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ ├── AvxPackedFloatingPointColMeans │ │ ├── AvxPackedFloatingPointColMeans.sln │ │ └── AvxPackedFloatingPointColMeans │ │ │ ├── AvxPackedFloatingPointColMeans.cpp │ │ │ ├── AvxPackedFloatingPointColMeans.vcxproj │ │ │ ├── AvxPackedFloatingPointColMeans.vcxproj.filters │ │ │ ├── AvxPackedFloatingPointColMeans_.asm │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ ├── AvxPackedFloatingPointCompare │ │ ├── AvxPackedFloatingPointCompare.sln │ │ └── AvxPackedFloatingPointCompare │ │ │ ├── AvxPackedFloatingPointCompare.cpp │ │ │ ├── AvxPackedFloatingPointCompare.vcxproj │ │ │ ├── AvxPackedFloatingPointCompare.vcxproj.filters │ │ │ ├── AvxPackedFloatingPointCompare_.asm │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ └── AvxPackedFloatingPointCorrCoef │ │ ├── AvxPackedFloatingPointCorrCoef.sln │ │ └── AvxPackedFloatingPointCorrCoef │ │ ├── AvxPackedFloatingPointCorrCoef.cpp │ │ ├── AvxPackedFloatingPointCorrCoef.vcxproj │ │ ├── AvxPackedFloatingPointCorrCoef.vcxproj.filters │ │ ├── AvxPackedFloatingPointCorrCoef_.asm │ │ ├── ReadMe.txt │ │ ├── stdafx.cpp │ │ ├── stdafx.h │ │ └── targetver.h ├── Chapter15 │ ├── AvxPackedIntegerArithmetic │ │ ├── AvxPackedIntegerArithmetic.sln │ │ └── AvxPackedIntegerArithmetic │ │ │ ├── AvxPackedIntegerArithmetic.cpp │ │ │ ├── AvxPackedIntegerArithmetic.vcxproj │ │ │ ├── AvxPackedIntegerArithmetic.vcxproj.filters │ │ │ ├── AvxPackedIntegerArithmetic_.asm │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ ├── AvxPackedIntegerPixelClip │ │ ├── AvxPackedIntegerPixelClip.sln │ │ └── AvxPackedIntegerPixelClip │ │ │ ├── AvxPackedIntegerPixelClip.cpp │ │ │ ├── AvxPackedIntegerPixelClip.h │ │ │ ├── AvxPackedIntegerPixelClip.vcxproj │ │ │ ├── AvxPackedIntegerPixelClip.vcxproj.filters │ │ │ ├── AvxPackedIntegerPixelClipTimed.cpp │ │ │ ├── AvxPackedIntegerPixelClip_.asm │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ ├── AvxPackedIntegerThreshold │ │ ├── AvxPackedIntegerThreshold.sln │ │ └── AvxPackedIntegerThreshold │ │ │ ├── AvxPackedIntegerThreshold.cpp │ │ │ ├── AvxPackedIntegerThreshold.h │ │ │ ├── AvxPackedIntegerThreshold.vcxproj │ │ │ ├── AvxPackedIntegerThreshold.vcxproj.filters │ │ │ ├── AvxPackedIntegerThresholdTimed.cpp │ │ │ ├── AvxPackedIntegerThreshold_.asm │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ └── AvxPackedIntegerUnpack │ │ ├── AvxPackedIntegerUnpack.sln │ │ └── AvxPackedIntegerUnpack │ │ ├── AvxPackedIntegerUnpack.cpp │ │ ├── AvxPackedIntegerUnpack.vcxproj │ │ ├── AvxPackedIntegerUnpack.vcxproj.filters │ │ ├── AvxPackedIntegerUnpack_.asm │ │ ├── ReadMe.txt │ │ ├── stdafx.cpp │ │ ├── stdafx.h │ │ └── targetver.h ├── Chapter16 │ ├── AvxBlend │ │ ├── AvxBlend.sln │ │ └── AvxBlend │ │ │ ├── AvxBlend.cpp │ │ │ ├── AvxBlend.vcxproj │ │ │ ├── AvxBlend.vcxproj.filters │ │ │ ├── AvxBlend_.asm │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ ├── AvxBroadcast │ │ ├── AvxBroadcast.sln │ │ └── AvxBroadcast │ │ │ ├── AvxBroadcast.cpp │ │ │ ├── AvxBroadcast.vcxproj │ │ │ ├── AvxBroadcast.vcxproj.filters │ │ │ ├── AvxBroadcast_.asm │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ ├── AvxCpuid │ │ ├── AvxCpuid.sln │ │ └── AvxCpuid │ │ │ ├── AvxCpuid.cpp │ │ │ ├── AvxCpuid.vcxproj │ │ │ ├── AvxCpuid.vcxproj.filters │ │ │ ├── AvxCpuid_.asm │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ ├── AvxFma │ │ ├── AvxFma.sln │ │ └── AvxFma │ │ │ ├── AvxFma.cpp │ │ │ ├── AvxFma.h │ │ │ ├── AvxFma.vcxproj │ │ │ ├── AvxFma.vcxproj.filters │ │ │ ├── AvxFma.vcxproj.user │ │ │ ├── AvxFmaTimed.cpp │ │ │ ├── AvxFma_.asm │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ ├── AvxGather │ │ ├── AvxGather.sln │ │ └── AvxGather │ │ │ ├── AvxGather.cpp │ │ │ ├── AvxGather.vcxproj │ │ │ ├── AvxGather.vcxproj.filters │ │ │ ├── AvxGather_.asm │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ ├── AvxGprBitManip │ │ ├── AvxGprBitManip.sln │ │ └── AvxGprBitManip │ │ │ ├── AvxGprBitManip.cpp │ │ │ ├── AvxGprBitManip.vcxproj │ │ │ ├── AvxGprBitManip.vcxproj.filters │ │ │ ├── AvxGprBitManip_.asm │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ ├── AvxGprMulxShiftx │ │ ├── AvxGprMulxShiftx.sln │ │ └── AvxGprMulxShiftx │ │ │ ├── AvxGprMulxShiftx.cpp │ │ │ ├── AvxGprMulxShiftx.vcxproj │ │ │ ├── AvxGprMulxShiftx.vcxproj.filters │ │ │ ├── AvxGprMulxShiftx_.asm │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ └── AvxPermute │ │ ├── AvxPermute.sln │ │ └── AvxPermute │ │ ├── AvxPermute.cpp │ │ ├── AvxPermute.vcxproj │ │ ├── AvxPermute.vcxproj.filters │ │ ├── AvxPermute_.asm │ │ ├── ReadMe.txt │ │ ├── stdafx.cpp │ │ ├── stdafx.h │ │ └── targetver.h ├── Chapter18 │ ├── CallingConvention1 │ │ ├── CallingConvention1.sln │ │ └── CallingConvention1 │ │ │ ├── CallingConvention1.cpp │ │ │ ├── CallingConvention1.vcxproj │ │ │ ├── CallingConvention1.vcxproj.filters │ │ │ ├── CallingConvention1_.asm │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ ├── CallingConvention2 │ │ ├── CallingConvention2.sln │ │ └── CallingConvention2 │ │ │ ├── CallingConvention2.cpp │ │ │ ├── CallingConvention2.vcxproj │ │ │ ├── CallingConvention2.vcxproj.filters │ │ │ ├── CallingConvention2_.asm │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ ├── CallingConvention3 │ │ ├── CallingConvention3.sln │ │ └── CallingConvention3 │ │ │ ├── CallingConvention3.cpp │ │ │ ├── CallingConvention3.vcxproj │ │ │ ├── CallingConvention3.vcxproj.filters │ │ │ ├── CallingConvention3_.asm │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ ├── CallingConvention4 │ │ ├── CallingConvention4.sln │ │ └── CallingConvention4 │ │ │ ├── CallingConvention4.cpp │ │ │ ├── CallingConvention4.vcxproj │ │ │ ├── CallingConvention4.vcxproj.filters │ │ │ ├── CallingConvention4_.asm │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ ├── ConcatStrings │ │ ├── ConcatStrings.sln │ │ └── ConcatStrings │ │ │ ├── ConcatStrings.cpp │ │ │ ├── ConcatStrings.vcxproj │ │ │ ├── ConcatStrings.vcxproj.filters │ │ │ ├── ConcatStrings_.asm │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ ├── FloatingPointArithmetic │ │ ├── FloatingPointArithmetic.sln │ │ └── FloatingPointArithmetic │ │ │ ├── FloatingPointArithmetic.cpp │ │ │ ├── FloatingPointArithmetic.vcxproj │ │ │ ├── FloatingPointArithmetic.vcxproj.filters │ │ │ ├── FloatingPointArithmetic_.asm │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ ├── IntegerArithmetic │ │ ├── IntegerArithmetic.sln │ │ └── IntegerArithmetic │ │ │ ├── IntegerArithmetic.cpp │ │ │ ├── IntegerArithmetic.vcxproj │ │ │ ├── IntegerArithmetic.vcxproj.filters │ │ │ ├── IntegerArithmetic_.asm │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ ├── IntegerOperands │ │ ├── IntegerOperands.sln │ │ └── IntegerOperands │ │ │ ├── IntegerOperands.cpp │ │ │ ├── IntegerOperands.vcxproj │ │ │ ├── IntegerOperands.vcxproj.filters │ │ │ ├── IntegerOperands_.asm │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ ├── MatrixMul │ │ ├── MatrixMul.sln │ │ └── MatrixMul │ │ │ ├── MatrixMul.cpp │ │ │ ├── MatrixMul.vcxproj │ │ │ ├── MatrixMul.vcxproj.filters │ │ │ ├── MatrixMul_.asm │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ └── MemoryAddressing │ │ ├── MemoryAddressing.sln │ │ └── MemoryAddressing │ │ ├── MemoryAddressing.cpp │ │ ├── MemoryAddressing.vcxproj │ │ ├── MemoryAddressing.vcxproj.filters │ │ ├── MemoryAddressing_.asm │ │ ├── ReadMe.txt │ │ ├── stdafx.cpp │ │ ├── stdafx.h │ │ └── targetver.h ├── Chapter20 │ ├── Avx64CalcEllipsoid │ │ ├── Avx64CalcEllipsoid.sln │ │ └── Avx64CalcEllipsoid │ │ │ ├── Avx64CalcEllipsoid.cpp │ │ │ ├── Avx64CalcEllipsoid.vcxproj │ │ │ ├── Avx64CalcEllipsoid.vcxproj.filters │ │ │ ├── Avx64CalcEllipsoid_.asm │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ ├── Avx64CalcMat4x4Inv │ │ ├── Avx64CalcMat4x4Inv.sln │ │ └── Avx64CalcMat4x4Inv │ │ │ ├── Avx64CalcMat4x4Inv.cpp │ │ │ ├── Avx64CalcMat4x4Inv.h │ │ │ ├── Avx64CalcMat4x4Inv.vcxproj │ │ │ ├── Avx64CalcMat4x4Inv.vcxproj.filters │ │ │ ├── Avx64CalcMat4x4Inv.vcxproj.user │ │ │ ├── Avx64CalcMat4x4InvTest.cpp │ │ │ ├── Avx64CalcMat4x4InvTest_.asm │ │ │ ├── Avx64CalcMat4x4InvTimed.cpp │ │ │ ├── Avx64CalcMat4x4Inv_.asm │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ ├── Avx64CalcRgbMinMax │ │ ├── Avx64CalcRgbMinMax.sln │ │ └── Avx64CalcRgbMinMax │ │ │ ├── Avx64CalcRgbMinMax.cpp │ │ │ ├── Avx64CalcRgbMinMax.vcxproj │ │ │ ├── Avx64CalcRgbMinMax.vcxproj.filters │ │ │ ├── Avx64CalcRgbMinMax_.asm │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ ├── Avx64MiscInstructions │ │ ├── Avx64MiscInstructions.sln │ │ └── Avx64MiscInstructions │ │ │ ├── Avx64MiscInstructions.cpp │ │ │ ├── Avx64MiscInstructions.vcxproj │ │ │ ├── Avx64MiscInstructions.vcxproj.filters │ │ │ ├── Avx64MiscInstructions_.asm │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ ├── DataFiles │ │ ├── TestImage1.bmp │ │ ├── TestImage2.bmp │ │ └── TestImage3.bmp │ ├── Sse64ImageConvert │ │ ├── Sse64ImageConvert.sln │ │ └── Sse64ImageConvert │ │ │ ├── ReadMe.txt │ │ │ ├── Sse64ImageConvert.cpp │ │ │ ├── Sse64ImageConvert.vcxproj │ │ │ ├── Sse64ImageConvert.vcxproj.filters │ │ │ ├── Sse64ImageConvert_.asm │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ ├── Sse64ImageHistogram │ │ ├── Sse64ImageHistogram.sln │ │ └── Sse64ImageHistogram │ │ │ ├── ReadMe.txt │ │ │ ├── Sse64ImageHistogram.cpp │ │ │ ├── Sse64ImageHistogram.h │ │ │ ├── Sse64ImageHistogram.vcxproj │ │ │ ├── Sse64ImageHistogram.vcxproj.filters │ │ │ ├── Sse64ImageHistogramTimed.cpp │ │ │ ├── Sse64ImageHistogram_.asm │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ └── Sse64VectorArrays │ │ ├── Sse64VectorArrays.sln │ │ └── Sse64VectorArrays │ │ ├── ReadMe.txt │ │ ├── Sse64VectorArrays.cpp │ │ ├── Sse64VectorArrays.h │ │ ├── Sse64VectorArrays.vcxproj │ │ ├── Sse64VectorArrays.vcxproj.filters │ │ ├── Sse64VectorArraysTimed.cpp │ │ ├── Sse64VectorArrays_.asm │ │ ├── stdafx.cpp │ │ ├── stdafx.h │ │ └── targetver.h ├── Chapter22 │ ├── LinkedListPrefetch │ │ ├── LinkedListPrefetch.sln │ │ └── LinkedListPrefetch │ │ │ ├── LinkedListPrefetch.cpp │ │ │ ├── LinkedListPrefetch.h │ │ │ ├── LinkedListPrefetch.inc │ │ │ ├── LinkedListPrefetch.vcxproj │ │ │ ├── LinkedListPrefetch.vcxproj.filters │ │ │ ├── LinkedListPrefetch32_.asm │ │ │ ├── LinkedListPrefetch64_.asm │ │ │ ├── LinkedListPrefetchTimed.cpp │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ └── NonTemporalStore │ │ ├── NonTemporalStore.sln │ │ └── NonTemporalStore │ │ ├── NonTemporalStore.cpp │ │ ├── NonTemporalStore.h │ │ ├── NonTemporalStore.vcxproj │ │ ├── NonTemporalStore.vcxproj.filters │ │ ├── NonTemporalStore32_.asm │ │ ├── NonTemporalStore64_.asm │ │ ├── NonTemporalStoreTimed.cpp │ │ ├── ReadMe.txt │ │ ├── stdafx.cpp │ │ ├── stdafx.h │ │ └── targetver.h ├── CommonFiles │ ├── ImageBuffer.cpp │ ├── ImageBuffer.h │ ├── MacrosX86-64.inc │ ├── Mat4x4.cpp │ ├── Mat4x4.h │ ├── MiscDefs.h │ ├── MmxVal.cpp │ ├── MmxVal.h │ ├── ThreadTimer.cpp │ ├── ThreadTimer.h │ ├── XmmVal.cpp │ ├── XmmVal.h │ ├── YmmVal.cpp │ └── YmmVal.h ├── DataFiles │ ├── TestImage1.bmp │ ├── TestImage2.bmp │ └── TestImage3.bmp └── Release Notes.pdf ├── 9781484200650.jpg ├── 9781484200650_AppA.pdf ├── 9781484200650_AppB.pdf ├── 9781484200650_AppC.pdf ├── Errata - Kusswurm.pdf ├── LICENSE.txt ├── README.md └── contributing.md /978-1-4842-0065-0_SourceCode/AppendixA/Example1/Example1.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.30723.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Example1", "Example1\Example1.vcxproj", "{443F8D86-E763-44FE-97A4-217316E46403}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Release|Win32 = Release|Win32 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {443F8D86-E763-44FE-97A4-217316E46403}.Debug|Win32.ActiveCfg = Debug|Win32 15 | {443F8D86-E763-44FE-97A4-217316E46403}.Debug|Win32.Build.0 = Debug|Win32 16 | {443F8D86-E763-44FE-97A4-217316E46403}.Release|Win32.ActiveCfg = Release|Win32 17 | {443F8D86-E763-44FE-97A4-217316E46403}.Release|Win32.Build.0 = Release|Win32 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/AppendixA/Example1/Example1/Example1.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | 3 | extern "C" int CalcResult1_(int a, int b, int c); 4 | 5 | int _tmain(int argc, _TCHAR* argv[]) 6 | { 7 | int a = 30; 8 | int b = 20; 9 | int c = 10; 10 | int d = CalcResult1_(a, b, c); 11 | 12 | printf("a: %4d b: %4d c: %4d\n", a, b, c); 13 | printf("d: %4d\n", d); 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/AppendixA/Example1/Example1/Example1_.asm: -------------------------------------------------------------------------------- 1 | .model flat,c 2 | .code 3 | 4 | ; extern "C" int CalcResult1_(int a, int b, int c); 5 | 6 | CalcResult1_ proc 7 | push ebp 8 | mov ebp,esp 9 | 10 | mov eax,[ebp+8] ;eax = a 11 | mov ecx,[ebp+12] ;ecx = b 12 | mov edx,[ebp+16] ;edx = c 13 | 14 | add eax,ecx ;eax = a + b 15 | imul eax,edx ;eax = (a + b) * c 16 | 17 | pop ebp 18 | ret 19 | CalcResult1_ endp 20 | end 21 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/AppendixA/Example1/Example1/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // Example1.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/AppendixA/Example1/Example1/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/AppendixA/Example1/Example1/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/AppendixA/Example2/Example2.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.30723.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Example2", "Example2\Example2.vcxproj", "{E825B09D-4425-49CA-A440-E5E83DDB89C6}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Release|Win32 = Release|Win32 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {E825B09D-4425-49CA-A440-E5E83DDB89C6}.Debug|Win32.ActiveCfg = Debug|Win32 15 | {E825B09D-4425-49CA-A440-E5E83DDB89C6}.Debug|Win32.Build.0 = Debug|Win32 16 | {E825B09D-4425-49CA-A440-E5E83DDB89C6}.Release|Win32.ActiveCfg = Release|Win32 17 | {E825B09D-4425-49CA-A440-E5E83DDB89C6}.Release|Win32.Build.0 = Release|Win32 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/AppendixA/Example2/Example2/Example2.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | 3 | extern "C" void CalcResult2_(int a, int b, int c, int* quo, int* rem); 4 | 5 | int _tmain(int argc, _TCHAR* argv[]) 6 | { 7 | int a = 75; 8 | int b = 125; 9 | int c = 7; 10 | int quo, rem; 11 | 12 | CalcResult2_(a, b, c, &quo, &rem); 13 | 14 | printf("a: %4d b: %4d c: %4d\n", a, b, c); 15 | printf("quo: %4d rem: %4d\n", quo, rem); 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/AppendixA/Example2/Example2/Example2_.asm: -------------------------------------------------------------------------------- 1 | .model flat,c 2 | .code 3 | 4 | ; extern "C" void CalcResult2_(int a, int b, int c, int* quo, int* rem); 5 | 6 | CalcResult2_ proc 7 | push ebp 8 | mov ebp,esp 9 | 10 | ; Calculate (a + b) / c 11 | mov eax,[ebp+8] ;eax = a 12 | mov ecx,[ebp+12] ;ecx = b 13 | add eax,ecx ;eax = a + b 14 | 15 | cdq ;edx:eax contains dividend 16 | idiv dword ptr [ebp+16] ;eax = quotient, edx = rem 17 | 18 | mov ecx,[ebp+20] ;ecx = ptr to quo 19 | mov dword ptr [ecx],eax ;save quotent 20 | mov ecx,[ebp+24] ;ecx = ptr to rem 21 | mov dword ptr [ecx],edx ;save remainder 22 | 23 | pop ebp 24 | ret 25 | CalcResult2_ endp 26 | end 27 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/AppendixA/Example2/Example2/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // Example2.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/AppendixA/Example2/Example2/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/AppendixA/Example2/Example2/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/AppendixA/Example3/Example3.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.30723.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Example3", "Example3\Example3.vcxproj", "{4BFA400C-FA97-4658-B8F2-CB767E5BA74A}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Release|x64 = Release|x64 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {4BFA400C-FA97-4658-B8F2-CB767E5BA74A}.Debug|x64.ActiveCfg = Debug|x64 15 | {4BFA400C-FA97-4658-B8F2-CB767E5BA74A}.Debug|x64.Build.0 = Debug|x64 16 | {4BFA400C-FA97-4658-B8F2-CB767E5BA74A}.Release|x64.ActiveCfg = Release|x64 17 | {4BFA400C-FA97-4658-B8F2-CB767E5BA74A}.Release|x64.Build.0 = Release|x64 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/AppendixA/Example3/Example3/Example3.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | 3 | extern "C" double CalcResult3_(__int64 a, __int64 b, double c, double d); 4 | 5 | int _tmain(int argc, _TCHAR* argv[]) 6 | { 7 | __int64 a = 10; 8 | __int64 b = -15; 9 | double c = 2.0; 10 | double d = -3.0; 11 | 12 | double e = CalcResult3_(a, b, c, d); 13 | 14 | printf("a: %lld b: %lld c: %.4lf d: %.4lf\n", a, b, c, d); 15 | printf("e: %.4lf\n", e); 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/AppendixA/Example3/Example3/Example3.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/AppendixA/Example3/Example3/Example3_.asm: -------------------------------------------------------------------------------- 1 | .code 2 | 3 | ; extern "C" double CalcResult3_(int a, int b, double c, double d); 4 | 5 | CalcResult3_ proc 6 | imul rcx,rcx ;ecx = a * a 7 | imul rdx,rdx ;edx = b * b 8 | 9 | cvtsi2sd xmm0,rcx ;convert rcx to DPFP 10 | cvtsi2sd xmm1,rdx ;convert rdx to DPFP 11 | 12 | mulsd xmm2,xmm2 ;xmm2 = c * c 13 | mulsd xmm3,xmm3 ;xmm3 = d * d 14 | 15 | addsd xmm0,xmm1 ;xmm0 = a * a + b * b 16 | addsd xmm2,xmm3 ;xmm2 = c * c + d * d 17 | addsd xmm0,xmm2 ;xmm0 = sum of squares 18 | sqrtsd xmm0,xmm0 ;xmm0 = sqrt(sum of squares) 19 | ret 20 | CalcResult3_ endp 21 | end 22 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/AppendixA/Example3/Example3/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // Example3.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/AppendixA/Example3/Example3/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/AppendixA/Example3/Example3/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/AppendixA/Example4/Example4/Example4.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | 3 | extern "C" bool CalcResult4_(int* y, const int* x, int n); 4 | 5 | int _tmain(int argc, _TCHAR* argv[]) 6 | { 7 | const int n = 8; 8 | const int x[n] = {3, 2, 5, 7, 8, 13, 20, 25}; 9 | int y[n]; 10 | 11 | CalcResult4_(y, x, n); 12 | 13 | #ifdef _WIN64 14 | const char* sp = "x64"; 15 | #else 16 | const char* sp = "Win32"; 17 | #endif 18 | 19 | printf("Results for solution platform %s\n\n", sp); 20 | printf(" x y\n"); 21 | printf("--------------\n"); 22 | 23 | for (int i = 0; i < n; i++) 24 | printf("%6d %6d\n", x[i], y[i]); 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/AppendixA/Example4/Example4/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // Example4.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/AppendixA/Example4/Example4/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/AppendixA/Example4/Example4/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/CalcArrayCubes/CalcArrayCubes/CalcArrayCubes.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | 3 | void CalcArrayCubes(int* y, const int* x, int n) 4 | { 5 | for (int i = 0; i < n; i++) 6 | { 7 | int temp = x[i]; 8 | y[i] = temp * temp * temp; 9 | } 10 | } 11 | 12 | int _tmain(int argc, _TCHAR* argv[]) 13 | { 14 | int x[] = { 2, 7, -4, 6, -9, 12, 10 }; 15 | const int n = sizeof(x) / sizeof(int); 16 | int y[n]; 17 | 18 | CalcArrayCubes(y, x, n); 19 | 20 | for (int i = 0; i < n; i++) 21 | printf("i: %4d x: %4d y: %4d\n", i, x[i], y[i]); 22 | printf("\n"); 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/CalcArrayCubes/CalcArrayCubes/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // CalcArrayCubes.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/CalcArrayCubes/CalcArrayCubes/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/CalcArrayCubes/CalcArrayCubes/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/CalcArraySquares/CalcArraySquares/CalcArraySquares.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | 3 | extern "C" int CalcArraySquares_(int* y, const int* x, int n); 4 | 5 | int CalcArraySquaresCpp(int* y, const int* x, int n) 6 | { 7 | int sum = 0; 8 | 9 | for (int i = 0; i < n; i++) 10 | { 11 | y[i] = x[i] * x[i]; 12 | sum += y[i]; 13 | } 14 | 15 | return sum; 16 | } 17 | 18 | int _tmain(int argc, _TCHAR* argv[]) 19 | { 20 | int x[] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29}; 21 | const int n = sizeof(x) / sizeof(int); 22 | int y1[n]; 23 | int y2[n]; 24 | int sum_y1 = CalcArraySquaresCpp(y1, x, n); 25 | int sum_y2 = CalcArraySquares_(y2, x, n); 26 | 27 | for (int i = 0; i < n; i++) 28 | printf("i: %2d x: %4d y1: %4d y2: %4d\n", i, x[i], y1[i], y2[i]); 29 | printf("\n"); 30 | 31 | printf("sum_y1: %d\n", sum_y1); 32 | printf("sum_y2: %d\n", sum_y2); 33 | 34 | return 0; 35 | } 36 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/CalcArraySquares/CalcArraySquares/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // CalcArraySquares.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/CalcArraySquares/CalcArraySquares/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/CalcArraySquares/CalcArraySquares/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/CalcArraySum/CalcArraySum.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.30110.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CalcArraySum", "CalcArraySum\CalcArraySum.vcxproj", "{30950132-BAA7-424C-9FC3-9059F10F57E3}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Release|Win32 = Release|Win32 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {30950132-BAA7-424C-9FC3-9059F10F57E3}.Debug|Win32.ActiveCfg = Debug|Win32 15 | {30950132-BAA7-424C-9FC3-9059F10F57E3}.Debug|Win32.Build.0 = Debug|Win32 16 | {30950132-BAA7-424C-9FC3-9059F10F57E3}.Release|Win32.ActiveCfg = Release|Win32 17 | {30950132-BAA7-424C-9FC3-9059F10F57E3}.Release|Win32.Build.0 = Release|Win32 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/CalcArraySum/CalcArraySum/CalcArraySum.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | 3 | extern "C" int CalcArraySum_(const int* x, int n); 4 | 5 | int CalcArraySumCpp(const int* x, int n) 6 | { 7 | int sum = 0; 8 | 9 | for (int i = 0; i < n; i++) 10 | sum += *x++; 11 | 12 | return sum; 13 | } 14 | 15 | int _tmain(int argc, _TCHAR* argv[]) 16 | { 17 | int x[] = {1, 7, -3, 5, 2, 9, -6, 12}; 18 | int n = sizeof(x) / sizeof(int); 19 | 20 | printf("Elements of x[]\n"); 21 | for (int i = 0; i < n; i++) 22 | printf("%d ", x[i]); 23 | printf("\n\n"); 24 | 25 | int sum1 = CalcArraySumCpp(x, n); 26 | int sum2 = CalcArraySum_(x, n); 27 | 28 | printf("sum1: %d\n", sum1); 29 | printf("sum2: %d\n", sum2); 30 | return 0; 31 | } 32 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/CalcArraySum/CalcArraySum/CalcArraySum_.asm: -------------------------------------------------------------------------------- 1 | .model flat,c 2 | .code 3 | 4 | ; extern "C" int CalcArraySum_(const int* x, int n); 5 | ; 6 | ; Description: This function sums the elements of a signed 7 | ; integer array. 8 | 9 | CalcArraySum_ proc 10 | push ebp 11 | mov ebp,esp 12 | 13 | ; Load arguments and initialize sum 14 | mov edx,[ebp+8] ;edx = 'x' 15 | mov ecx,[ebp+12] ;ecx = 'n' 16 | xor eax,eax ;eax = sum 17 | 18 | ; Make sure 'n' is greater than zero 19 | cmp ecx,0 20 | jle InvalidCount 21 | 22 | ; Calculate the array element sum 23 | @@: add eax,[edx] ;add next element to sum 24 | add edx,4 ;set pointer to next element 25 | dec ecx ;adjust counter 26 | jnz @B ;repeat if not done 27 | 28 | InvalidCount: 29 | pop ebp 30 | ret 31 | CalcArraySum_ endp 32 | end 33 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/CalcArraySum/CalcArraySum/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // CalcArraySum.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/CalcArraySum/CalcArraySum/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/CalcArraySum/CalcArraySum/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/CalcMatrixCubes/CalcMatrixCubes/CalcMatrixCubes.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | 3 | void CalcMatrixCubes(int* y, const int* x, int nrows, int ncols) 4 | { 5 | for (int i = 0; i < nrows; i++) 6 | { 7 | for (int j = 0; j < ncols; j++) 8 | { 9 | int k = i * ncols + j; 10 | y[k] = x[k] * x[k] * x[k]; 11 | } 12 | } 13 | } 14 | 15 | int _tmain(int argc, _TCHAR* argv[]) 16 | { 17 | const int nrows = 4; 18 | const int ncols = 3; 19 | int x[nrows][ncols] = { { 1, 2, 3 }, { 4, 5, 6 }, { 7, 8, 9 }, { 10, 11, 12 } }; 20 | int y[nrows][ncols]; 21 | 22 | CalcMatrixCubes(&y[0][0], &x[0][0], nrows, ncols); 23 | 24 | for (int i = 0; i < nrows; i++) 25 | { 26 | for (int j = 0; j < ncols; j++) 27 | printf("(%2d, %2d): %6d, %6d\n", i, j, x[i][j], y[i][j]); 28 | } 29 | 30 | return 0; 31 | } 32 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/CalcMatrixCubes/CalcMatrixCubes/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // CalcMatrixCubes.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/CalcMatrixCubes/CalcMatrixCubes/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/CalcMatrixCubes/CalcMatrixCubes/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/CalcMatrixRowColSums/CalcMatrixRowColSums/CalcMatrixRowColSumsMisc.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | 3 | void PrintResults(const int* x, int nrows, int ncols, int* row_sums, int* col_sums) 4 | { 5 | for (int i = 0; i < nrows; i++) 6 | { 7 | for (int j = 0; j < ncols; j++) 8 | printf("%5d ", x[i* ncols + j]); 9 | printf(" -- %5d\n", row_sums[i]); 10 | } 11 | printf("\n"); 12 | 13 | for (int i = 0; i < ncols; i++) 14 | printf("%5d ", col_sums[i]); 15 | printf("\n"); 16 | } 17 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/CalcMatrixRowColSums/CalcMatrixRowColSums/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // CalcMatrixRowColSums.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/CalcMatrixRowColSums/CalcMatrixRowColSums/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/CalcMatrixRowColSums/CalcMatrixRowColSums/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/CalcStructSum/CalcStructSum/CalcStructSum.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "TestStruct.h" 3 | 4 | extern "C" __int64 CalcStructSum_(const TestStruct* ts); 5 | 6 | __int64 CalcStructSumCpp(const TestStruct* ts) 7 | { 8 | return ts->Val8 + ts->Val16 + ts->Val32 + ts->Val64; 9 | } 10 | 11 | int _tmain(int argc, _TCHAR* argv[]) 12 | { 13 | TestStruct ts; 14 | 15 | ts.Val8 = -100; 16 | ts.Val16 = 2000; 17 | ts.Val32 = -300000; 18 | ts.Val64 = 40000000000; 19 | 20 | __int64 sum1 = CalcStructSumCpp(&ts); 21 | __int64 sum2 = CalcStructSum_(&ts); 22 | 23 | printf("Input: %d %d %d %lld\n", ts.Val8, ts.Val16, ts.Val32, ts.Val64); 24 | printf("sum1: %lld\n", sum1); 25 | printf("sum2: %lld\n", sum2); 26 | 27 | if (sum1 != sum2) 28 | printf("Sum verify check failed!\n"); 29 | 30 | return 0; 31 | } 32 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/CalcStructSum/CalcStructSum/TestStruct.h: -------------------------------------------------------------------------------- 1 | // The declaration of 'TestStruct' must be the same 2 | // in both TestStruct.h and TestStruct_.inc 3 | 4 | typedef struct 5 | { 6 | __int8 Val8; 7 | __int8 Pad8; 8 | __int16 Val16; 9 | __int32 Val32; 10 | __int64 Val64; 11 | } TestStruct; 12 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/CalcStructSum/CalcStructSum/TestStruct_.inc: -------------------------------------------------------------------------------- 1 | ; The declaration of 'TestStruct' must be the same 2 | ; in both TestStruct.h and TestStruct_.inc 3 | 4 | TestStruct struct 5 | Val8 byte ? 6 | Pad8 byte ? 7 | Val16 word ? 8 | Val32 dword ? 9 | Val64 qword ? 10 | TestStruct ends 11 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/CalcStructSum/CalcStructSum/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // CalcStructSum.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/CalcStructSum/CalcStructSum/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/CalcStructSum/CalcStructSum/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/CalcSum/CalcSum.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.21005.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CalcSum", "CalcSum\CalcSum.vcxproj", "{DDB19F50-3460-4F4A-A415-75A206C36EA4}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Release|Win32 = Release|Win32 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {DDB19F50-3460-4F4A-A415-75A206C36EA4}.Debug|Win32.ActiveCfg = Debug|Win32 15 | {DDB19F50-3460-4F4A-A415-75A206C36EA4}.Debug|Win32.Build.0 = Debug|Win32 16 | {DDB19F50-3460-4F4A-A415-75A206C36EA4}.Release|Win32.ActiveCfg = Release|Win32 17 | {DDB19F50-3460-4F4A-A415-75A206C36EA4}.Release|Win32.Build.0 = Release|Win32 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/CalcSum/CalcSum/CalcSum.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | 3 | extern "C" int CalcSum_(int a, int b, int c); 4 | 5 | int _tmain(int argc, _TCHAR* argv[]) 6 | { 7 | int a = 17, b = 11, c = 14; 8 | int sum = CalcSum_(a, b, c); 9 | 10 | printf(" a: %d\n", a); 11 | printf(" b: %d\n", b); 12 | printf(" c: %d\n", c); 13 | printf(" sum: %d\n", sum); 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/CalcSum/CalcSum/CalcSum_.asm: -------------------------------------------------------------------------------- 1 | .model flat,c 2 | .code 3 | 4 | ; extern "C" int CalcSum_(int a, int b, int c) 5 | ; 6 | ; Description: This function demonstrates passing arguments between 7 | ; a C++ function and an assembly language function. 8 | ; 9 | ; Returns: a + b + c 10 | 11 | CalcSum_ proc 12 | 13 | ; Initialize a stack frame pointer 14 | push ebp 15 | mov ebp,esp 16 | 17 | ; Load the argument values 18 | mov eax,[ebp+8] ; eax = 'a' 19 | mov ecx,[ebp+12] ; ecx = 'b' 20 | mov edx,[ebp+16] ; edx = 'c' 21 | 22 | ; Calculate the sum 23 | add eax,ecx ; eax = 'a' + 'b' 24 | add eax,edx ; eax = 'a' + 'b' + 'c' 25 | 26 | ; Restore the caller's stack frame pointer 27 | pop ebp 28 | ret 29 | 30 | CalcSum_ endp 31 | end 32 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/CalcSum/CalcSum/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // CalcSum.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/CalcSum/CalcSum/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/CalcSum/CalcSum/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/CalcSumTest/CalcSumTest.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.21005.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CalcSumTest", "CalcSumTest\CalcSumTest.vcxproj", "{30C260DB-40A4-4FF8-B899-D61B920B715E}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Release|Win32 = Release|Win32 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {30C260DB-40A4-4FF8-B899-D61B920B715E}.Debug|Win32.ActiveCfg = Debug|Win32 15 | {30C260DB-40A4-4FF8-B899-D61B920B715E}.Debug|Win32.Build.0 = Debug|Win32 16 | {30C260DB-40A4-4FF8-B899-D61B920B715E}.Release|Win32.ActiveCfg = Release|Win32 17 | {30C260DB-40A4-4FF8-B899-D61B920B715E}.Release|Win32.Build.0 = Release|Win32 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/CalcSumTest/CalcSumTest/CalcSumTest.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | 3 | int CalcSumTest(int a, int b, int c) 4 | { 5 | return a + b + c; 6 | } 7 | 8 | int _tmain(int argc, _TCHAR* argv[]) 9 | { 10 | int a = 17, b = 11, c = 14; 11 | int sum = CalcSumTest(a, b, c); 12 | 13 | printf(" a: %d\n", a); 14 | printf(" b: %d\n", b); 15 | printf(" c: %d\n", c); 16 | printf(" sum: %d\n", sum); 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/CalcSumTest/CalcSumTest/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // CalcSumTest.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/CalcSumTest/CalcSumTest/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/CalcSumTest/CalcSumTest/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/CallingConvention/CallingConvention/CallingConvention.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | 3 | extern "C" void CalculateSums_(int a, int b, int c, int* s1, int* s2, int* s3); 4 | 5 | int _tmain(int argc, _TCHAR* argv[]) 6 | { 7 | int a = 3, b = 5, c = 8; 8 | int s1a, s2a, s3a; 9 | 10 | CalculateSums_(a, b, c, &s1a, &s2a, &s3a); 11 | 12 | // Compute the sums again so we can verify the results 13 | // of CalculateSums_(). 14 | 15 | int s1b = a + b + c; 16 | int s2b = a * a + b * b + c * c; 17 | int s3b = a * a * a + b * b * b + c * c * c; 18 | 19 | printf("Input: a: %4d b: %4d c: %4d\n", a, b, c); 20 | printf("Output: s1a: %4d s2a: %4d s3a: %4d\n", s1a, s2a, s3a); 21 | printf(" s1b: %4d s2b: %4d s3b: %4d\n", s1b, s2b, s3b); 22 | 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/CallingConvention/CallingConvention/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // CallingConvention.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/CallingConvention/CallingConvention/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/CallingConvention/CallingConvention/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/CompareArrays/CompareArrays/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // CompareArrays.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/CompareArrays/CompareArrays/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/CompareArrays/CompareArrays/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/ConcatStrings/ConcatStrings/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // ConcatStrings.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/ConcatStrings/ConcatStrings/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/ConcatStrings/ConcatStrings/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/ConditionCodes/ConditionCodes/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // ConditionCodes.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/ConditionCodes/ConditionCodes/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/ConditionCodes/ConditionCodes/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/CountChars/CountChars.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.21005.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CountChars", "CountChars\CountChars.vcxproj", "{3B225A51-CC8A-4C2A-A027-C17D21A341AD}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Release|Win32 = Release|Win32 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {3B225A51-CC8A-4C2A-A027-C17D21A341AD}.Debug|Win32.ActiveCfg = Debug|Win32 15 | {3B225A51-CC8A-4C2A-A027-C17D21A341AD}.Debug|Win32.Build.0 = Debug|Win32 16 | {3B225A51-CC8A-4C2A-A027-C17D21A341AD}.Release|Win32.ActiveCfg = Release|Win32 17 | {3B225A51-CC8A-4C2A-A027-C17D21A341AD}.Release|Win32.Build.0 = Release|Win32 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/CountChars/CountChars/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // CountChars.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/CountChars/CountChars/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/CountChars/CountChars/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/CreateStruct/CreateStruct.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.21005.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CreateStruct", "CreateStruct\CreateStruct.vcxproj", "{07D9C6DC-7C00-45C9-864C-1C891F0A4DF7}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Release|Win32 = Release|Win32 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {07D9C6DC-7C00-45C9-864C-1C891F0A4DF7}.Debug|Win32.ActiveCfg = Debug|Win32 15 | {07D9C6DC-7C00-45C9-864C-1C891F0A4DF7}.Debug|Win32.Build.0 = Debug|Win32 16 | {07D9C6DC-7C00-45C9-864C-1C891F0A4DF7}.Release|Win32.ActiveCfg = Release|Win32 17 | {07D9C6DC-7C00-45C9-864C-1C891F0A4DF7}.Release|Win32.Build.0 = Release|Win32 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/CreateStruct/CreateStruct/CreateStruct.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "TestStruct.h" 3 | 4 | extern "C" TestStruct* CreateTestStruct_(__int8 val8, __int16 val16, __int32 val32, __int64 val64); 5 | extern "C" void ReleaseTestStruct_(TestStruct* p); 6 | 7 | void PrintTestStruct(const char* msg, const TestStruct* ts) 8 | { 9 | printf("%s\n", msg); 10 | printf(" ts->Val8: %d\n", ts->Val8); 11 | printf(" ts->Val16: %d\n", ts->Val16); 12 | printf(" ts->Val32: %d\n", ts->Val32); 13 | printf(" ts->Val64: %lld\n", ts->Val64); 14 | } 15 | 16 | int _tmain(int argc, _TCHAR* argv[]) 17 | { 18 | TestStruct* ts = CreateTestStruct_(40, -401, 400002, -4000000003LL); 19 | 20 | PrintTestStruct("Contents of TestStruct 'ts'", ts); 21 | 22 | ReleaseTestStruct_(ts); 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/CreateStruct/CreateStruct/TestStruct.h: -------------------------------------------------------------------------------- 1 | // The declaration of 'TestStruct' must be the same 2 | // in both TestStruct.h and TestStruct_.inc 3 | 4 | typedef struct 5 | { 6 | __int8 Val8; 7 | __int8 Pad8; 8 | __int16 Val16; 9 | __int32 Val32; 10 | __int64 Val64; 11 | } TestStruct; 12 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/CreateStruct/CreateStruct/TestStruct_.inc: -------------------------------------------------------------------------------- 1 | ; The declaration of 'TestStruct' must be the same 2 | ; in both TestStruct.h and TestStruct_.inc 3 | 4 | TestStruct struct 5 | Val8 byte ? 6 | Pad byte ? 7 | Val16 word ? 8 | Val32 dword ? 9 | Val64 qword ? 10 | TestStruct ends 11 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/CreateStruct/CreateStruct/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // CreateStruct.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/CreateStruct/CreateStruct/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/CreateStruct/CreateStruct/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/IntegerAddition/IntegerAddition/IntegerAddition.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | 3 | extern "C" char GlChar = 10; 4 | extern "C" short GlShort = 20; 5 | extern "C" int GlInt = 30; 6 | extern "C" long long GlLongLong = 0x000000000FFFFFFFE; 7 | 8 | extern "C" void IntegerAddition_(char a, short b, int c, long long d); 9 | 10 | int _tmain(int argc, _TCHAR* argv[]) 11 | { 12 | printf("Before GlChar: %d\n", GlChar); 13 | printf(" GlShort: %d\n", GlShort); 14 | printf(" GlInt: %d\n", GlInt); 15 | printf(" GlLongLong: %lld\n", GlLongLong); 16 | printf("\n"); 17 | 18 | IntegerAddition_(3, 5, -37, 11); 19 | 20 | printf("After GlChar: %d\n", GlChar); 21 | printf(" GlShort: %d\n", GlShort); 22 | printf(" GlInt: %d\n", GlInt); 23 | printf(" GlLongLong: %lld\n", GlLongLong); 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/IntegerAddition/IntegerAddition/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // IntegerAddition.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/IntegerAddition/IntegerAddition/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/IntegerAddition/IntegerAddition/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/IntegerMulDiv/IntegerMulDiv/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // IntegerMulDiv.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/IntegerMulDiv/IntegerMulDiv/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/IntegerMulDiv/IntegerMulDiv/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/MemoryAddressing/MemoryAddressing/MemoryAddressing.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | 3 | extern "C" int NumFibVals_; 4 | extern "C" int MemoryAddressing_(int i, int* v1, int* v2, int* v3, int* v4); 5 | 6 | int _tmain(int argc, _TCHAR* argv[]) 7 | { 8 | for (int i = -1; i < NumFibVals_ + 1; i++) 9 | { 10 | int v1 = -1, v2 = -1, v3 = -1, v4 = -1; 11 | int rc = MemoryAddressing_(i, &v1, &v2, &v3, &v4); 12 | 13 | printf("i: %2d rc: %2d - ", i, rc); 14 | printf("v1: %5d v2: %5d v3: %5d v4: %5d\n", v1, v2, v3, v4); 15 | } 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/MemoryAddressing/MemoryAddressing/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // MemoryAddressing.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/MemoryAddressing/MemoryAddressing/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/MemoryAddressing/MemoryAddressing/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/ReverseArray/ReverseArray.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.21005.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ReverseArray", "ReverseArray\ReverseArray.vcxproj", "{C9A7AE89-E150-48B5-90C7-B94D232397D9}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Release|Win32 = Release|Win32 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {C9A7AE89-E150-48B5-90C7-B94D232397D9}.Debug|Win32.ActiveCfg = Debug|Win32 15 | {C9A7AE89-E150-48B5-90C7-B94D232397D9}.Debug|Win32.Build.0 = Debug|Win32 16 | {C9A7AE89-E150-48B5-90C7-B94D232397D9}.Release|Win32.ActiveCfg = Release|Win32 17 | {C9A7AE89-E150-48B5-90C7-B94D232397D9}.Release|Win32.Build.0 = Release|Win32 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/ReverseArray/ReverseArray/ReverseArray.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include 3 | 4 | extern "C" void ReverseArray_(int* y, const int* x, int n); 5 | 6 | int _tmain(int argc, _TCHAR* argv[]) 7 | { 8 | const int n = 21; 9 | int x[n], y[n]; 10 | 11 | // Initialize test array 12 | srand(31); 13 | for (int i = 0; i < n; i++) 14 | x[i] = rand() % 1000; 15 | 16 | ReverseArray_(y, x, n); 17 | 18 | printf("\nResults for ReverseArray\n"); 19 | for (int i = 0; i < n; i++) 20 | { 21 | printf(" i: %5d y: %5d x: %5d\n", i, y[i], x[i]); 22 | if (x[i] != y[n - 1 - i]) 23 | printf(" Compare failed!\n"); 24 | } 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/ReverseArray/ReverseArray/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // ReverseArray.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/ReverseArray/ReverseArray/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter02/ReverseArray/ReverseArray/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter04/CalcLeastSquares/CalcLeastSquares/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // CalcLeastSquares.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter04/CalcLeastSquares/CalcLeastSquares/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter04/CalcLeastSquares/CalcLeastSquares/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter04/CalcMeanStdev/CalcMeanStdev/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // CalcMeanStdev.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter04/CalcMeanStdev/CalcMeanStdev/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter04/CalcMeanStdev/CalcMeanStdev/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter04/CalcMinMax/CalcMinMax.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.21005.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CalcMinMax", "CalcMinMax\CalcMinMax.vcxproj", "{0E838B9B-4869-44C3-AF0E-8E24786690F3}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Release|Win32 = Release|Win32 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {0E838B9B-4869-44C3-AF0E-8E24786690F3}.Debug|Win32.ActiveCfg = Debug|Win32 15 | {0E838B9B-4869-44C3-AF0E-8E24786690F3}.Debug|Win32.Build.0 = Debug|Win32 16 | {0E838B9B-4869-44C3-AF0E-8E24786690F3}.Release|Win32.ActiveCfg = Release|Win32 17 | {0E838B9B-4869-44C3-AF0E-8E24786690F3}.Release|Win32.Build.0 = Release|Win32 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter04/CalcMinMax/CalcMinMax/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // CalcMinMax.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter04/CalcMinMax/CalcMinMax/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter04/CalcMinMax/CalcMinMax/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter04/CalcSphereAreaVolume/CalcSphereAreaVolume/CalcSphereAreaVolume.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | 3 | extern "C" bool CalcSphereAreaVolume_(double r, double* sa, double* v); 4 | 5 | int _tmain(int argc, _TCHAR* argv[]) 6 | { 7 | double r[] = { -1.0, 0.0, 1.0, 2.0, 3.0, 5.0, 10.0, 20.0 }; 8 | int num_r = sizeof(r) / sizeof(double); 9 | 10 | for (int i = 0; i < num_r; i++) 11 | { 12 | double sa = -1; 13 | double v = -1; 14 | bool rc = CalcSphereAreaVolume_(r[i], &sa, &v); 15 | 16 | printf("rc: %d r: %8.2lf sa: %10.4lf v: %10.4lf\n", rc, r[i], sa, v); 17 | } 18 | 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter04/CalcSphereAreaVolume/CalcSphereAreaVolume/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // CalcSphereAreaVolume.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter04/CalcSphereAreaVolume/CalcSphereAreaVolume/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter04/CalcSphereAreaVolume/CalcSphereAreaVolume/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter04/ConvertCoordinates/ConvertCoordinates/ConvertCoordinates.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | 3 | extern "C" void RectToPolar_(double x, double y, double* r, double* a); 4 | extern "C" void PolarToRect_(double r, double a, double* x, double* y); 5 | 6 | int _tmain(int argc, _TCHAR* argv[]) 7 | { 8 | double x1[] = { 0, 3, -3, 4, -4 }; 9 | double y1[] = { 0, 3, -3, 4, -4 }; 10 | const int nx = sizeof(x1) / sizeof(double); 11 | const int ny = sizeof(y1) / sizeof(double); 12 | 13 | for (int i = 0; i < ny; i++) 14 | { 15 | for (int j = 0; j < nx; j++) 16 | { 17 | double r, a, x2, y2; 18 | 19 | RectToPolar_(x1[i], y1[j], &r, &a); 20 | PolarToRect_(r, a, &x2, &y2); 21 | 22 | printf("[%d, %d]: ", i, j); 23 | printf("(%8.4lf, %8.4lf) ", x1[i], y1[j]); 24 | printf("(%8.4lf, %10.4lf) ", r, a); 25 | printf("(%8.4lf, %8.4lf)\n", x2, y2); 26 | } 27 | } 28 | 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter04/ConvertCoordinates/ConvertCoordinates/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // ConvertCoordinates.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter04/ConvertCoordinates/ConvertCoordinates/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter04/ConvertCoordinates/ConvertCoordinates/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter04/TemperatureConversions/TemperatureConversions/TemperatureConversions.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | 3 | extern "C" double FtoC_(double deg_f); 4 | extern "C" double CtoF_(double deg_c); 5 | 6 | int _tmain(int argc, _TCHAR* argv[]) 7 | { 8 | double deg_fvals[] = {-459.67, -40.0, 0.0, 32.0, 72.0, 98.6, 212.0}; 9 | int nf = sizeof(deg_fvals) / sizeof(double); 10 | 11 | for (int i = 0; i < nf; i++) 12 | { 13 | double deg_c = FtoC_(deg_fvals[i]); 14 | printf("i: %d f: %10.4lf c: %10.4lf\n", i, deg_fvals[i], deg_c); 15 | } 16 | 17 | printf("\n"); 18 | 19 | double deg_cvals[] = {-273.15, -40.0, -17.77, 0.0, 25.0, 37.0, 100.0}; 20 | int nc = sizeof(deg_cvals) / sizeof(double); 21 | 22 | for (int i = 0; i < nc; i++) 23 | { 24 | double deg_f = CtoF_(deg_cvals[i]); 25 | printf("i: %d c: %10.4lf f: %10.4lf\n", i, deg_cvals[i], deg_f); 26 | } 27 | 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter04/TemperatureConversions/TemperatureConversions/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // TemperatureConversions.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter04/TemperatureConversions/TemperatureConversions/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter04/TemperatureConversions/TemperatureConversions/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter06/MmxAddition/MmxAddition.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.30110.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MmxAddition", "MmxAddition\MmxAddition.vcxproj", "{B34DC04A-0886-4B69-9D77-77EFBEE09FDF}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Release|Win32 = Release|Win32 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {B34DC04A-0886-4B69-9D77-77EFBEE09FDF}.Debug|Win32.ActiveCfg = Debug|Win32 15 | {B34DC04A-0886-4B69-9D77-77EFBEE09FDF}.Debug|Win32.Build.0 = Debug|Win32 16 | {B34DC04A-0886-4B69-9D77-77EFBEE09FDF}.Release|Win32.ActiveCfg = Release|Win32 17 | {B34DC04A-0886-4B69-9D77-77EFBEE09FDF}.Release|Win32.Build.0 = Release|Win32 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter06/MmxAddition/MmxAddition/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // MmxAddition.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter06/MmxAddition/MmxAddition/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter06/MmxAddition/MmxAddition/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter06/MmxCalcMean/MmxCalcMean.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.30110.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MmxCalcMean", "MmxCalcMean\MmxCalcMean.vcxproj", "{119573E8-173F-4573-9F19-F0F6069148FB}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Release|Win32 = Release|Win32 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {119573E8-173F-4573-9F19-F0F6069148FB}.Debug|Win32.ActiveCfg = Debug|Win32 15 | {119573E8-173F-4573-9F19-F0F6069148FB}.Debug|Win32.Build.0 = Debug|Win32 16 | {119573E8-173F-4573-9F19-F0F6069148FB}.Release|Win32.ActiveCfg = Release|Win32 17 | {119573E8-173F-4573-9F19-F0F6069148FB}.Release|Win32.Build.0 = Release|Win32 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter06/MmxCalcMean/MmxCalcMean/MmxCalcMean.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "MiscDefs.h" 4 | 5 | // Functions defined in MmxCalcMean.cpp 6 | extern bool MmxCalcMeanCpp(const Uint8* x, int n, Uint32* sum_x, double* mean); 7 | 8 | // Functions defined in MmxCalcMeanTimed.cpp 9 | extern void MmxCalcMeanTimed(void); 10 | 11 | // Functions defined in MmxCalcMean_.asm 12 | extern "C" bool MmxCalcMean_(const Uint8* x, int n, Uint32* sum_x, double* mean); 13 | 14 | // Common constants 15 | const int NUM_ELEMENTS = 0x800000; 16 | const int SRAND_SEED = 23; 17 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter06/MmxCalcMean/MmxCalcMean/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // MmxCalcMean.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter06/MmxCalcMean/MmxCalcMean/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter06/MmxCalcMean/MmxCalcMean/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter06/MmxCalcMinMax/MmxCalcMinMax/MmxCalcMinMax.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "MiscDefs.h" 4 | 5 | // Functions defined in MmxCalcMinMax.cpp 6 | extern bool MmxCalcMinMaxCpp(Uint8* x, int n, Uint8* x_min, Uint8* x_max); 7 | 8 | // Functions defined in MmxCalcMinMaxTimed.cpp 9 | extern void MmxCalcMinMaxTimed(void); 10 | 11 | // Functions defined in MmxCalcMinMax_.asm 12 | extern "C" bool MmxCalcMinMax_(Uint8* x, int n, Uint8* x_min, Uint8* x_max); 13 | 14 | // Common constants 15 | const int NUM_ELEMENTS = 0x800000; 16 | const int SRAND_SEED = 14; 17 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter06/MmxCalcMinMax/MmxCalcMinMax/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // MmxCalcMinMax.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter06/MmxCalcMinMax/MmxCalcMinMax/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter06/MmxCalcMinMax/MmxCalcMinMax/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter06/MmxMultiplication/MmxMultiplication/MmxMultiplication.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "MmxVal.h" 3 | 4 | extern "C" void MmxMulSignedWord_(MmxVal a, MmxVal b, MmxVal* prod_lo, MmxVal* prod_hi); 5 | 6 | int _tmain(int argc, _TCHAR* argv[]) 7 | { 8 | MmxVal a, b, prod_lo, prod_hi; 9 | char buff[256]; 10 | 11 | a.i16[0] = 10; b.i16[0] = 2000; 12 | a.i16[1] = 30; b.i16[1] = -4000; 13 | a.i16[2] = -50; b.i16[2] = 6000; 14 | a.i16[3] = -70; b.i16[3] = -8000; 15 | 16 | MmxMulSignedWord_(a, b, &prod_lo, &prod_hi); 17 | 18 | printf("\nResults for MmxMulSignedWord_\n"); 19 | printf("a: %s\n", a.ToString_i16(buff, sizeof(buff))); 20 | printf("b: %s\n\n", b.ToString_i16(buff, sizeof(buff))); 21 | printf("prod_lo: %s\n", prod_lo.ToString_i32(buff, sizeof(buff))); 22 | printf("prod_hi: %s\n", prod_hi.ToString_i32(buff, sizeof(buff))); 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter06/MmxMultiplication/MmxMultiplication/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // MmxMultiplication.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter06/MmxMultiplication/MmxMultiplication/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter06/MmxMultiplication/MmxMultiplication/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter06/MmxShift/MmxShift.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.30110.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MmxShift", "MmxShift\MmxShift.vcxproj", "{C322811A-5F9C-4716-B627-C51559786250}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Release|Win32 = Release|Win32 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {C322811A-5F9C-4716-B627-C51559786250}.Debug|Win32.ActiveCfg = Debug|Win32 15 | {C322811A-5F9C-4716-B627-C51559786250}.Debug|Win32.Build.0 = Debug|Win32 16 | {C322811A-5F9C-4716-B627-C51559786250}.Release|Win32.ActiveCfg = Release|Win32 17 | {C322811A-5F9C-4716-B627-C51559786250}.Release|Win32.Build.0 = Release|Win32 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter06/MmxShift/MmxShift/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // MmxShift.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter06/MmxShift/MmxShift/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter06/MmxShift/MmxShift/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter08/SseScalarFloatingPointArithmetic/SseScalarFloatingPointArithmetic/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // SseScalarFloatingPointArithmetic.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter08/SseScalarFloatingPointArithmetic/SseScalarFloatingPointArithmetic/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter08/SseScalarFloatingPointArithmetic/SseScalarFloatingPointArithmetic/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter08/SseScalarFloatingPointCompare/SseScalarFloatingPointCompare/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // SseScalarFloatingPointCompare.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter08/SseScalarFloatingPointCompare/SseScalarFloatingPointCompare/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter08/SseScalarFloatingPointCompare/SseScalarFloatingPointCompare/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter08/SseScalarFloatingPointConversions/SseScalarFloatingPointConversions/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // SseScalarFloatingPointConversions.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter08/SseScalarFloatingPointConversions/SseScalarFloatingPointConversions/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter08/SseScalarFloatingPointConversions/SseScalarFloatingPointConversions/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter08/SseScalarFloatingPointParallelograms/SseScalarFloatingPointParallelograms/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // SseScalarFloatingPointParallelograms.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter08/SseScalarFloatingPointParallelograms/SseScalarFloatingPointParallelograms/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter08/SseScalarFloatingPointParallelograms/SseScalarFloatingPointParallelograms/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter08/SseScalarFloatingPointSpheres/SseScalarFloatingPointSpheres/SseScalarFloatingPointSpheres.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | 3 | extern "C" bool SseSfpCalcSphereAreaVolume_(double r, double* sa, double* v); 4 | 5 | int _tmain(int argc, _TCHAR* argv[]) 6 | { 7 | const double r[] = {-1.0, 0.0, 1.0, 2.0, 3.0, 5.0, 10.0, 20.0}; 8 | int num_r = sizeof(r) / sizeof(double); 9 | 10 | for (int i = 0; i < num_r; i++) 11 | { 12 | double sa, v; 13 | bool rc = SseSfpCalcSphereAreaVolume_(r[i], &sa, &v); 14 | 15 | printf("rc: %d r: %8.2lf sa: %10.4lf vol: %10.4lf\n", rc, r[i], sa, v); 16 | } 17 | 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter08/SseScalarFloatingPointSpheres/SseScalarFloatingPointSpheres/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // SseScalarFloatingPointSpheres.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter08/SseScalarFloatingPointSpheres/SseScalarFloatingPointSpheres/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter08/SseScalarFloatingPointSpheres/SseScalarFloatingPointSpheres/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter09/SsePackedFloatingPointArithmetic/SsePackedFloatingPointArithmetic/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // SsePackedFloatingPointArithmetic.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter09/SsePackedFloatingPointArithmetic/SsePackedFloatingPointArithmetic/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter09/SsePackedFloatingPointArithmetic/SsePackedFloatingPointArithmetic/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter09/SsePackedFloatingPointCompare/SsePackedFloatingPointCompare/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // SsePackedFloatingPointCompare.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter09/SsePackedFloatingPointCompare/SsePackedFloatingPointCompare/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter09/SsePackedFloatingPointCompare/SsePackedFloatingPointCompare/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter09/SsePackedFloatingPointConversions/SsePackedFloatingPointConversions/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // SsePackedFloatingPointConversions.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter09/SsePackedFloatingPointConversions/SsePackedFloatingPointConversions/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter09/SsePackedFloatingPointConversions/SsePackedFloatingPointConversions/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter09/SsePackedFloatingPointLeastSquares/SsePackedFloatingPointLeastSquares/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // SsePackedFloatingPointLeastSquares.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter09/SsePackedFloatingPointLeastSquares/SsePackedFloatingPointLeastSquares/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter09/SsePackedFloatingPointLeastSquares/SsePackedFloatingPointLeastSquares/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter09/SsePackedFloatingPointMatrix4x4/SsePackedFloatingPointMatrix4x4/SsePackedFloatingPointMatrix4x4.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Mat4x4.h" 3 | 4 | // SsePackedFloatingPointMatrix4x4.cpp function declarations 5 | extern void SsePfpMatrix4x4MultiplyCpp(Mat4x4 m_des, Mat4x4 m_src1, Mat4x4 m_src2); 6 | extern void SsePfpMatrix4x4TransformVectorsCpp(Vec4x1* v_des, Mat4x4 m_src, Vec4x1* v_src, int num_vec); 7 | 8 | // SsePackedFloatingPointMatrix4x4_.asm function declarations 9 | extern "C" void SsePfpMatrix4x4Multiply_(Mat4x4 m_des, Mat4x4 m_src1, Mat4x4 m_src2); 10 | extern "C" void SsePfpMatrix4x4TransformVectors_(Vec4x1* v_des, Mat4x4 m_src, Vec4x1* v_src, int num_vec); 11 | 12 | // SsePackedFloatingPointMatrix4x4Timed.cpp function declarations 13 | extern void SsePfpMatrix4x4MultiplyTimed(void); 14 | extern void SsePfpMatrix4x4TransformVectorsTimed(void); 15 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter09/SsePackedFloatingPointMatrix4x4/SsePackedFloatingPointMatrix4x4/SsePackedFloatingPointMatrix4x4Fig8-3.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "SsePackedFloatingPointMatrix4x4.h" 3 | 4 | void TestFig8_3(void) 5 | { 6 | __declspec(align(16)) Mat4x4 m_src1; 7 | __declspec(align(16)) Mat4x4 m_src2; 8 | __declspec(align(16)) Mat4x4 m_des; 9 | 10 | Mat4x4SetRow(m_src1, 0, 1, 0, 0, 0); 11 | Mat4x4SetRow(m_src1, 1, 0, 1, 0, 0); 12 | Mat4x4SetRow(m_src1, 2, 0, 0, 1, 0); 13 | Mat4x4SetRow(m_src1, 3, 0, 0, 0, 1); 14 | 15 | Mat4x4SetRow(m_src2, 0, 2, 7, 8, 3); 16 | Mat4x4SetRow(m_src2, 1, 11, 14, 16, 10); 17 | Mat4x4SetRow(m_src2, 2, 24, 21, 27, 29); 18 | Mat4x4SetRow(m_src2, 3, 31, 34, 38, 33); 19 | 20 | SsePfpMatrix4x4Multiply_(m_des, m_src1, m_src2); 21 | } 22 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter09/SsePackedFloatingPointMatrix4x4/SsePackedFloatingPointMatrix4x4/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // SsePackedFloatingPointMatrix4x4.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter09/SsePackedFloatingPointMatrix4x4/SsePackedFloatingPointMatrix4x4/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter09/SsePackedFloatingPointMatrix4x4/SsePackedFloatingPointMatrix4x4/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter10/SsePackedIntegerFundamentals/SsePackedIntegerFundamentals/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // SsePackedIntegerFundamentals.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter10/SsePackedIntegerFundamentals/SsePackedIntegerFundamentals/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter10/SsePackedIntegerFundamentals/SsePackedIntegerFundamentals/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter10/SsePackedIntegerHistogram/SsePackedIntegerHistogram/SsePackedIntegerHistogram.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ImageBuffer.h" 4 | 5 | // Functions defined in SsePackedIntegerHistogram.cpp 6 | extern bool SsePiHistogramCpp(Uint32* histo, const Uint8* pixel_buff, Uint32 num_pixels); 7 | 8 | // Functions defined in SsePackedIntegerHistogram_.asm 9 | extern "C" bool SsePiHistogram_(Uint32* histo, const Uint8* pixel_buff, Uint32 num_pixels); 10 | 11 | // Functions defined in SsePackedIntegerHistogramTimed.cpp 12 | extern void SsePiHistogramTimed(void); 13 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter10/SsePackedIntegerHistogram/SsePackedIntegerHistogram/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // SsePackedIntegerHistogram.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter10/SsePackedIntegerHistogram/SsePackedIntegerHistogram/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter10/SsePackedIntegerHistogram/SsePackedIntegerHistogram/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter10/SsePackedIntegerThreshold/SsePackedIntegerThreshold/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // SsePackedIntegerThreshold.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter10/SsePackedIntegerThreshold/SsePackedIntegerThreshold/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter10/SsePackedIntegerThreshold/SsePackedIntegerThreshold/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter11/SseTextStringCalcLength/SseTextStringCalcLength/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // SseTextStringCalcLength.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter11/SseTextStringCalcLength/SseTextStringCalcLength/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter11/SseTextStringCalcLength/SseTextStringCalcLength/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter11/SseTextStringReplaceChar/SseTextStringReplaceChar/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // SseTextStringReplaceChar.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter11/SseTextStringReplaceChar/SseTextStringReplaceChar/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter11/SseTextStringReplaceChar/SseTextStringReplaceChar/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter13/AvxScalarFloatingPointArithmetic/AvxScalarFloatingPointArithmetic/AvxScalarFloatingPointArithmetic.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | 3 | extern "C" void AvxSfpArithmetic_(double a, double b, double results[8]); 4 | 5 | int _tmain(int argc, _TCHAR* argv[]) 6 | { 7 | const int n = 8; 8 | const char* inames[n] = 9 | { 10 | "vaddsd", "vsubsd", "vmulsd", "vdivsd", 11 | "vminsd", "vmaxsd", "vsqrtsd a", "fabs b" 12 | }; 13 | 14 | double a = 17.75; 15 | double b = -39.1875; 16 | double c[n]; 17 | 18 | AvxSfpArithmetic_(a, b, c); 19 | 20 | printf("\nResults for AvxScalarFloatingPointArithmetic\n"); 21 | printf("a: %.6lf\n", a); 22 | printf("b: %.6lf\n", b); 23 | for (int i = 0; i < n; i++) 24 | printf("%-14s %-12.6lf\n", inames[i], c[i]); 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter13/AvxScalarFloatingPointArithmetic/AvxScalarFloatingPointArithmetic/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // AvxScalarFloatingPointArithmetic.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter13/AvxScalarFloatingPointArithmetic/AvxScalarFloatingPointArithmetic/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter13/AvxScalarFloatingPointArithmetic/AvxScalarFloatingPointArithmetic/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter13/AvxScalarFloatingPointCompare/AvxScalarFloatingPointCompare/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // AvxScalarFloatingPointCompare.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter13/AvxScalarFloatingPointCompare/AvxScalarFloatingPointCompare/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter13/AvxScalarFloatingPointCompare/AvxScalarFloatingPointCompare/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter13/AvxScalarFloatingPointQuadEqu/AvxScalarFloatingPointQuadEqu/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // AvxScalarFloatingPointQuadEqu.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter13/AvxScalarFloatingPointQuadEqu/AvxScalarFloatingPointQuadEqu/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter13/AvxScalarFloatingPointQuadEqu/AvxScalarFloatingPointQuadEqu/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter13/AvxScalarFloatingPointSpherical/AvxScalarFloatingPointSpherical/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // AvxScalarFloatingPointSpherical.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter13/AvxScalarFloatingPointSpherical/AvxScalarFloatingPointSpherical/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter13/AvxScalarFloatingPointSpherical/AvxScalarFloatingPointSpherical/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter14/AvxPackedFloatingPointArithmetic/AvxPackedFloatingPointArithmetic/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // AvxPackedFloatingPointArithmetic.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter14/AvxPackedFloatingPointArithmetic/AvxPackedFloatingPointArithmetic/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter14/AvxPackedFloatingPointArithmetic/AvxPackedFloatingPointArithmetic/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter14/AvxPackedFloatingPointColMeans/AvxPackedFloatingPointColMeans/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // AvxPackedFloatingPointColMeans.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter14/AvxPackedFloatingPointColMeans/AvxPackedFloatingPointColMeans/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter14/AvxPackedFloatingPointColMeans/AvxPackedFloatingPointColMeans/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter14/AvxPackedFloatingPointCompare/AvxPackedFloatingPointCompare/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // AvxPackedFloatingPointCompare.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter14/AvxPackedFloatingPointCompare/AvxPackedFloatingPointCompare/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter14/AvxPackedFloatingPointCompare/AvxPackedFloatingPointCompare/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter14/AvxPackedFloatingPointCorrCoef/AvxPackedFloatingPointCorrCoef/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // AvxPackedFloatingPointCorrCoef.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter14/AvxPackedFloatingPointCorrCoef/AvxPackedFloatingPointCorrCoef/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter14/AvxPackedFloatingPointCorrCoef/AvxPackedFloatingPointCorrCoef/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter15/AvxPackedIntegerArithmetic/AvxPackedIntegerArithmetic/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // AvxPackedIntegerArithmetic.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter15/AvxPackedIntegerArithmetic/AvxPackedIntegerArithmetic/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter15/AvxPackedIntegerArithmetic/AvxPackedIntegerArithmetic/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter15/AvxPackedIntegerPixelClip/AvxPackedIntegerPixelClip/AvxPackedIntegerPixelClip.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "MiscDefs.h" 4 | 5 | // The following structure must match the stucture that's declared 6 | // in the file AvxPackedIntegerPixelClip_.asm. 7 | typedef struct 8 | { 9 | Uint8* Src; // source buffer 10 | Uint8* Des; // destination buffer 11 | Uint32 NumPixels; // number of pixels 12 | Uint32 NumClippedPixels; // number of clipped pixels 13 | Uint8 ThreshLo; // low threshold 14 | Uint8 ThreshHi; // high threshold 15 | } PcData; 16 | 17 | // Functions defined in AvxPackedIntegerPixelClip.cpp 18 | bool AvxPiPixelClipCpp(PcData* pc_data); 19 | 20 | // Functions defined in AvxPackedIntegerPixelClip_.asm 21 | extern "C" bool AvxPiPixelClip_(PcData* pc_data); 22 | 23 | // Functions defined in AvxPackedIntegerPixelClipTimed.cpp 24 | void AvxPackedIntegerPixelClipTimed(void); 25 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter15/AvxPackedIntegerPixelClip/AvxPackedIntegerPixelClip/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // AvxPackedIntegerPixelClip.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter15/AvxPackedIntegerPixelClip/AvxPackedIntegerPixelClip/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter15/AvxPackedIntegerPixelClip/AvxPackedIntegerPixelClip/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter15/AvxPackedIntegerThreshold/AvxPackedIntegerThreshold/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // AvxPackedIntegerThreshold.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter15/AvxPackedIntegerThreshold/AvxPackedIntegerThreshold/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter15/AvxPackedIntegerThreshold/AvxPackedIntegerThreshold/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter15/AvxPackedIntegerUnpack/AvxPackedIntegerUnpack/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // AvxPackedIntegerUnpack.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter15/AvxPackedIntegerUnpack/AvxPackedIntegerUnpack/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter15/AvxPackedIntegerUnpack/AvxPackedIntegerUnpack/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter16/AvxBlend/AvxBlend.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.30501.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AvxBlend", "AvxBlend\AvxBlend.vcxproj", "{2060D6A8-1A9C-4B68-864C-1B417FBE9F96}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Release|Win32 = Release|Win32 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {2060D6A8-1A9C-4B68-864C-1B417FBE9F96}.Debug|Win32.ActiveCfg = Debug|Win32 15 | {2060D6A8-1A9C-4B68-864C-1B417FBE9F96}.Debug|Win32.Build.0 = Debug|Win32 16 | {2060D6A8-1A9C-4B68-864C-1B417FBE9F96}.Release|Win32.ActiveCfg = Release|Win32 17 | {2060D6A8-1A9C-4B68-864C-1B417FBE9F96}.Release|Win32.Build.0 = Release|Win32 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter16/AvxBlend/AvxBlend/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // AvxBlend.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter16/AvxBlend/AvxBlend/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter16/AvxBlend/AvxBlend/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter16/AvxBroadcast/AvxBroadcast.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.30501.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AvxBroadcast", "AvxBroadcast\AvxBroadcast.vcxproj", "{DAC56A19-D344-4B0E-9194-91E2765EDAE1}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Release|Win32 = Release|Win32 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {DAC56A19-D344-4B0E-9194-91E2765EDAE1}.Debug|Win32.ActiveCfg = Debug|Win32 15 | {DAC56A19-D344-4B0E-9194-91E2765EDAE1}.Debug|Win32.Build.0 = Debug|Win32 16 | {DAC56A19-D344-4B0E-9194-91E2765EDAE1}.Release|Win32.ActiveCfg = Release|Win32 17 | {DAC56A19-D344-4B0E-9194-91E2765EDAE1}.Release|Win32.Build.0 = Release|Win32 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter16/AvxBroadcast/AvxBroadcast/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // AvxBroadcast.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter16/AvxBroadcast/AvxBroadcast/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter16/AvxBroadcast/AvxBroadcast/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter16/AvxCpuid/AvxCpuid.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.30501.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AvxCpuid", "AvxCpuid\AvxCpuid.vcxproj", "{FB18A72D-9CF3-44BE-8FA1-2B91401E14E8}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Release|Win32 = Release|Win32 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {FB18A72D-9CF3-44BE-8FA1-2B91401E14E8}.Debug|Win32.ActiveCfg = Debug|Win32 15 | {FB18A72D-9CF3-44BE-8FA1-2B91401E14E8}.Debug|Win32.Build.0 = Debug|Win32 16 | {FB18A72D-9CF3-44BE-8FA1-2B91401E14E8}.Release|Win32.ActiveCfg = Release|Win32 17 | {FB18A72D-9CF3-44BE-8FA1-2B91401E14E8}.Release|Win32.Build.0 = Release|Win32 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter16/AvxCpuid/AvxCpuid/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // AvxCpuid.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter16/AvxCpuid/AvxCpuid/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter16/AvxCpuid/AvxCpuid/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter16/AvxFma/AvxFma.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.30501.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AvxFma", "AvxFma\AvxFma.vcxproj", "{9920CBF2-93EB-422A-AFC3-9D61A70C6DBC}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Release|Win32 = Release|Win32 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {9920CBF2-93EB-422A-AFC3-9D61A70C6DBC}.Debug|Win32.ActiveCfg = Debug|Win32 15 | {9920CBF2-93EB-422A-AFC3-9D61A70C6DBC}.Debug|Win32.Build.0 = Debug|Win32 16 | {9920CBF2-93EB-422A-AFC3-9D61A70C6DBC}.Release|Win32.ActiveCfg = Release|Win32 17 | {9920CBF2-93EB-422A-AFC3-9D61A70C6DBC}.Release|Win32.Build.0 = Release|Win32 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter16/AvxFma/AvxFma/AvxFma.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "MiscDefs.h" 3 | 4 | // These functions are defined in AvxFma.cpp 5 | extern void AvxFmaSmooth5Cpp(float* y, const float*x, Uint32 n, const float* sm5_mask); 6 | extern bool AvxFmaInitX(float* x, Uint32 n); 7 | 8 | // These functions are defined in AvxFma_.asm 9 | extern "C" void AvxFmaSmooth5a_(float* y, const float*x, Uint32 n, const float* sm5_mask); 10 | extern "C" void AvxFmaSmooth5b_(float* y, const float*x, Uint32 n, const float* sm5_mask); 11 | extern "C" void AvxFmaSmooth5c_(float* y, const float*x, Uint32 n, const float* sm5_mask); 12 | 13 | // These functions are defined in AvxFmaTimed.cpp 14 | extern void AvxFmaTimed(void); 15 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter16/AvxFma/AvxFma/AvxFma.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter16/AvxFma/AvxFma/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // AvxFma.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter16/AvxFma/AvxFma/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter16/AvxFma/AvxFma/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter16/AvxGather/AvxGather.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.30501.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AvxGather", "AvxGather\AvxGather.vcxproj", "{2AA59CBD-6BE4-4D85-A310-1C7B28533C72}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Release|Win32 = Release|Win32 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {2AA59CBD-6BE4-4D85-A310-1C7B28533C72}.Debug|Win32.ActiveCfg = Debug|Win32 15 | {2AA59CBD-6BE4-4D85-A310-1C7B28533C72}.Debug|Win32.Build.0 = Debug|Win32 16 | {2AA59CBD-6BE4-4D85-A310-1C7B28533C72}.Release|Win32.ActiveCfg = Release|Win32 17 | {2AA59CBD-6BE4-4D85-A310-1C7B28533C72}.Release|Win32.Build.0 = Release|Win32 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter16/AvxGather/AvxGather/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // AvxGather.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter16/AvxGather/AvxGather/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter16/AvxGather/AvxGather/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter16/AvxGprBitManip/AvxGprBitManip/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // AvxGprBitManip.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter16/AvxGprBitManip/AvxGprBitManip/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter16/AvxGprBitManip/AvxGprBitManip/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter16/AvxGprMulxShiftx/AvxGprMulxShiftx/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // AvxGprMulxShiftx.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter16/AvxGprMulxShiftx/AvxGprMulxShiftx/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter16/AvxGprMulxShiftx/AvxGprMulxShiftx/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter16/AvxPermute/AvxPermute.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.30501.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AvxPermute", "AvxPermute\AvxPermute.vcxproj", "{C2019156-3D05-4832-9695-6DAAEB0CFB25}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Release|Win32 = Release|Win32 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {C2019156-3D05-4832-9695-6DAAEB0CFB25}.Debug|Win32.ActiveCfg = Debug|Win32 15 | {C2019156-3D05-4832-9695-6DAAEB0CFB25}.Debug|Win32.Build.0 = Debug|Win32 16 | {C2019156-3D05-4832-9695-6DAAEB0CFB25}.Release|Win32.ActiveCfg = Release|Win32 17 | {C2019156-3D05-4832-9695-6DAAEB0CFB25}.Release|Win32.Build.0 = Release|Win32 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter16/AvxPermute/AvxPermute/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // AvxPermute.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter16/AvxPermute/AvxPermute/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter16/AvxPermute/AvxPermute/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter18/CallingConvention1/CallingConvention1/CallingConvention1.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "MiscDefs.h" 3 | 4 | extern "C" Int64 Cc1_(Int8 a, Int16 b, Int32 c, Int64 d, Int8 e, Int16 f, Int32 g, Int64 h); 5 | 6 | int _tmain(int argc, _TCHAR* argv[]) 7 | { 8 | Int8 a = 10, e = -20; 9 | Int16 b = -200, f = 400; 10 | Int32 c = 300, g = -600; 11 | Int64 d = 4000, h = -8000; 12 | 13 | Int64 x = Cc1_(a, b, c, d, e, f, g, h); 14 | 15 | printf("\nResults for CallingConvention1\n"); 16 | printf(" a, b, c, d: %8d %8d %8d %8lld\n", a, b, c, d); 17 | printf(" e, f, g, h: %8d %8d %8d %8lld\n", e, f, g, h); 18 | printf(" x: %8lld\n", x); 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter18/CallingConvention1/CallingConvention1/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // CallingConvention1.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter18/CallingConvention1/CallingConvention1/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter18/CallingConvention1/CallingConvention1/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter18/CallingConvention2/CallingConvention2/CallingConvention2.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "MiscDefs.h" 3 | 4 | extern "C" bool Cc2_(const Int64* a, const Int64* b, Int32 n, Int64 * sum_a, Int64* sum_b, Int64* prod_a, Int64* prod_b); 5 | 6 | int _tmain(int argc, _TCHAR* argv[]) 7 | { 8 | const __int32 n = 6; 9 | Int64 a[n] = { 2, -2, -6, 7, 12, 5 }; 10 | Int64 b[n] = { 3, 5, -7, 8, 4, 9 }; 11 | Int64 sum_a, sum_b; 12 | Int64 prod_a, prod_b; 13 | 14 | printf("\nResults for CallingConvention2\n"); 15 | bool rc = Cc2_(a, b, n, &sum_a, &sum_b, &prod_a, &prod_b); 16 | 17 | if (!rc) 18 | printf("Invalid return code from Cc2_()\n"); 19 | else 20 | { 21 | for (int i = 0; i < n; i++) 22 | printf("%7lld %7lld\n", a[i], b[i]); 23 | 24 | printf("\n"); 25 | printf("sum_a: %7lld sum_b: %7lld\n", sum_a, sum_b); 26 | printf("prod_a: %7lld prod_b: %7lld\n", prod_a, prod_b); 27 | } 28 | 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter18/CallingConvention2/CallingConvention2/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // CallingConvention2.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter18/CallingConvention2/CallingConvention2/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter18/CallingConvention2/CallingConvention2/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter18/CallingConvention3/CallingConvention3/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // CallingConvention3.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter18/CallingConvention3/CallingConvention3/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter18/CallingConvention3/CallingConvention3/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter18/CallingConvention4/CallingConvention4/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // CallingConvention4.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter18/CallingConvention4/CallingConvention4/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter18/CallingConvention4/CallingConvention4/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter18/ConcatStrings/ConcatStrings.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.30501.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ConcatStrings", "ConcatStrings\ConcatStrings.vcxproj", "{0971E724-1A49-4263-89EE-E62DC6AA1355}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Release|x64 = Release|x64 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {0971E724-1A49-4263-89EE-E62DC6AA1355}.Debug|x64.ActiveCfg = Debug|x64 15 | {0971E724-1A49-4263-89EE-E62DC6AA1355}.Debug|x64.Build.0 = Debug|x64 16 | {0971E724-1A49-4263-89EE-E62DC6AA1355}.Release|x64.ActiveCfg = Release|x64 17 | {0971E724-1A49-4263-89EE-E62DC6AA1355}.Release|x64.Build.0 = Release|x64 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter18/ConcatStrings/ConcatStrings/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // ConcatStrings.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter18/ConcatStrings/ConcatStrings/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter18/ConcatStrings/ConcatStrings/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter18/FloatingPointArithmetic/FloatingPointArithmetic/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // FloatingPointArithmetic.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter18/FloatingPointArithmetic/FloatingPointArithmetic/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter18/FloatingPointArithmetic/FloatingPointArithmetic/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter18/IntegerArithmetic/IntegerArithmetic.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.30501.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IntegerArithmetic", "IntegerArithmetic\IntegerArithmetic.vcxproj", "{3FFC7E05-781B-4424-BE06-F6A5FDAC0FFE}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Release|x64 = Release|x64 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {3FFC7E05-781B-4424-BE06-F6A5FDAC0FFE}.Debug|x64.ActiveCfg = Debug|x64 15 | {3FFC7E05-781B-4424-BE06-F6A5FDAC0FFE}.Debug|x64.Build.0 = Debug|x64 16 | {3FFC7E05-781B-4424-BE06-F6A5FDAC0FFE}.Release|x64.ActiveCfg = Release|x64 17 | {3FFC7E05-781B-4424-BE06-F6A5FDAC0FFE}.Release|x64.Build.0 = Release|x64 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter18/IntegerArithmetic/IntegerArithmetic/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // IntegerArithmetic.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter18/IntegerArithmetic/IntegerArithmetic/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter18/IntegerArithmetic/IntegerArithmetic/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter18/IntegerOperands/IntegerOperands.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.30501.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IntegerOperands", "IntegerOperands\IntegerOperands.vcxproj", "{F6DC6D6D-C7B1-4ACC-AD9F-A98C1156C469}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Release|x64 = Release|x64 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {F6DC6D6D-C7B1-4ACC-AD9F-A98C1156C469}.Debug|x64.ActiveCfg = Debug|x64 15 | {F6DC6D6D-C7B1-4ACC-AD9F-A98C1156C469}.Debug|x64.Build.0 = Debug|x64 16 | {F6DC6D6D-C7B1-4ACC-AD9F-A98C1156C469}.Release|x64.ActiveCfg = Release|x64 17 | {F6DC6D6D-C7B1-4ACC-AD9F-A98C1156C469}.Release|x64.Build.0 = Release|x64 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter18/IntegerOperands/IntegerOperands/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // IntegerOperands.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter18/IntegerOperands/IntegerOperands/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter18/IntegerOperands/IntegerOperands/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter18/MatrixMul/MatrixMul.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.30501.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MatrixMul", "MatrixMul\MatrixMul.vcxproj", "{3AFE115E-E161-485E-8BFA-FDB089D6016A}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Release|x64 = Release|x64 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {3AFE115E-E161-485E-8BFA-FDB089D6016A}.Debug|x64.ActiveCfg = Debug|x64 15 | {3AFE115E-E161-485E-8BFA-FDB089D6016A}.Debug|x64.Build.0 = Debug|x64 16 | {3AFE115E-E161-485E-8BFA-FDB089D6016A}.Release|x64.ActiveCfg = Release|x64 17 | {3AFE115E-E161-485E-8BFA-FDB089D6016A}.Release|x64.Build.0 = Release|x64 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter18/MatrixMul/MatrixMul/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // MatrixMul.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter18/MatrixMul/MatrixMul/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter18/MatrixMul/MatrixMul/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter18/MemoryAddressing/MemoryAddressing.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.30501.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MemoryAddressing", "MemoryAddressing\MemoryAddressing.vcxproj", "{15AF2816-8843-4845-8A72-01F6524E772E}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Release|x64 = Release|x64 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {15AF2816-8843-4845-8A72-01F6524E772E}.Debug|x64.ActiveCfg = Debug|x64 15 | {15AF2816-8843-4845-8A72-01F6524E772E}.Debug|x64.Build.0 = Debug|x64 16 | {15AF2816-8843-4845-8A72-01F6524E772E}.Release|x64.ActiveCfg = Release|x64 17 | {15AF2816-8843-4845-8A72-01F6524E772E}.Release|x64.Build.0 = Release|x64 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter18/MemoryAddressing/MemoryAddressing/MemoryAddressing.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | 3 | extern "C" int NumFibVals_, FibValsSum_; 4 | extern "C" int MemoryAddressing_(int i, int* v1, int* v2, int* v3, int* v4); 5 | 6 | int _tmain(int argc, _TCHAR* argv[]) 7 | { 8 | FibValsSum_ = 0; 9 | 10 | for (int i = -1; i < NumFibVals_ + 1; i++) 11 | { 12 | int v1 = -1, v2 = -1, v3 = -1, v4 = -1; 13 | int rc = MemoryAddressing_(i, &v1, &v2, &v3, &v4); 14 | 15 | printf("i: %2d rc: %2d - ", i, rc); 16 | printf("v1: %5d v2: %5d v3: %5d v4: %5d\n", v1, v2, v3, v4); 17 | } 18 | 19 | printf("FibValsSum_: %d\n", FibValsSum_); 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter18/MemoryAddressing/MemoryAddressing/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // MemoryAddressing.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter18/MemoryAddressing/MemoryAddressing/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter18/MemoryAddressing/MemoryAddressing/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter20/Avx64CalcEllipsoid/Avx64CalcEllipsoid/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // Avx64CalcEllipsoid.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter20/Avx64CalcEllipsoid/Avx64CalcEllipsoid/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter20/Avx64CalcEllipsoid/Avx64CalcEllipsoid/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter20/Avx64CalcMat4x4Inv/Avx64CalcMat4x4Inv/Avx64CalcMat4x4Inv.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Mat4x4.h" 3 | 4 | #ifdef _DEBUG 5 | extern void Avx64CalcMat4x4InvTest(void); 6 | #endif 7 | 8 | extern bool Mat4x4InvCpp(Mat4x4 m_inv, Mat4x4 m, float epsilon, bool* is_singular); 9 | extern "C" bool Mat4x4Inv_(Mat4x4 m_inv, Mat4x4 m, float epsilon, bool* is_singular); 10 | extern void Avx64CalcMat4x4InvTimed(void); 11 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter20/Avx64CalcMat4x4Inv/Avx64CalcMat4x4Inv/Avx64CalcMat4x4Inv.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter20/Avx64CalcMat4x4Inv/Avx64CalcMat4x4Inv/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // Avx64CalcMat4x4Inv.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter20/Avx64CalcMat4x4Inv/Avx64CalcMat4x4Inv/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter20/Avx64CalcMat4x4Inv/Avx64CalcMat4x4Inv/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter20/Avx64CalcRgbMinMax/Avx64CalcRgbMinMax/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // Avx64CalcRgbMinMax.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter20/Avx64CalcRgbMinMax/Avx64CalcRgbMinMax/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter20/Avx64CalcRgbMinMax/Avx64CalcRgbMinMax/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter20/Avx64MiscInstructions/Avx64MiscInstructions/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // Avx64MiscInstructions.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter20/Avx64MiscInstructions/Avx64MiscInstructions/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter20/Avx64MiscInstructions/Avx64MiscInstructions/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter20/DataFiles/TestImage1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/modern-x86-assembly-language-programming/df426d69543a7f66c48bff9f21e2291cc6e1d514/978-1-4842-0065-0_SourceCode/Chapter20/DataFiles/TestImage1.bmp -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter20/DataFiles/TestImage2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/modern-x86-assembly-language-programming/df426d69543a7f66c48bff9f21e2291cc6e1d514/978-1-4842-0065-0_SourceCode/Chapter20/DataFiles/TestImage2.bmp -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter20/DataFiles/TestImage3.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/modern-x86-assembly-language-programming/df426d69543a7f66c48bff9f21e2291cc6e1d514/978-1-4842-0065-0_SourceCode/Chapter20/DataFiles/TestImage3.bmp -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter20/Sse64ImageConvert/Sse64ImageConvert.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.30501.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Sse64ImageConvert", "Sse64ImageConvert\Sse64ImageConvert.vcxproj", "{1BC29D44-2E47-4056-B0E3-3FF66F1FE660}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Release|x64 = Release|x64 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {1BC29D44-2E47-4056-B0E3-3FF66F1FE660}.Debug|x64.ActiveCfg = Debug|x64 15 | {1BC29D44-2E47-4056-B0E3-3FF66F1FE660}.Debug|x64.Build.0 = Debug|x64 16 | {1BC29D44-2E47-4056-B0E3-3FF66F1FE660}.Release|x64.ActiveCfg = Release|x64 17 | {1BC29D44-2E47-4056-B0E3-3FF66F1FE660}.Release|x64.Build.0 = Release|x64 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter20/Sse64ImageConvert/Sse64ImageConvert/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // Sse64ImageConvert.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter20/Sse64ImageConvert/Sse64ImageConvert/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter20/Sse64ImageConvert/Sse64ImageConvert/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter20/Sse64ImageHistogram/Sse64ImageHistogram/Sse64ImageHistogram.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ImageBuffer.h" 4 | 5 | // Functions defined in Sse64ImageHistogram.cpp 6 | extern bool Sse64ImageHistogramCpp(Uint32* histo, const Uint8* pixel_buff, Uint32 num_pixels); 7 | 8 | // Functions defined in Sse64ImageHistogram_.asm 9 | extern "C" bool Sse64ImageHistogram_(Uint32* histo, const Uint8* pixel_buff, Uint32 num_pixels); 10 | 11 | // Functions defined in Sse64ImageHistogramTimed.cpp 12 | extern void Sse64ImageHistogramTimed(void); 13 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter20/Sse64ImageHistogram/Sse64ImageHistogram/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // Sse64ImageHistogram.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter20/Sse64ImageHistogram/Sse64ImageHistogram/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter20/Sse64ImageHistogram/Sse64ImageHistogram/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter20/Sse64VectorArrays/Sse64VectorArrays.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.30501.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Sse64VectorArrays", "Sse64VectorArrays\Sse64VectorArrays.vcxproj", "{47BAB517-E4DD-4FB7-AF76-074983BEAD42}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Release|x64 = Release|x64 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {47BAB517-E4DD-4FB7-AF76-074983BEAD42}.Debug|x64.ActiveCfg = Debug|x64 15 | {47BAB517-E4DD-4FB7-AF76-074983BEAD42}.Debug|x64.Build.0 = Debug|x64 16 | {47BAB517-E4DD-4FB7-AF76-074983BEAD42}.Release|x64.ActiveCfg = Release|x64 17 | {47BAB517-E4DD-4FB7-AF76-074983BEAD42}.Release|x64.Build.0 = Release|x64 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter20/Sse64VectorArrays/Sse64VectorArrays/Sse64VectorArrays.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "MiscDefs.h" 3 | 4 | // Simple vector structure 5 | typedef struct 6 | { 7 | float X; // Vector X component 8 | float Y; // Vector Y component 9 | float Z; // Vector Z component 10 | float Pad; // Pad for 16 byte structure size 11 | } Vector; 12 | 13 | // Vector structure of arrays 14 | typedef struct 15 | { 16 | float* X; // Pointer to X components 17 | float* Y; // Pointer to Y copmonents 18 | float* Z; // Pointer to Z components 19 | } VectorSoA; 20 | 21 | extern void Sse64VectorCrossProdTimed(void); 22 | extern "C" bool Sse64VectorCrossProd1_(Vector* c, const Vector* a, const Vector* b, Uint32 num_vectors); 23 | extern "C" bool Sse64VectorCrossProd2_(VectorSoA* c, const VectorSoA* a, const VectorSoA* b, Uint32 num_vectors); 24 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter20/Sse64VectorArrays/Sse64VectorArrays/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // Sse64VectorArrays.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter20/Sse64VectorArrays/Sse64VectorArrays/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter20/Sse64VectorArrays/Sse64VectorArrays/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter22/LinkedListPrefetch/LinkedListPrefetch/LinkedListPrefetch.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "MiscDefs.h" 3 | 4 | // This structure must match the corresponding structure definition 5 | // in LinkedListPrefetch.inc. 6 | typedef struct llnode 7 | { 8 | double ValA[4]; 9 | double ValB[4]; 10 | double ValC[4]; 11 | double ValD[4]; 12 | Uint8 FreeSpace[376]; 13 | 14 | llnode* Link; 15 | 16 | #ifndef _WIN64 17 | Uint8 Pad[4]; 18 | #endif 19 | 20 | } LlNode; 21 | 22 | extern void LlTraverseCpp(LlNode* p); 23 | extern LlNode* LlCreate(int num_nodes); 24 | extern bool LlCompare(int num_nodes, LlNode* l1, LlNode* l2, LlNode* l3, int* node_fail); 25 | 26 | extern "C" void LlTraverseA_(LlNode* p); 27 | extern "C" void LlTraverseB_(LlNode* p); 28 | 29 | extern void LinkedListPrefetchTimed(void); 30 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter22/LinkedListPrefetch/LinkedListPrefetch/LinkedListPrefetch.inc: -------------------------------------------------------------------------------- 1 | ; This structure must match the corresponding structure definition 2 | ; in LinkedListPrefetch.h 3 | 4 | LlNode struct 5 | ValA real8 4 dup(?) 6 | ValB real8 4 dup(?) 7 | ValC real8 4 dup(?) 8 | ValD real8 4 dup(?) 9 | FreeSpace byte 376 dup(?) 10 | 11 | IFDEF ASMX86_32 12 | Link dword ? 13 | Pad byte 4 dup(?) 14 | ENDIF 15 | 16 | IFDEF ASMX86_64 17 | Link qword ? 18 | ENDIF 19 | 20 | LlNode ends 21 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter22/LinkedListPrefetch/LinkedListPrefetch/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // LinkedListPrefetch.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter22/LinkedListPrefetch/LinkedListPrefetch/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter22/LinkedListPrefetch/LinkedListPrefetch/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter22/NonTemporalStore/NonTemporalStore/NonTemporalStore.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Declarations for functions in NonTemporalStore.cpp 4 | extern bool CompareResults(const float* c1, const float* c2a, const float*c2b, int n, bool pf); 5 | extern bool CalcResultCpp(float* c, const float* a, const float* b, int n); 6 | 7 | // Declarations for functions in NonTemporalStore32_.asm 8 | // and NonTemporalStore64_.asm 9 | extern "C" bool CalcResultA_(float* c, const float* a, const float* b, int n); 10 | extern "C" bool CalcResultB_(float* c, const float* a, const float* b, int n); 11 | 12 | // Declarations for functions in NonTemporalStoreTimed.cpp 13 | extern void NonTemporalStoreTimed(void); 14 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter22/NonTemporalStore/NonTemporalStore/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // NonTemporalStore.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter22/NonTemporalStore/NonTemporalStore/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Chapter22/NonTemporalStore/NonTemporalStore/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/CommonFiles/Mat4x4.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | typedef float Mat4x4[4][4]; 4 | typedef float Vec4x1[4]; 5 | 6 | extern void Mat4x4Add(Mat4x4 des, Mat4x4 src1, Mat4x4 src2); 7 | extern void Mat4x4Copy(Mat4x4 des, Mat4x4 src); 8 | extern void Mat4x4Mul(Mat4x4 des, Mat4x4 src1, Mat4x4 src2); 9 | extern void Mat4x4MulScalar(Mat4x4 des, Mat4x4 src, float s); 10 | extern void Mat4x4MulVec(Vec4x1 des, Mat4x4 src1, Vec4x1 src2); 11 | extern void Mat4x4Printf(Mat4x4 m, const char* s); 12 | extern void Mat4x4SetI(Mat4x4 m); 13 | extern float Mat4x4Trace(Mat4x4 m); 14 | extern void Mat4x4Transpose(Mat4x4 des, Mat4x4 src); 15 | extern void Vec4x1Printf(Vec4x1 v, const char* s); 16 | 17 | inline void Mat4x4SetRow(Mat4x4 m, int row, float a0, float a1, float a2, float a3) 18 | { 19 | m[row][0] = a0; 20 | m[row][1] = a1; 21 | m[row][2] = a2; 22 | m[row][3] = a3; 23 | } 24 | 25 | inline void Vec4x1Set(Vec4x1 v, float a0, float a1, float a2, float a3) 26 | { 27 | v[0] = a0; 28 | v[1] = a1; 29 | v[2] = a2; 30 | v[3] = a3; 31 | } 32 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/CommonFiles/MiscDefs.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Signed integer typdefs 4 | typedef __int8 Int8; 5 | typedef __int16 Int16; 6 | typedef __int32 Int32; 7 | typedef __int64 Int64; 8 | 9 | // Unsigned integer typdefs 10 | typedef unsigned __int8 Uint8; 11 | typedef unsigned __int16 Uint16; 12 | typedef unsigned __int32 Uint32; 13 | typedef unsigned __int64 Uint64; 14 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/CommonFiles/MmxVal.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "MiscDefs.h" 4 | 5 | union MmxVal 6 | { 7 | Int8 i8[8]; 8 | Int16 i16[4]; 9 | Int32 i32[2]; 10 | Int64 i64; 11 | Uint8 u8[8]; 12 | Uint16 u16[4]; 13 | Uint32 u32[2]; 14 | Uint64 u64; 15 | 16 | char* ToString_i8(char* s, size_t len); 17 | char* ToString_i16(char* s, size_t len); 18 | char* ToString_i32(char* s, size_t len); 19 | char* ToString_i64(char* s, size_t len); 20 | 21 | char* ToString_u8(char* s, size_t len); 22 | char* ToString_u16(char* s, size_t len); 23 | char* ToString_u32(char* s, size_t len); 24 | char* ToString_u64(char* s, size_t len); 25 | 26 | char* ToString_x8(char* s, size_t len); 27 | char* ToString_x16(char* s, size_t len); 28 | char* ToString_x32(char* s, size_t len); 29 | char* ToString_x64(char* s, size_t len); 30 | }; 31 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/CommonFiles/XmmVal.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "MiscDefs.h" 4 | 5 | union XmmVal 6 | { 7 | Int8 i8[16]; 8 | Int16 i16[8]; 9 | Int32 i32[4]; 10 | Int64 i64[2]; 11 | Uint8 u8[16]; 12 | Uint16 u16[8]; 13 | Uint32 u32[4]; 14 | Uint64 u64[2]; 15 | float r32[4]; 16 | double r64[2]; 17 | 18 | char* ToString_i8(char* s, size_t len); 19 | char* ToString_i16(char* s, size_t len); 20 | char* ToString_i32(char* s, size_t len); 21 | char* ToString_i64(char* s, size_t len); 22 | 23 | char* ToString_u8(char* s, size_t len); 24 | char* ToString_u16(char* s, size_t len); 25 | char* ToString_u32(char* s, size_t len); 26 | char* ToString_u64(char* s, size_t len); 27 | 28 | char* ToString_x8(char* s, size_t len); 29 | char* ToString_x16(char* s, size_t len); 30 | char* ToString_x32(char* s, size_t len); 31 | char* ToString_x64(char* s, size_t len); 32 | 33 | char* ToString_r32(char* s, size_t len); 34 | char* ToString_r64(char* s, size_t len); 35 | }; 36 | -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/DataFiles/TestImage1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/modern-x86-assembly-language-programming/df426d69543a7f66c48bff9f21e2291cc6e1d514/978-1-4842-0065-0_SourceCode/DataFiles/TestImage1.bmp -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/DataFiles/TestImage2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/modern-x86-assembly-language-programming/df426d69543a7f66c48bff9f21e2291cc6e1d514/978-1-4842-0065-0_SourceCode/DataFiles/TestImage2.bmp -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/DataFiles/TestImage3.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/modern-x86-assembly-language-programming/df426d69543a7f66c48bff9f21e2291cc6e1d514/978-1-4842-0065-0_SourceCode/DataFiles/TestImage3.bmp -------------------------------------------------------------------------------- /978-1-4842-0065-0_SourceCode/Release Notes.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/modern-x86-assembly-language-programming/df426d69543a7f66c48bff9f21e2291cc6e1d514/978-1-4842-0065-0_SourceCode/Release Notes.pdf -------------------------------------------------------------------------------- /9781484200650.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/modern-x86-assembly-language-programming/df426d69543a7f66c48bff9f21e2291cc6e1d514/9781484200650.jpg -------------------------------------------------------------------------------- /9781484200650_AppA.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/modern-x86-assembly-language-programming/df426d69543a7f66c48bff9f21e2291cc6e1d514/9781484200650_AppA.pdf -------------------------------------------------------------------------------- /9781484200650_AppB.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/modern-x86-assembly-language-programming/df426d69543a7f66c48bff9f21e2291cc6e1d514/9781484200650_AppB.pdf -------------------------------------------------------------------------------- /9781484200650_AppC.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/modern-x86-assembly-language-programming/df426d69543a7f66c48bff9f21e2291cc6e1d514/9781484200650_AppC.pdf -------------------------------------------------------------------------------- /Errata - Kusswurm.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/modern-x86-assembly-language-programming/df426d69543a7f66c48bff9f21e2291cc6e1d514/Errata - Kusswurm.pdf -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/modern-x86-assembly-language-programming/df426d69543a7f66c48bff9f21e2291cc6e1d514/LICENSE.txt -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Apress Source Code 2 | 3 | This repository accompanies [*Modern X86 Assembly Language Programming*](http://www.apress.com/9781484200650) by Daniel Kusswurm (Apress, 2014). 4 | 5 | ![Cover image](9781484200650.jpg) 6 | 7 | Download the files as a zip using the green button, or clone the repository to your machine using Git. 8 | 9 | ## Releases 10 | 11 | Release v1.0 corresponds to the code in the published book, without corrections or updates. 12 | 13 | ## Contributions 14 | 15 | See the file Contributing.md for more information on how you can contribute to this repository. 16 | -------------------------------------------------------------------------------- /contributing.md: -------------------------------------------------------------------------------- 1 | # Contributing to Apress Source Code 2 | 3 | Copyright for Apress source code belongs to the author(s). However, under fair use you are encouraged to fork and contribute minor corrections and updates for the benefit of the author(s) and other readers. 4 | 5 | ## How to Contribute 6 | 7 | 1. Make sure you have a GitHub account. 8 | 2. Fork the repository for the relevant book. 9 | 3. Create a new branch on which to make your change, e.g. 10 | `git checkout -b my_code_contribution` 11 | 4. Commit your change. Include a commit message describing the correction. Please note that if your commit message is not clear, the correction will not be accepted. 12 | 5. Submit a pull request. 13 | 14 | Thank you for your contribution! --------------------------------------------------------------------------------