Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/nuget/src/csharp/Microsoft.NET.…
Browse files Browse the repository at this point in the history
…Test.Sdk-16.11.0
  • Loading branch information
wtfsck authored Aug 18, 2021
2 parents a0d514d + 7dcba22 commit 7c2a28c
Show file tree
Hide file tree
Showing 98 changed files with 344,288 additions and 59,568 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ on:
# Keep this in sync with the other *.yml files
env:
CI_REQ_DOTNET_SDK_VER: 5.0.100
COVERAGE_FILENAME: coverage.net5.0.info
COVERAGE_FILENAME: coverage.info
CI_NODE_MIN_VER: 12.0.0
RUSTFLAGS: -D warnings
MACOSX_DEPLOYMENT_TARGET: 10.12
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
# Keep this in sync with the other *.yml files
env:
CI_REQ_DOTNET_SDK_VER: 5.0.100
COVERAGE_FILENAME: coverage.net5.0.info
COVERAGE_FILENAME: coverage.info
CI_NODE_MIN_VER: 12.0.0
RUSTFLAGS: -D warnings
MACOSX_DEPLOYMENT_TARGET: 10.12
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ iced is a blazing fast and correct x86 (16/32/64-bit) instruction decoder, disas
- ✔️The formatter supports masm, nasm, gas (AT&T), Intel (XED) and there are many options to customize the output
- ✔️Blazing fast: Decodes >250 MB/s and decode+format >130 MB/s (Rust, [see here](https://github.com/icedland/disas-bench/tree/a865849deacfb6c33ee0e78f3a3ad7f4c82099f5#results))
- ✔️Small decoded instructions, only 40 bytes and the decoder doesn't allocate any memory
-️.NET: High level Assembler providing a simple and lean syntax (e.g `asm.mov(eax, edx)`))
-️Create instructions with code assembler, eg. `asm.mov(eax, edx)`
- ✔️The encoder can be used to re-encode decoded instructions at any address
- ✔️API to get instruction info, eg. read/written registers, memory and rflags bits; CPUID feature flag, control flow info, etc
- ✔️License: MIT
Expand Down
75 changes: 27 additions & 48 deletions build/build-dotnet
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ new_func() {
echo
}

clean_dotnet_build_output() {
dotnet clean -v:m -c $configuration "$root_dir/src/csharp/Iced.sln"
}

generator_check() {
new_func "Run generator, verify no diff"

Expand All @@ -50,74 +46,58 @@ build_features() {
set -- \
"DECODER" \
"ENCODER" \
"ENCODER;BLOCK_ENCODER" \
"ENCODER;BLOCK_ENCODER;CODE_ASSEMBLER" \
"ENCODER;OPCODE_INFO" \
"ENCODER BLOCK_ENCODER" \
"ENCODER BLOCK_ENCODER CODE_ASSEMBLER" \
"ENCODER OPCODE_INFO" \
"INSTR_INFO" \
"GAS" \
"INTEL" \
"MASM" \
"NASM" \
"FAST_FMT" \
"DECODER;ENCODER;BLOCK_ENCODER;CODE_ASSEMBLER;OPCODE_INFO;INSTR_INFO;GAS;INTEL;MASM;NASM;FAST_FMT;NO_VEX" \
"DECODER;ENCODER;BLOCK_ENCODER;CODE_ASSEMBLER;OPCODE_INFO;INSTR_INFO;GAS;INTEL;MASM;NASM;FAST_FMT;NO_EVEX" \
"DECODER;ENCODER;BLOCK_ENCODER;CODE_ASSEMBLER;OPCODE_INFO;INSTR_INFO;GAS;INTEL;MASM;NASM;FAST_FMT;NO_XOP" \
"DECODER;ENCODER;BLOCK_ENCODER;CODE_ASSEMBLER;OPCODE_INFO;INSTR_INFO;GAS;INTEL;MASM;NASM;FAST_FMT;NO_D3NOW" \
"DECODER;ENCODER;BLOCK_ENCODER;CODE_ASSEMBLER;OPCODE_INFO;INSTR_INFO;GAS;INTEL;MASM;NASM;FAST_FMT;NO_VEX;NO_EVEX;NO_XOP;NO_D3NOW"
"DECODER ENCODER BLOCK_ENCODER CODE_ASSEMBLER OPCODE_INFO INSTR_INFO GAS INTEL MASM NASM FAST_FMT NO_VEX" \
"DECODER ENCODER BLOCK_ENCODER CODE_ASSEMBLER OPCODE_INFO INSTR_INFO GAS INTEL MASM NASM FAST_FMT NO_EVEX" \
"DECODER ENCODER BLOCK_ENCODER CODE_ASSEMBLER OPCODE_INFO INSTR_INFO GAS INTEL MASM NASM FAST_FMT NO_XOP" \
"DECODER ENCODER BLOCK_ENCODER CODE_ASSEMBLER OPCODE_INFO INSTR_INFO GAS INTEL MASM NASM FAST_FMT NO_D3NOW" \
"DECODER ENCODER BLOCK_ENCODER CODE_ASSEMBLER OPCODE_INFO INSTR_INFO GAS INTEL MASM NASM FAST_FMT NO_VEX NO_EVEX NO_XOP NO_D3NOW"
for features in "$@"; do
clean_dotnet_build_output
echo
echo "==== $features ===="
echo
IcedFeatureFlags="$features" dotnet build -v:m -c $configuration -p:TargetFramework=$net_std "$root_dir/src/csharp/Intel/Iced/Iced.csproj"
dotnet build -v:m -c $configuration -p:TargetFramework=$net_std -p:IcedFeatureFlags="$features" "$root_dir/src/csharp/Intel/Iced/Iced.csproj"
done

set -- \
"DECODER" \
"DECODER;ENCODER" \
"DECODER;ENCODER;BLOCK_ENCODER" \
"DECODER;ENCODER;BLOCK_ENCODER;CODE_ASSEMBLER" \
"DECODER;ENCODER;OPCODE_INFO" \
"DECODER;INSTR_INFO" \
"DECODER;GAS" \
"DECODER;INTEL" \
"DECODER;MASM" \
"DECODER;NASM" \
"DECODER;FAST_FMT" \
"DECODER;ENCODER;BLOCK_ENCODER;CODE_ASSEMBLER;OPCODE_INFO;INSTR_INFO;GAS;INTEL;MASM;NASM;FAST_FMT;NO_VEX" \
"DECODER;ENCODER;BLOCK_ENCODER;CODE_ASSEMBLER;OPCODE_INFO;INSTR_INFO;GAS;INTEL;MASM;NASM;FAST_FMT;NO_EVEX" \
"DECODER;ENCODER;BLOCK_ENCODER;CODE_ASSEMBLER;OPCODE_INFO;INSTR_INFO;GAS;INTEL;MASM;NASM;FAST_FMT;NO_XOP" \
"DECODER;ENCODER;BLOCK_ENCODER;CODE_ASSEMBLER;OPCODE_INFO;INSTR_INFO;GAS;INTEL;MASM;NASM;FAST_FMT;NO_D3NOW" \
"DECODER;ENCODER;BLOCK_ENCODER;CODE_ASSEMBLER;OPCODE_INFO;INSTR_INFO;GAS;INTEL;MASM;NASM;FAST_FMT;NO_VEX;NO_EVEX;NO_XOP;NO_D3NOW"
"DECODER ENCODER" \
"DECODER ENCODER BLOCK_ENCODER" \
"DECODER ENCODER BLOCK_ENCODER CODE_ASSEMBLER" \
"DECODER ENCODER OPCODE_INFO" \
"DECODER INSTR_INFO" \
"DECODER GAS" \
"DECODER INTEL" \
"DECODER MASM" \
"DECODER NASM" \
"DECODER FAST_FMT" \
"DECODER ENCODER BLOCK_ENCODER CODE_ASSEMBLER OPCODE_INFO INSTR_INFO GAS INTEL MASM NASM FAST_FMT NO_VEX" \
"DECODER ENCODER BLOCK_ENCODER CODE_ASSEMBLER OPCODE_INFO INSTR_INFO GAS INTEL MASM NASM FAST_FMT NO_EVEX" \
"DECODER ENCODER BLOCK_ENCODER CODE_ASSEMBLER OPCODE_INFO INSTR_INFO GAS INTEL MASM NASM FAST_FMT NO_XOP" \
"DECODER ENCODER BLOCK_ENCODER CODE_ASSEMBLER OPCODE_INFO INSTR_INFO GAS INTEL MASM NASM FAST_FMT NO_D3NOW" \
"DECODER ENCODER BLOCK_ENCODER CODE_ASSEMBLER OPCODE_INFO INSTR_INFO GAS INTEL MASM NASM FAST_FMT NO_VEX NO_EVEX NO_XOP NO_D3NOW"
for features in "$@"; do
clean_dotnet_build_output
echo
echo "==== TEST $features ===="
echo
IcedFeatureFlags="$features" dotnet build -v:m -c $configuration -p:TargetFramework=$net_tfm "$root_dir/src/csharp/Intel/Iced.UnitTests/Iced.UnitTests.csproj"
dotnet build -v:m -c $configuration -p:TargetFramework=$net_tfm -p:IcedFeatureFlags="$features" "$root_dir/src/csharp/Intel/Iced.UnitTests/Iced.UnitTests.csproj"
done

clean_dotnet_build_output
}

build_test() {
new_func "Build, test"

dotnet build -v:m -c $configuration "$root_dir/src/csharp/Iced.sln"
dotnet build -v:m -c $configuration "$root_dir/src/csharp/Intel/Iced.sln"

if [ "$test_code" = "y" ]; then
if [ "$is_windows" = "y" ]; then
echo
echo "==== TEST (.NET Framework x64) ===="
echo
~/.nuget/packages/xunit.runner.console/$xunit_version/tools/$xunit_net_tfm_version/xunit.console.exe "$root_dir/src/csharp/Intel/Iced.UnitTests/bin/$configuration/$net_framework_tfm/Iced.UnitTests.dll" -noappdomain

echo
echo "==== TEST (.NET Framework x86) ===="
echo
~/.nuget/packages/xunit.runner.console/$xunit_version/tools/$xunit_net_tfm_version/xunit.console.x86.exe "$root_dir/src/csharp/Intel/Iced.UnitTests/bin/$configuration/$net_framework_tfm/Iced.UnitTests.dll" -noappdomain
fi

echo
echo "==== TEST ===="
echo
Expand All @@ -143,9 +123,8 @@ build_test() {
echo
echo "==== PACK ===="
echo
clean_dotnet_build_output
# Don't include the IVT in the final binary
IcedDefineConstants="IcedNoIVT" dotnet pack -v:m -c $configuration "$root_dir/src/csharp/Intel/Iced/Iced.csproj"
dotnet pack -v:m -c $configuration -p:IcedDefineConstants="IcedNoIVT" "$root_dir/src/csharp/Intel/Iced/Iced.csproj"
fi
}

Expand Down
21 changes: 15 additions & 6 deletions build/build-rust
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ test_build_no_std=y
test_features=y
test_current=y
test_msrv=y
test_code_asm=y

# Minimum supported Rust version
msrv="1.41.0"
Expand Down Expand Up @@ -189,15 +190,15 @@ build_test_current_version() {
cargo build --color always --release --features "serde code_asm"

echo "==== TEST RELEASE ===="
cargo test --color always --release --features "serde code_asm"
cargo test --color always --release --features "serde $test_code_asm_feat"

# Make sure the two read-mem methods behave the same
# Also test serde code. It needs encoder to also test 'db x,y,z', see serde tests
echo "==== TEST DEBUG: std decoder encoder serde __internal_flip ===="
cargo test --color always --tests --no-default-features --features "std decoder encoder serde __internal_flip"

echo "==== TEST DEBUG ===="
cargo test --color always --tests --features "serde code_asm"
cargo test --color always --tests --features "serde $test_code_asm_feat"

echo "==== BUILD RELEASE wasm32-unknown-unknown ===="
cargo check --color always --target wasm32-unknown-unknown --release --features "serde code_asm"
Expand All @@ -220,11 +221,12 @@ build_test_msrv() {

echo "*** If this fails, install Rust $msrv"

echo "==== BUILD RELEASE ===="
cargo +$msrv build --color always --release --features "serde code_asm"
echo "==== BUILD DEBUG ===="
cargo +$msrv build --color always --features "serde code_asm"

echo "==== TEST RELEASE ===="
cargo +$msrv test --color always --release --features "serde code_asm"
# We don't test it since we only guarantee that the crate can be built. Testing is for iced devs.
# We test it when using the latest rustc, but not rustc MSRV.
# This also speeds up CI since code_asm feature's tests take a very long time to compile.

cd "$curr_dir"
}
Expand All @@ -244,6 +246,7 @@ while [ "$#" -gt 0 ]; do
--quick-check)
clear_test_vars
test_current=y
test_code_asm=n
;;
--no-dotnet)
test_gen=n
Expand Down Expand Up @@ -283,6 +286,12 @@ fi
echo "rustup show"
rustup show

if [ "$test_code_asm" = "y" ]; then
test_code_asm_feat="code_asm"
else
test_code_asm_feat=""
fi

if [ "$test_gen" = "y" ] || [ "$test_instrs" = "y" ]; then
echo "dotnet version (if this fails, install .NET or use --no-dotnet)"
dotnet --version
Expand Down
Loading

0 comments on commit 7c2a28c

Please sign in to comment.