diff options
Diffstat (limited to 'libvpx/build')
-rw-r--r-- | libvpx/build/arm-msvs/obj_int_extract.bat | 8 | ||||
-rw-r--r-- | libvpx/build/make/Android.mk | 6 | ||||
-rw-r--r-- | libvpx/build/make/Makefile | 14 | ||||
-rwxr-xr-x | libvpx/build/make/ads2armasm_ms.pl | 3 | ||||
-rwxr-xr-x | libvpx/build/make/ads2gas.pl | 2 | ||||
-rwxr-xr-x | libvpx/build/make/ads2gas_apple.pl | 37 | ||||
-rwxr-xr-x | libvpx/build/make/configure.sh | 104 | ||||
-rwxr-xr-x | libvpx/build/make/gen_msvs_proj.sh | 12 | ||||
-rwxr-xr-x | libvpx/build/make/gen_msvs_sln.sh | 7 | ||||
-rwxr-xr-x | libvpx/build/make/gen_msvs_vcxproj.sh | 60 | ||||
-rw-r--r-- | libvpx/build/make/obj_int_extract.c | 24 | ||||
-rwxr-xr-x | libvpx/build/make/rtcd.pl | 414 | ||||
-rwxr-xr-x | libvpx/build/make/rtcd.sh | 363 | ||||
-rw-r--r-- | libvpx/build/make/thumb.pm | 6 | ||||
-rw-r--r-- | libvpx/build/x86-msvs/obj_int_extract.bat | 5 |
15 files changed, 597 insertions, 468 deletions
diff --git a/libvpx/build/arm-msvs/obj_int_extract.bat b/libvpx/build/arm-msvs/obj_int_extract.bat index 7fd16a3..267ed61 100644 --- a/libvpx/build/arm-msvs/obj_int_extract.bat +++ b/libvpx/build/arm-msvs/obj_int_extract.bat @@ -7,8 +7,12 @@ REM in the file PATENTS. All contributing project authors may REM be found in the AUTHORS file in the root of the source tree. echo on +REM Arguments: +REM %1 - Relative path to the directory containing the vp8 and vpx_scale +REM source directories. +REM %2 - Path to obj_int_extract.exe. cl /I "./" /I "%1" /nologo /c /DWINAPI_FAMILY=WINAPI_FAMILY_PHONE_APP "%1/vp8/encoder/vp8_asm_enc_offsets.c" -obj_int_extract.exe rvds "vp8_asm_enc_offsets.obj" > "vp8_asm_enc_offsets.asm" +%2\obj_int_extract.exe rvds "vp8_asm_enc_offsets.obj" > "vp8_asm_enc_offsets.asm" cl /I "./" /I "%1" /nologo /c /DWINAPI_FAMILY=WINAPI_FAMILY_PHONE_APP "%1/vpx_scale/vpx_scale_asm_offsets.c" -obj_int_extract.exe rvds "vpx_scale_asm_offsets.obj" > "vpx_scale_asm_offsets.asm" +%2\obj_int_extract.exe rvds "vpx_scale_asm_offsets.obj" > "vpx_scale_asm_offsets.asm" diff --git a/libvpx/build/make/Android.mk b/libvpx/build/make/Android.mk index 1ff0884..48a0dd7 100644 --- a/libvpx/build/make/Android.mk +++ b/libvpx/build/make/Android.mk @@ -135,10 +135,14 @@ CODEC_SRCS_UNIQUE = $(sort $(CODEC_SRCS)) # Pull out C files. vpx_config.c is in the immediate directory and # so it does not need libvpx/ prefixed like the rest of the source files. +# The neon files with intrinsics need to have .neon appended so the proper +# flags are applied. CODEC_SRCS_C = $(filter %.c, $(CODEC_SRCS_UNIQUE)) -LOCAL_CODEC_SRCS_C = $(filter-out vpx_config.c, $(CODEC_SRCS_C)) +LOCAL_NEON_SRCS_C = $(filter %_neon.c, $(CODEC_SRCS_C)) +LOCAL_CODEC_SRCS_C = $(filter-out vpx_config.c %_neon.c, $(CODEC_SRCS_C)) LOCAL_SRC_FILES += $(foreach file, $(LOCAL_CODEC_SRCS_C), libvpx/$(file)) +LOCAL_SRC_FILES += $(foreach file, $(LOCAL_NEON_SRCS_C), libvpx/$(file).neon) # Pull out assembly files, splitting NEON from the rest. This is # done to specify that the NEON assembly files use NEON assembler flags. diff --git a/libvpx/build/make/Makefile b/libvpx/build/make/Makefile index 030c1b5..dd7fb4a 100644 --- a/libvpx/build/make/Makefile +++ b/libvpx/build/make/Makefile @@ -94,6 +94,16 @@ clean:: rm -f $(OBJS-yes) $(OBJS-yes:.o=.d) $(OBJS-yes:.asm.s.o=.asm.s) rm -f $(CLEAN-OBJS) +.PHONY: clean +distclean: clean + if [ -z "$(target)" ]; then \ + rm -f Makefile; \ + rm -f config.log config.mk; \ + rm -f vpx_config.[hc] vpx_config.asm; \ + else \ + rm -f $(target)-$(TOOLCHAIN).mk; \ + fi + .PHONY: dist dist: .PHONY: install @@ -307,7 +317,7 @@ endef ifneq ($(target),) include $(SRC_PATH_BARE)/$(target:-$(TOOLCHAIN)=).mk endif -ifeq ($(filter clean,$(MAKECMDGOALS)),) +ifeq ($(filter %clean,$(MAKECMDGOALS)),) # Older versions of make don't like -include directives with no arguments ifneq ($(filter %.d,$(OBJS-yes:.o=.d)),) -include $(filter %.d,$(OBJS-yes:.o=.d)) @@ -390,7 +400,7 @@ ifneq ($(call enabled,DIST-SRCS),) DIST-SRCS-$(CONFIG_MSVS) += build/make/gen_msvs_def.sh DIST-SRCS-$(CONFIG_MSVS) += build/make/gen_msvs_proj.sh DIST-SRCS-$(CONFIG_MSVS) += build/make/gen_msvs_sln.sh - DIST-SRCS-$(CONFIG_MSVS) += build/x86-msvs/yasm.rules + DIST-SRCS-$(CONFIG_MSVS) += build/make/gen_msvs_vcxproj.sh DIST-SRCS-$(CONFIG_MSVS) += build/x86-msvs/obj_int_extract.bat DIST-SRCS-$(CONFIG_MSVS) += build/arm-msvs/obj_int_extract.bat DIST-SRCS-$(CONFIG_RVCT) += build/make/armlink_adapter.sh diff --git a/libvpx/build/make/ads2armasm_ms.pl b/libvpx/build/make/ads2armasm_ms.pl index 1def539..2a2c470 100755 --- a/libvpx/build/make/ads2armasm_ms.pl +++ b/libvpx/build/make/ads2armasm_ms.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl ## ## Copyright (c) 2013 The WebM project authors. All Rights Reserved. ## @@ -32,6 +32,7 @@ while (<STDIN>) s/ldrneb/ldrbne/i; s/ldrneh/ldrhne/i; + s/^(\s*)ENDP.*/$&\n$1ALIGN 4/; print; } diff --git a/libvpx/build/make/ads2gas.pl b/libvpx/build/make/ads2gas.pl index 9c41901..7272424 100755 --- a/libvpx/build/make/ads2gas.pl +++ b/libvpx/build/make/ads2gas.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl ## ## Copyright (c) 2010 The WebM project authors. All Rights Reserved. ## diff --git a/libvpx/build/make/ads2gas_apple.pl b/libvpx/build/make/ads2gas_apple.pl index fdafa98..a82f3eb 100755 --- a/libvpx/build/make/ads2gas_apple.pl +++ b/libvpx/build/make/ads2gas_apple.pl @@ -17,6 +17,13 @@ # # Usage: cat inputfile | perl ads2gas_apple.pl > outputfile # + +my $chromium = 0; + +foreach my $arg (@ARGV) { + $chromium = 1 if ($arg eq "-chromium"); +} + print "@ This file was created from a .asm file\n"; print "@ using the ads2gas_apple.pl script.\n\n"; print "\t.set WIDE_REFERENCE, 0\n"; @@ -47,7 +54,7 @@ while (<STDIN>) s/@/,:/g; # Comment character - s/;/@/g; + s/;/ @/g; # Hexadecimal constants prefaced by 0x s/#&/#0x/g; @@ -68,16 +75,16 @@ while (<STDIN>) s/:SHR:/ >> /g; # Convert ELSE to .else - s/ELSE/.else/g; + s/\bELSE\b/.else/g; # Convert ENDIF to .endif - s/ENDIF/.endif/g; + s/\bENDIF\b/.endif/g; # Convert ELSEIF to .elseif - s/ELSEIF/.elseif/g; + s/\bELSEIF\b/.elseif/g; # Convert LTORG to .ltorg - s/LTORG/.ltorg/g; + s/\bLTORG\b/.ltorg/g; # Convert IF :DEF:to .if # gcc doesn't have the ability to do a conditional @@ -157,7 +164,7 @@ while (<STDIN>) s/^([a-zA-Z_0-9\$]+)/$1:/ if !/EQU/; # ALIGN directive - s/ALIGN/.balign/g; + s/\bALIGN\b/.balign/g; # Strip ARM s/\sARM/@ ARM/g; @@ -177,7 +184,7 @@ while (<STDIN>) s/(.*)EQU(.*)/.set $1, $2/; # Begin macro definition - if (/MACRO/) + if (/\bMACRO\b/) { # Process next line down, which will be the macro definition $_ = <STDIN>; @@ -208,7 +215,21 @@ while (<STDIN>) # For macros, use \ to reference formal params # s/\$/\\/g; # End macro definition - s/MEND/.endm/; # No need to tell it where to stop assembling + s/\bMEND\b/.endm/; # No need to tell it where to stop assembling next if /^\s*END\s*$/; + + # Clang used by Chromium differs slightly from clang in XCode in what it + # will accept in the assembly. + if ($chromium) { + s/qsubaddx/qsax/i; + s/qaddsubx/qasx/i; + s/ldrneb/ldrbne/i; + s/ldrneh/ldrhne/i; + s/(vqshrun\.s16 .*, \#)0$/${1}8/i; + + # http://llvm.org/bugs/show_bug.cgi?id=16022 + s/\.include/#include/; + } + print; } diff --git a/libvpx/build/make/configure.sh b/libvpx/build/make/configure.sh index b43a4ec..2fbcfe5 100755 --- a/libvpx/build/make/configure.sh +++ b/libvpx/build/make/configure.sh @@ -41,7 +41,7 @@ log(){ log_file(){ log BEGIN $1 - pr -n -t $1 >>$logfile + cat -n $1 >>$logfile log END $1 } @@ -327,7 +327,7 @@ EOF check_cflags() { log check_cflags "$@" - check_cc "$@" <<EOF + check_cc -Werror "$@" <<EOF int x; EOF } @@ -337,11 +337,11 @@ check_cxxflags() { # Catch CFLAGS that trigger CXX warnings case "$CXX" in - *g++*) check_cxx -Werror "$@" <<EOF + *c++-analyzer|*clang++|*g++*) check_cxx -Werror "$@" <<EOF int x; EOF ;; - *) check_cxx "$@" <<EOF + *) check_cxx -Werror "$@" <<EOF int x; EOF ;; @@ -378,6 +378,19 @@ EOF fi } +# tests for -m$1 toggling the feature given in $2. If $2 is empty $1 is used. +check_gcc_machine_option() { + local opt="$1" + local feature="$2" + [ -n "$feature" ] || feature="$opt" + + if enabled gcc && ! disabled "$feature" && ! check_cflags "-m$opt"; then + RTCD_OPTIONS="${RTCD_OPTIONS}--disable-$feature " + else + soft_enable "$feature" + fi +} + write_common_config_banner() { print_webm_license config.mk "##" "" echo '# This file automatically generated by configure. Do not edit!' >> config.mk @@ -405,8 +418,8 @@ true } write_common_target_config_mk() { - local CC=${CC} - local CXX=${CXX} + local CC="${CC}" + local CXX="${CXX}" enabled ccache && CC="ccache ${CC}" enabled ccache && CXX="ccache ${CXX}" print_webm_license $1 "##" "" @@ -925,41 +938,26 @@ EOF ;; darwin*) - if [ -z "${sdk_path}" ]; then - SDK_PATH=`xcode-select -print-path 2> /dev/null` - SDK_PATH=${SDK_PATH}/Platforms/iPhoneOS.platform/Developer - else - SDK_PATH=${sdk_path} - fi - TOOLCHAIN_PATH=${SDK_PATH}/usr/bin - CXX=${TOOLCHAIN_PATH}/g++ - CC=${TOOLCHAIN_PATH}/gcc - AR=${TOOLCHAIN_PATH}/ar - LD=${TOOLCHAIN_PATH}/arm-apple-darwin10-llvm-gcc-4.2 - AS=${TOOLCHAIN_PATH}/as - STRIP=${TOOLCHAIN_PATH}/strip - NM=${TOOLCHAIN_PATH}/nm + + XCRUN_FIND="xcrun --sdk iphoneos -find" + CXX="$(${XCRUN_FIND} clang++)" + CC="$(${XCRUN_FIND} clang)" + AR="$(${XCRUN_FIND} ar)" + LD="$(${XCRUN_FIND} ld)" + AS="$(${XCRUN_FIND} as)" + STRIP="$(${XCRUN_FIND} strip)" + NM="$(${XCRUN_FIND} nm)" + RANLIB="$(${XCRUN_FIND} ranlib)" AS_SFX=.s # ASFLAGS is written here instead of using check_add_asflags # because we need to overwrite all of ASFLAGS and purge the # options that were put in above - ASFLAGS="-version -arch ${tgt_isa} -g" - - add_cflags -arch ${tgt_isa} - add_ldflags -arch_only ${tgt_isa} - - if [ -z "${alt_libc}" ]; then - alt_libc=${SDK_PATH}/SDKs/iPhoneOS6.0.sdk - fi + ASFLAGS="-arch ${tgt_isa} -g" - add_cflags "-isysroot ${alt_libc}" - - # Add the paths for the alternate libc - for d in usr/include; do - try_dir="${alt_libc}/${d}" - [ -d "${try_dir}" ] && add_cflags -I"${try_dir}" - done + alt_libc="$(xcrun --sdk iphoneos --show-sdk-path)" + add_cflags -arch ${tgt_isa} -isysroot ${alt_libc} + add_ldflags -arch ${tgt_isa} -ios_version_min 7.0 for d in lib usr/lib usr/lib/system; do try_dir="${alt_libc}/${d}" @@ -1093,7 +1091,7 @@ EOF msvs_arch_dir=x86-msvs vc_version=${tgt_cc##vs} case $vc_version in - 7|8|9) + 7|8|9|10) echo "${tgt_cc} does not support avx/avx2, disabling....." RTCD_OPTIONS="${RTCD_OPTIONS}--disable-avx --disable-avx2 " soft_disable avx @@ -1104,30 +1102,16 @@ EOF esac soft_enable runtime_cpu_detect - soft_enable mmx - soft_enable sse - soft_enable sse2 - soft_enable sse3 - soft_enable ssse3 # We can't use 'check_cflags' until the compiler is configured and CC is # populated. - if enabled gcc && ! disabled sse4_1 && ! check_cflags -msse4; then - RTCD_OPTIONS="${RTCD_OPTIONS}--disable-sse4_1 " - else - soft_enable sse4_1 - fi - - if enabled gcc && ! disabled avx && ! check_cflags -mavx; then - RTCD_OPTIONS="${RTCD_OPTIONS}--disable-avx " - else - soft_enable avx - fi - - if enabled gcc && ! disabled avx2 && ! check_cflags -mavx2; then - RTCD_OPTIONS="${RTCD_OPTIONS}--disable-avx2 " - else - soft_enable avx2 - fi + check_gcc_machine_option mmx + check_gcc_machine_option sse + check_gcc_machine_option sse2 + check_gcc_machine_option sse3 + check_gcc_machine_option ssse3 + check_gcc_machine_option sse4 sse4_1 + check_gcc_machine_option avx + check_gcc_machine_option avx2 case "${AS}" in auto|"") @@ -1214,8 +1198,8 @@ EOF fi # default use_x86inc to yes if pic is no or 64bit or we are not on darwin - echo " checking here for x86inc \"${tgt_isa}\" \"$pic\" " - if [ ${tgt_isa} = x86_64 -o ! "$pic" = "yes" -o "${tgt_os#darwin}" = "${tgt_os}" ]; then + if [ ${tgt_isa} = x86_64 -o ! "$pic" = "yes" -o \ + "${tgt_os#darwin}" = "${tgt_os}" ]; then soft_enable use_x86inc fi diff --git a/libvpx/build/make/gen_msvs_proj.sh b/libvpx/build/make/gen_msvs_proj.sh index fc5011b..5936370 100755 --- a/libvpx/build/make/gen_msvs_proj.sh +++ b/libvpx/build/make/gen_msvs_proj.sh @@ -155,8 +155,8 @@ generate_filter() { tag Tool \ Name="VCCustomBuildTool" \ Description="Assembling \$(InputFileName)" \ - CommandLine="$(eval echo \$asm_${cfg}_cmdline) -o \$(IntDir)$objf" \ - Outputs="\$(IntDir)$objf" \ + CommandLine="$(eval echo \$asm_${cfg}_cmdline) -o \$(IntDir)\\$objf" \ + Outputs="\$(IntDir)\\$objf" \ close_tag FileConfiguration done @@ -170,7 +170,7 @@ generate_filter() { tag Tool \ Name="VCCLCompilerTool" \ - ObjectFile="\$(IntDir)$objf" \ + ObjectFile="\$(IntDir)\\$objf" \ close_tag FileConfiguration done @@ -371,7 +371,7 @@ generate_vcproj() { vpx) tag Tool \ Name="VCPreBuildEventTool" \ - CommandLine="call obj_int_extract.bat $src_path_bare" \ + CommandLine="call obj_int_extract.bat $src_path_bare $plat_no_ws\\\$(ConfigurationName)" \ tag Tool \ Name="VCCLCompilerTool" \ @@ -412,7 +412,6 @@ generate_vcproj() { obj_int_extract) tag Tool \ Name="VCLinkerTool" \ - OutputFile="${name}.exe" \ GenerateDebugInformation="true" \ ;; *) @@ -479,7 +478,7 @@ generate_vcproj() { vpx) tag Tool \ Name="VCPreBuildEventTool" \ - CommandLine="call obj_int_extract.bat $src_path_bare" \ + CommandLine="call obj_int_extract.bat $src_path_bare $plat_no_ws\\\$(ConfigurationName)" \ tag Tool \ Name="VCCLCompilerTool" \ @@ -522,7 +521,6 @@ generate_vcproj() { obj_int_extract) tag Tool \ Name="VCLinkerTool" \ - OutputFile="${name}.exe" \ GenerateDebugInformation="true" \ ;; *) diff --git a/libvpx/build/make/gen_msvs_sln.sh b/libvpx/build/make/gen_msvs_sln.sh index 0c269b1..ffa3706 100755 --- a/libvpx/build/make/gen_msvs_sln.sh +++ b/libvpx/build/make/gen_msvs_sln.sh @@ -255,7 +255,7 @@ for opt in "$@"; do ;; --ver=*) vs_ver="$optval" case $optval in - [789]|10|11) + [789]|10|11|12) ;; *) die Unrecognized Visual Studio Version in $opt ;; @@ -297,12 +297,15 @@ case "${vs_ver:-8}" in 11) sln_vers="12.00" sln_vers_str="Visual Studio 2012" ;; + 12) sln_vers="12.00" + sln_vers_str="Visual Studio 2013" + ;; esac case "${vs_ver:-8}" in [789]) sfx=vcproj ;; - 10|11) + 10|11|12) sfx=vcxproj ;; esac diff --git a/libvpx/build/make/gen_msvs_vcxproj.sh b/libvpx/build/make/gen_msvs_vcxproj.sh index 4875915..7c8871b 100755 --- a/libvpx/build/make/gen_msvs_vcxproj.sh +++ b/libvpx/build/make/gen_msvs_vcxproj.sh @@ -28,12 +28,13 @@ Options: --lib Generate a project for creating a static library --dll Generate a project for creating a dll --static-crt Use the static C runtime (/MT) + --enable-werror Treat warnings as errors (/WX) --target=isa-os-cc Target specifier (required) --out=filename Write output to a file [stdout] --name=project_name Name of the project (required) --proj-guid=GUID GUID to use for the project --module-def=filename File containing export definitions (for DLLs) - --ver=version Version (10,11) of visual studio to generate for + --ver=version Version (10,11,12) of visual studio to generate for --src-path-bare=dir Path to root of source tree -Ipath/to/include Additional include directories -DFLAG[=value] Preprocessor macros to define @@ -156,6 +157,10 @@ generate_filter() { objf=$(echo ${f%.*}.obj | sed -e 's/^[\./]\+//g' -e 's,/,_,g') if ([ "$pat" == "asm" ] || [ "$pat" == "s" ]) && $asm_use_custom_step; then + # Avoid object file name collisions, i.e. vpx_config.c and + # vpx_config.asm produce the same object file without + # this additional suffix. + objf=${objf%.obj}_asm.obj open_tag CustomBuild \ Include=".\\$f" for plat in "${platforms[@]}"; do @@ -174,6 +179,10 @@ generate_filter() { Include=".\\$f" # Separate file names with Condition? tag_content ObjectFileName "\$(IntDir)$objf" + # Check for AVX and turn it on to avoid warnings. + if [[ $f =~ avx.?\.c$ ]]; then + tag_content AdditionalOptions "/arch:AVX" + fi close_tag ClCompile elif [ "$pat" == "h" ] ; then tag ClInclude \ @@ -225,10 +234,12 @@ for opt in "$@"; do ;; --static-crt) use_static_runtime=true ;; + --enable-werror) werror=true + ;; --ver=*) vs_ver="$optval" case "$optval" in - 10|11) + 10|11|12) ;; *) die Unrecognized Visual Studio Version in $opt ;; @@ -269,7 +280,7 @@ guid=${guid:-`generate_uuid`} asm_use_custom_step=false uses_asm=${uses_asm:-false} case "${vs_ver:-11}" in - 10|11) + 10|11|12) asm_use_custom_step=$uses_asm ;; esac @@ -383,6 +394,20 @@ generate_vcxproj() { tag_content PlatformToolset v110 fi fi + if [ "$vs_ver" = "12" ]; then + if [ "$plat" = "ARM" ]; then + # Setting the wp80 toolchain automatically sets the + # WINAPI_FAMILY define, which is required for building + # code for arm with the windows headers. Alternatively, + # one could add AppContainerApplication=true in the Globals + # section and add PrecompiledHeader=NotUsing and + # CompileAsWinRT=false in ClCompile and SubSystem=Console + # in Link. + tag_content PlatformToolset v120_wp80 + else + tag_content PlatformToolset v120 + fi + fi tag_content CharacterSet Unicode if [ "$config" = "Release" ]; then tag_content WholeProgramOptimization true @@ -412,6 +437,14 @@ generate_vcxproj() { Condition="'\$(Configuration)|\$(Platform)'=='$config|$plat'" tag_content OutDir "\$(SolutionDir)$plat_no_ws\\\$(Configuration)\\" tag_content IntDir "$plat_no_ws\\\$(Configuration)\\${name}\\" + if [ "$proj_kind" == "lib" ]; then + if [ "$config" == "Debug" ]; then + config_suffix=d + else + config_suffix="" + fi + tag_content TargetName "${name}${lib_sfx}${config_suffix}" + fi close_tag PropertyGroup done done @@ -420,9 +453,13 @@ generate_vcxproj() { for config in Debug Release; do open_tag ItemDefinitionGroup \ Condition="'\$(Configuration)|\$(Platform)'=='$config|$plat'" - if [ "$name" = "vpx" ]; then + if [ "$name" == "vpx" ]; then + hostplat=$plat + if [ "$hostplat" == "ARM" ]; then + hostplat=Win32 + fi open_tag PreBuildEvent - tag_content Command "call obj_int_extract.bat $src_path_bare" + tag_content Command "call obj_int_extract.bat $src_path_bare $hostplat\\\$(Configuration)" close_tag PreBuildEvent fi open_tag ClCompile @@ -430,7 +467,6 @@ generate_vcxproj() { opt=Disabled runtime=$debug_runtime curlibs=$debug_libs - confsuffix=d case "$name" in obj_int_extract) debug=DEBUG @@ -443,7 +479,6 @@ generate_vcxproj() { opt=MaxSpeed runtime=$release_runtime curlibs=$libs - confsuffix="" tag_content FavorSizeOrSpeed Speed debug=NDEBUG fi @@ -460,14 +495,14 @@ generate_vcxproj() { tag_content PreprocessorDefinitions "WIN32;$debug;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE$extradefines;%(PreprocessorDefinitions)" tag_content RuntimeLibrary $runtime tag_content WarningLevel Level3 - # DebugInformationFormat + if ${werror:-false}; then + tag_content TreatWarningAsError true + fi close_tag ClCompile case "$proj_kind" in exe) open_tag Link - if [ "$name" = "obj_int_extract" ]; then - tag_content OutputFile "${name}.exe" - else + if [ "$name" != "obj_int_extract" ]; then tag_content AdditionalDependencies "$curlibs" tag_content AdditionalLibraryDirectories "$libdirs;%(AdditionalLibraryDirectories)" fi @@ -481,9 +516,6 @@ generate_vcxproj() { close_tag Link ;; lib) - open_tag Lib - tag_content OutputFile "\$(OutDir)${name}${lib_sfx}${confsuffix}.lib" - close_tag Lib ;; esac close_tag ItemDefinitionGroup diff --git a/libvpx/build/make/obj_int_extract.c b/libvpx/build/make/obj_int_extract.c index feed9d9..819ce9d 100644 --- a/libvpx/build/make/obj_int_extract.c +++ b/libvpx/build/make/obj_int_extract.c @@ -21,6 +21,7 @@ typedef enum { OUTPUT_FMT_PLAIN, OUTPUT_FMT_RVDS, OUTPUT_FMT_GAS, + OUTPUT_FMT_C_HEADER, } output_fmt_t; int log_msg(const char *fmt, ...) { @@ -43,9 +44,12 @@ int print_macho_equ(output_fmt_t mode, uint8_t* name, int val) { case OUTPUT_FMT_RVDS: printf("%-40s EQU %5d\n", name, val); return 0; - case OUTPUT_FMT_GAS: + case OUTPUT_FMT_GAS: printf(".set %-40s, %5d\n", name, val); return 0; + case OUTPUT_FMT_C_HEADER: + printf("#define %-40s %5d\n", name, val); + return 0; default: log_msg("Unsupported mode: %d", mode); return 1; @@ -321,7 +325,7 @@ bail: return 1; } -char *parse_elf_string_table(elf_obj_t *elf, int s_idx, int idx) { +const char *parse_elf_string_table(elf_obj_t *elf, int s_idx, int idx) { if (elf->bits == 32) { Elf32_Shdr shdr; @@ -491,6 +495,13 @@ int parse_elf(uint8_t *buf, size_t sz, output_fmt_t mode) { sym.st_name), val); break; + case OUTPUT_FMT_C_HEADER: + printf("#define %-40s %5d\n", + parse_elf_string_table(&elf, + shdr.sh_link, + sym.st_name), + val); + break; default: printf("%s = %d\n", parse_elf_string_table(&elf, @@ -655,7 +666,11 @@ int parse_coff(uint8_t *buf, size_t sz) { } strcpy(sectionlist[i], sectionname); - if (!strcmp(sectionname, ".rdata")) sectionrawdata_ptr = get_le32(ptr + 20); + // check if it's .rdata and is not a COMDAT section. + if (!strcmp(sectionname, ".rdata") && + (get_le32(ptr + 36) & 0x1000) == 0) { + sectionrawdata_ptr = get_le32(ptr + 20); + } ptr += 40; } @@ -762,6 +777,7 @@ int main(int argc, char **argv) { fprintf(stderr, "Output Formats:\n"); fprintf(stderr, " gas - compatible with GNU assembler\n"); fprintf(stderr, " rvds - compatible with armasm\n"); + fprintf(stderr, " cheader - c/c++ header file\n"); goto bail; } @@ -771,6 +787,8 @@ int main(int argc, char **argv) { mode = OUTPUT_FMT_RVDS; else if (!strcmp(argv[1], "gas")) mode = OUTPUT_FMT_GAS; + else if (!strcmp(argv[1], "cheader")) + mode = OUTPUT_FMT_C_HEADER; else f = argv[1]; diff --git a/libvpx/build/make/rtcd.pl b/libvpx/build/make/rtcd.pl new file mode 100755 index 0000000..18ee80d --- /dev/null +++ b/libvpx/build/make/rtcd.pl @@ -0,0 +1,414 @@ +#!/usr/bin/env perl + +no strict 'refs'; +use warnings; +use Getopt::Long; +Getopt::Long::Configure("auto_help"); + +my %ALL_FUNCS = (); +my @ALL_ARCHS; +my @ALL_FORWARD_DECLS; +my @REQUIRES; + +my %opts = (); +my %disabled = (); +my %required = (); + +my @argv; +foreach (@ARGV) { + $disabled{$1} = 1, next if /--disable-(.*)/; + $required{$1} = 1, next if /--require-(.*)/; + push @argv, $_; +} + +# NB: use GetOptions() instead of GetOptionsFromArray() for compatibility. +@ARGV = @argv; +GetOptions( + \%opts, + 'arch=s', + 'sym=s', + 'config=s', +); + +foreach my $opt (qw/arch config/) { + if (!defined($opts{$opt})) { + warn "--$opt is required!\n"; + Getopt::Long::HelpMessage('-exit' => 1); + } +} + +foreach my $defs_file (@ARGV) { + if (!-f $defs_file) { + warn "$defs_file: $!\n"; + Getopt::Long::HelpMessage('-exit' => 1); + } +} + +open CONFIG_FILE, $opts{config} or + die "Error opening config file '$opts{config}': $!\n"; + +my %config = (); +while (<CONFIG_FILE>) { + next if !/^CONFIG_/; + chomp; + my @pair = split /=/; + $config{$pair[0]} = $pair[1]; +} +close CONFIG_FILE; + +# +# Routines for the RTCD DSL to call +# +sub vpx_config($) { + return (defined $config{$_[0]}) ? $config{$_[0]} : ""; +} + +sub specialize { + my $fn=$_[0]; + shift; + foreach my $opt (@_) { + eval "\$${fn}_${opt}=${fn}_${opt}"; + } +} + +sub add_proto { + my $fn = splice(@_, -2, 1); + $ALL_FUNCS{$fn} = \@_; + specialize $fn, "c"; +} + +sub require { + foreach my $fn (keys %ALL_FUNCS) { + foreach my $opt (@_) { + my $ofn = eval "\$${fn}_${opt}"; + next if !$ofn; + + # if we already have a default, then we can disable it, as we know + # we can do better. + my $best = eval "\$${fn}_default"; + if ($best) { + my $best_ofn = eval "\$${best}"; + if ($best_ofn && "$best_ofn" ne "$ofn") { + eval "\$${best}_link = 'false'"; + } + } + eval "\$${fn}_default=${fn}_${opt}"; + eval "\$${fn}_${opt}_link='true'"; + } + } +} + +sub forward_decls { + push @ALL_FORWARD_DECLS, @_; +} + +# +# Include the user's directives +# +foreach my $f (@ARGV) { + open FILE, "<", $f or die "cannot open $f: $!\n"; + my $contents = join('', <FILE>); + close FILE; + eval $contents or warn "eval failed: $@\n"; +} + +# +# Process the directives according to the command line +# +sub process_forward_decls() { + foreach (@ALL_FORWARD_DECLS) { + $_->(); + } +} + +sub determine_indirection { + vpx_config("CONFIG_RUNTIME_CPU_DETECT") eq "yes" or &require(@ALL_ARCHS); + foreach my $fn (keys %ALL_FUNCS) { + my $n = ""; + my @val = @{$ALL_FUNCS{$fn}}; + my $args = pop @val; + my $rtyp = "@val"; + my $dfn = eval "\$${fn}_default"; + $dfn = eval "\$${dfn}"; + foreach my $opt (@_) { + my $ofn = eval "\$${fn}_${opt}"; + next if !$ofn; + my $link = eval "\$${fn}_${opt}_link"; + next if $link && $link eq "false"; + $n .= "x"; + } + if ($n eq "x") { + eval "\$${fn}_indirect = 'false'"; + } else { + eval "\$${fn}_indirect = 'true'"; + } + } +} + +sub declare_function_pointers { + foreach my $fn (sort keys %ALL_FUNCS) { + my @val = @{$ALL_FUNCS{$fn}}; + my $args = pop @val; + my $rtyp = "@val"; + my $dfn = eval "\$${fn}_default"; + $dfn = eval "\$${dfn}"; + foreach my $opt (@_) { + my $ofn = eval "\$${fn}_${opt}"; + next if !$ofn; + print "$rtyp ${ofn}($args);\n"; + } + if (eval "\$${fn}_indirect" eq "false") { + print "#define ${fn} ${dfn}\n"; + } else { + print "RTCD_EXTERN $rtyp (*${fn})($args);\n"; + } + print "\n"; + } +} + +sub set_function_pointers { + foreach my $fn (sort keys %ALL_FUNCS) { + my @val = @{$ALL_FUNCS{$fn}}; + my $args = pop @val; + my $rtyp = "@val"; + my $dfn = eval "\$${fn}_default"; + $dfn = eval "\$${dfn}"; + if (eval "\$${fn}_indirect" eq "true") { + print " $fn = $dfn;\n"; + foreach my $opt (@_) { + my $ofn = eval "\$${fn}_${opt}"; + next if !$ofn; + next if "$ofn" eq "$dfn"; + my $link = eval "\$${fn}_${opt}_link"; + next if $link && $link eq "false"; + my $cond = eval "\$have_${opt}"; + print " if (${cond}) $fn = $ofn;\n" + } + } + } +} + +sub filter { + my @filtered; + foreach (@_) { push @filtered, $_ unless $disabled{$_}; } + return @filtered; +} + +# +# Helper functions for generating the arch specific RTCD files +# +sub common_top() { + my $include_guard = uc($opts{sym})."_H_"; + print <<EOF; +#ifndef ${include_guard} +#define ${include_guard} + +#ifdef RTCD_C +#define RTCD_EXTERN +#else +#define RTCD_EXTERN extern +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +EOF + +process_forward_decls(); +print "\n"; +declare_function_pointers("c", @ALL_ARCHS); + +print <<EOF; +void $opts{sym}(void); + +EOF +} + +sub common_bottom() { + print <<EOF; + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif +EOF +} + +sub x86() { + determine_indirection("c", @ALL_ARCHS); + + # Assign the helper variable for each enabled extension + foreach my $opt (@ALL_ARCHS) { + my $opt_uc = uc $opt; + eval "\$have_${opt}=\"flags & HAS_${opt_uc}\""; + } + + common_top; + print <<EOF; +#ifdef RTCD_C +#include "vpx_ports/x86.h" +static void setup_rtcd_internal(void) +{ + int flags = x86_simd_caps(); + + (void)flags; + +EOF + + set_function_pointers("c", @ALL_ARCHS); + + print <<EOF; +} +#endif +EOF + common_bottom; +} + +sub arm() { + determine_indirection("c", @ALL_ARCHS); + + # Assign the helper variable for each enabled extension + foreach my $opt (@ALL_ARCHS) { + my $opt_uc = uc $opt; + eval "\$have_${opt}=\"flags & HAS_${opt_uc}\""; + } + + common_top; + print <<EOF; +#include "vpx_config.h" + +#ifdef RTCD_C +#include "vpx_ports/arm.h" +static void setup_rtcd_internal(void) +{ + int flags = arm_cpu_caps(); + + (void)flags; + +EOF + + set_function_pointers("c", @ALL_ARCHS); + + print <<EOF; +} +#endif +EOF + common_bottom; +} + +sub mips() { + determine_indirection("c", @ALL_ARCHS); + common_top; + + print <<EOF; +#include "vpx_config.h" + +#ifdef RTCD_C +static void setup_rtcd_internal(void) +{ +EOF + + set_function_pointers("c", @ALL_ARCHS); + + print <<EOF; +#if HAVE_DSPR2 +#if CONFIG_VP8 +void dsputil_static_init(); +dsputil_static_init(); +#endif +#if CONFIG_VP9 +void vp9_dsputil_static_init(); +vp9_dsputil_static_init(); +#endif +#endif +} +#endif +EOF + common_bottom; +} + +sub unoptimized() { + determine_indirection "c"; + common_top; + print <<EOF; +#include "vpx_config.h" + +#ifdef RTCD_C +static void setup_rtcd_internal(void) +{ +EOF + + set_function_pointers "c"; + + print <<EOF; +} +#endif +EOF + common_bottom; +} + +# +# Main Driver +# + +&require("c"); +if ($opts{arch} eq 'x86') { + @ALL_ARCHS = filter(qw/mmx sse sse2 sse3 ssse3 sse4_1 avx avx2/); + x86; +} elsif ($opts{arch} eq 'x86_64') { + @ALL_ARCHS = filter(qw/mmx sse sse2 sse3 ssse3 sse4_1 avx avx2/); + @REQUIRES = filter(keys %required ? keys %required : qw/mmx sse sse2/); + &require(@REQUIRES); + x86; +} elsif ($opts{arch} eq 'mips32') { + @ALL_ARCHS = filter(qw/mips32/); + open CONFIG_FILE, $opts{config} or + die "Error opening config file '$opts{config}': $!\n"; + while (<CONFIG_FILE>) { + if (/HAVE_DSPR2=yes/) { + @ALL_ARCHS = filter(qw/mips32 dspr2/); + last; + } + } + close CONFIG_FILE; + mips; +} elsif ($opts{arch} eq 'armv5te') { + @ALL_ARCHS = filter(qw/edsp/); + arm; +} elsif ($opts{arch} eq 'armv6') { + @ALL_ARCHS = filter(qw/edsp media/); + arm; +} elsif ($opts{arch} eq 'armv7') { + @ALL_ARCHS = filter(qw/edsp media neon/); + arm; +} else { + unoptimized; +} + +__END__ + +=head1 NAME + +rtcd - + +=head1 SYNOPSIS + +Usage: rtcd.pl [options] FILE + +See 'perldoc rtcd.pl' for more details. + +=head1 DESCRIPTION + +Reads the Run Time CPU Detections definitions from FILE and generates a +C header file on stdout. + +=head1 OPTIONS + +Options: + --arch=ARCH Architecture to generate defs for (required) + --disable-EXT Disable support for EXT extensions + --require-EXT Require support for EXT extensions + --sym=SYMBOL Unique symbol to use for RTCD initialization function + --config=FILE File with CONFIG_FOO=yes lines to parse diff --git a/libvpx/build/make/rtcd.sh b/libvpx/build/make/rtcd.sh deleted file mode 100755 index 2967b5a..0000000 --- a/libvpx/build/make/rtcd.sh +++ /dev/null @@ -1,363 +0,0 @@ -#!/bin/sh -self=$0 - -usage() { - cat <<EOF >&2 -Usage: $self [options] FILE - -Reads the Run Time CPU Detections definitions from FILE and generates a -C header file on stdout. - -Options: - --arch=ARCH Architecture to generate defs for (required) - --disable-EXT Disable support for EXT extensions - --require-EXT Require support for EXT extensions - --sym=SYMBOL Unique symbol to use for RTCD initialization function - --config=FILE File with CONFIG_FOO=yes lines to parse -EOF - exit 1 -} - -die() { - echo "$@" >&2 - exit 1 -} - -die_argument_required() { - die "Option $opt requires argument" -} - -for opt; do - optval="${opt#*=}" - case "$opt" in - --arch) die_argument_required;; - --arch=*) arch=${optval};; - --disable-*) eval "disable_${opt#--disable-}=true";; - --require-*) REQUIRES="${REQUIRES}${opt#--require-} ";; - --sym) die_argument_required;; - --sym=*) symbol=${optval};; - --config=*) config_file=${optval};; - -h|--help) - usage - ;; - -*) - die "Unrecognized option: ${opt%%=*}" - ;; - *) - defs_file="$defs_file $opt" - ;; - esac - shift -done -for f in $defs_file; do [ -f "$f" ] || usage; done -[ -n "$arch" ] || usage - -# Import the configuration -[ -f "$config_file" ] && eval $(grep CONFIG_ "$config_file") - -# -# Routines for the RTCD DSL to call -# -prototype() { - rtyp="" - case "$1" in - unsigned) rtyp="$1 "; shift;; - esac - rtyp="${rtyp}$1" - fn="$2" - args="$3" - - eval "${2}_rtyp='$rtyp'" - eval "${2}_args='$3'" - ALL_FUNCS="$ALL_FUNCS $fn" - specialize $fn c -} - -specialize() { - fn="$1" - shift - for opt in "$@"; do - eval "${fn}_${opt}=${fn}_${opt}" - done -} - -require() { - for fn in $ALL_FUNCS; do - for opt in "$@"; do - ofn=$(eval "echo \$${fn}_${opt}") - [ -z "$ofn" ] && continue - - # if we already have a default, then we can disable it, as we know - # we can do better. - best=$(eval "echo \$${fn}_default") - best_ofn=$(eval "echo \$${best}") - [ -n "$best" ] && [ "$best_ofn" != "$ofn" ] && eval "${best}_link=false" - eval "${fn}_default=${fn}_${opt}" - eval "${fn}_${opt}_link=true" - done - done -} - -forward_decls() { - ALL_FORWARD_DECLS="$ALL_FORWARD_DECLS $1" -} - -# -# Include the user's directives -# -for f in $defs_file; do - . $f -done - -# -# Process the directives according to the command line -# -process_forward_decls() { - for fn in $ALL_FORWARD_DECLS; do - eval $fn - done -} - -determine_indirection() { - [ "$CONFIG_RUNTIME_CPU_DETECT" = "yes" ] || require $ALL_ARCHS - for fn in $ALL_FUNCS; do - n="" - rtyp="$(eval "echo \$${fn}_rtyp")" - args="$(eval "echo \"\$${fn}_args\"")" - dfn="$(eval "echo \$${fn}_default")" - dfn=$(eval "echo \$${dfn}") - for opt in "$@"; do - ofn=$(eval "echo \$${fn}_${opt}") - [ -z "$ofn" ] && continue - link=$(eval "echo \$${fn}_${opt}_link") - [ "$link" = "false" ] && continue - n="${n}x" - done - if [ "$n" = "x" ]; then - eval "${fn}_indirect=false" - else - eval "${fn}_indirect=true" - fi - done -} - -declare_function_pointers() { - for fn in $ALL_FUNCS; do - rtyp="$(eval "echo \$${fn}_rtyp")" - args="$(eval "echo \"\$${fn}_args\"")" - dfn="$(eval "echo \$${fn}_default")" - dfn=$(eval "echo \$${dfn}") - for opt in "$@"; do - ofn=$(eval "echo \$${fn}_${opt}") - [ -z "$ofn" ] && continue - echo "$rtyp ${ofn}($args);" - done - if [ "$(eval "echo \$${fn}_indirect")" = "false" ]; then - echo "#define ${fn} ${dfn}" - else - echo "RTCD_EXTERN $rtyp (*${fn})($args);" - fi - echo - done -} - -set_function_pointers() { - for fn in $ALL_FUNCS; do - n="" - rtyp="$(eval "echo \$${fn}_rtyp")" - args="$(eval "echo \"\$${fn}_args\"")" - dfn="$(eval "echo \$${fn}_default")" - dfn=$(eval "echo \$${dfn}") - if $(eval "echo \$${fn}_indirect"); then - echo " $fn = $dfn;" - for opt in "$@"; do - ofn=$(eval "echo \$${fn}_${opt}") - [ -z "$ofn" ] && continue - [ "$ofn" = "$dfn" ] && continue; - link=$(eval "echo \$${fn}_${opt}_link") - [ "$link" = "false" ] && continue - cond="$(eval "echo \$have_${opt}")" - echo " if (${cond}) $fn = $ofn;" - done - fi - echo - done -} - -filter() { - filtered="" - for opt in "$@"; do - [ -z $(eval "echo \$disable_${opt}") ] && filtered="$filtered $opt" - done - echo $filtered -} - -# -# Helper functions for generating the arch specific RTCD files -# -common_top() { - outfile_basename=$(basename ${symbol:-rtcd}) - include_guard=$(echo $outfile_basename | tr '[a-z]' '[A-Z]' | \ - tr -c '[A-Z0-9]' _)H_ - cat <<EOF -#ifndef ${include_guard} -#define ${include_guard} - -#ifdef RTCD_C -#define RTCD_EXTERN -#else -#define RTCD_EXTERN extern -#endif - -$(process_forward_decls) - -$(declare_function_pointers c $ALL_ARCHS) - -void ${symbol:-rtcd}(void); -EOF -} - -common_bottom() { - cat <<EOF -#endif -EOF -} - -x86() { - determine_indirection c $ALL_ARCHS - - # Assign the helper variable for each enabled extension - for opt in $ALL_ARCHS; do - uc=$(echo $opt | tr '[a-z]' '[A-Z]') - eval "have_${opt}=\"flags & HAS_${uc}\"" - done - - cat <<EOF -$(common_top) - -#ifdef RTCD_C -#include "vpx_ports/x86.h" -static void setup_rtcd_internal(void) -{ - int flags = x86_simd_caps(); - - (void)flags; - -$(set_function_pointers c $ALL_ARCHS) -} -#endif -$(common_bottom) -EOF -} - -arm() { - determine_indirection c $ALL_ARCHS - - # Assign the helper variable for each enabled extension - for opt in $ALL_ARCHS; do - uc=$(echo $opt | tr '[a-z]' '[A-Z]') - eval "have_${opt}=\"flags & HAS_${uc}\"" - done - - cat <<EOF -$(common_top) -#include "vpx_config.h" - -#ifdef RTCD_C -#include "vpx_ports/arm.h" -static void setup_rtcd_internal(void) -{ - int flags = arm_cpu_caps(); - - (void)flags; - -$(set_function_pointers c $ALL_ARCHS) -} -#endif -$(common_bottom) -EOF -} - - -mips() { - determine_indirection c $ALL_ARCHS - cat <<EOF -$(common_top) -#include "vpx_config.h" - -#ifdef RTCD_C -static void setup_rtcd_internal(void) -{ -$(set_function_pointers c $ALL_ARCHS) -#if HAVE_DSPR2 -#if CONFIG_VP8 -void dsputil_static_init(); -dsputil_static_init(); -#endif -#if CONFIG_VP9 -void vp9_dsputil_static_init(); -vp9_dsputil_static_init(); -#endif -#endif -} -#endif -$(common_bottom) -EOF -} - -unoptimized() { - determine_indirection c - cat <<EOF -$(common_top) -#include "vpx_config.h" - -#ifdef RTCD_C -static void setup_rtcd_internal(void) -{ -$(set_function_pointers c) -} -#endif -$(common_bottom) -EOF - -} -# -# Main Driver -# -require c -case $arch in - x86) - ALL_ARCHS=$(filter mmx sse sse2 sse3 ssse3 sse4_1 avx avx2) - x86 - ;; - x86_64) - ALL_ARCHS=$(filter mmx sse sse2 sse3 ssse3 sse4_1 avx avx2) - REQUIRES=${REQUIRES:-mmx sse sse2} - require $(filter $REQUIRES) - x86 - ;; - mips32) - ALL_ARCHS=$(filter mips32) - dspr2=$([ -f "$config_file" ] && eval echo $(grep HAVE_DSPR2 "$config_file")) - HAVE_DSPR2="${dspr2#*=}" - if [ "$HAVE_DSPR2" = "yes" ]; then - ALL_ARCHS=$(filter mips32 dspr2) - fi - mips - ;; - armv5te) - ALL_ARCHS=$(filter edsp) - arm - ;; - armv6) - ALL_ARCHS=$(filter edsp media) - arm - ;; - armv7) - ALL_ARCHS=$(filter edsp media neon) - arm - ;; - *) - unoptimized - ;; -esac diff --git a/libvpx/build/make/thumb.pm b/libvpx/build/make/thumb.pm index e1f34c1..483c253 100644 --- a/libvpx/build/make/thumb.pm +++ b/libvpx/build/make/thumb.pm @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl ## ## Copyright (c) 2013 The WebM project authors. All Rights Reserved. ## @@ -24,7 +24,7 @@ sub FixThumbInstructions($$) # with left shift, addition and a right shift (to restore the # register to the original value). Currently the right shift # isn't necessary in the code base since the values in these - # registers aren't used, but doing the shift for consitency. + # registers aren't used, but doing the shift for consistency. # This converts instructions such as "add r12, r12, r5, lsl r4" # into the sequence "lsl r5, r4", "add r12, r12, r5", "lsr r5, r4". s/^(\s*)(add)(\s+)(r\d+),\s*(r\d+),\s*(r\d+),\s*lsl (r\d+)/$1lsl$3$6, $7\n$1$2$3$4, $5, $6\n$1lsr$3$6, $7/g; @@ -51,7 +51,7 @@ sub FixThumbInstructions($$) # Convert register post indexing to a separate add instruction. # This converts "ldrneb r9, [r0], r2" into "ldrneb r9, [r0]", - # "add r0, r2". + # "addne r0, r0, r2". s/^(\s*)((ldr|str)(ne)?[bhd]?)(\s+)(\w+),(\s*\w+,)?\s*\[(\w+)\],\s*(\w+)/$1$2$5$6,$7 [$8]\n$1add$4$5$8, $8, $9/g; # Convert a conditional addition to the pc register into a series of diff --git a/libvpx/build/x86-msvs/obj_int_extract.bat b/libvpx/build/x86-msvs/obj_int_extract.bat index 4e9b0ec..44d095d 100644 --- a/libvpx/build/x86-msvs/obj_int_extract.bat +++ b/libvpx/build/x86-msvs/obj_int_extract.bat @@ -7,6 +7,9 @@ REM in the file PATENTS. All contributing project authors may REM be found in the AUTHORS file in the root of the source tree. echo on +REM Arguments: +REM %1 - Relative path to the directory containing the vp8 source directory. +REM %2 - Path to obj_int_extract.exe. cl /I "./" /I "%1" /nologo /c "%1/vp8/encoder/vp8_asm_enc_offsets.c" -obj_int_extract.exe rvds "vp8_asm_enc_offsets.obj" > "vp8_asm_enc_offsets.asm" +%2\obj_int_extract.exe rvds "vp8_asm_enc_offsets.obj" > "vp8_asm_enc_offsets.asm" |