Commit d64431d4 authored by Thomas Daede's avatar Thomas Daede

Add dav1d MC assembly (but don't use it yet).

parent 78c51dcb
......@@ -12,6 +12,13 @@ before_install:
- hash -r
- which cmake
- cmake --version
- wget https://www.nasm.us/pub/nasm/releasebuilds/2.13.03/nasm-2.13.03.tar.xz
- tar -xvf nasm-2.13.03.tar.xz
- cd nasm-2.13.03
- ./configure
- make
- sudo make install
- nasm --version
script:
- |
cargo build --verbose &&
......
......@@ -27,6 +27,9 @@ num-traits = "0.2"
[build-dependencies]
cmake = "0.1.32"
[target.'cfg(target_arch = "x86_64")'.build-dependencies]
nasm-rs = { git = "https://github.com/tdaede/nasm-rs.git" }
[target.'cfg(unix)'.build-dependencies]
pkg-config = "0.3.12"
bindgen = { version = "0.37", optional = true }
......
......@@ -6,8 +6,11 @@ environment:
target: x86_64-pc-windows-msvc
install:
- call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
- appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe
- appveyor DownloadFile http://www.tortall.net/projects/yasm/releases/yasm-1.3.0-win64.exe -FileName yasm.exe
- appveyor DownloadFile https://www.nasm.us/pub/nasm/releasebuilds/2.13.03/win64/nasm-2.13.03-win64.zip -FileName nasm.zip
- 7z e -y nasm.zip
- rustup-init -yv --default-toolchain %channel% --default-host %target%
- set PATH=%PATH%;%USERPROFILE%\.cargo\bin;%APPVEYOR_BUILD_FOLDER%
- rustc -vV
......
......@@ -6,12 +6,32 @@ extern crate pkg_config;
#[cfg(unix)]
#[cfg(feature = "decode_test")]
extern crate bindgen;
#[cfg(target_arch = "x86_64")]
extern crate nasm_rs;
use std::env;
use std::fs;
use std::fs::File;
use std::io::Write;
use std::path::Path;
fn main() {
if cfg!(target_arch = "x86_64") {
let out_dir = env::var("OUT_DIR").unwrap();
{
let dest_path = Path::new(&out_dir).join("config.asm");
let mut config_file = File::create(dest_path).unwrap();
config_file.write(b" %define ARCH_X86_32 0\n").unwrap();
config_file.write(b" %define ARCH_X86_64 1\n").unwrap();
config_file.write(b" %define PIC 1\n").unwrap();
config_file.write(b" %define STACK_ALIGNMENT 32\n").unwrap();
}
let mut config_include_arg = String::from("-I");
config_include_arg.push_str(&out_dir);
config_include_arg.push('/');
nasm_rs::compile_library_args("rav1easm", &["src/x86/mc.asm"], &[&config_include_arg, "-Isrc/"]);
}
if cfg!(windows) && cfg!(feature = "decode_test") {
panic!("Unsupported feature on this platform!");
}
......
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment