diff options
author | Tanner Gooding <tagoo@outlook.com> | 2018-03-15 03:50:44 -0700 |
---|---|---|
committer | Tanner Gooding <tagoo@outlook.com> | 2018-03-19 11:31:47 -0700 |
commit | e01064aef5ae9c29d0d01bd1a6f4b0335a10213b (patch) | |
tree | 5e9e5fcd7ddea3d941bbbbfa3df3af8d34450986 /tests | |
parent | fe7e46907b73022c9a8680eee86932cef6037890 (diff) | |
download | coreclr-e01064aef5ae9c29d0d01bd1a6f4b0335a10213b.tar.gz coreclr-e01064aef5ae9c29d0d01bd1a6f4b0335a10213b.tar.bz2 coreclr-e01064aef5ae9c29d0d01bd1a6f4b0335a10213b.zip |
Fixing the x86 HWIntrinsic test templates to not leave a GC hole
Diffstat (limited to 'tests')
19 files changed, 29 insertions, 29 deletions
diff --git a/tests/src/JIT/HardwareIntrinsics/X86/Shared/AlternatingBinOpTest.template b/tests/src/JIT/HardwareIntrinsics/X86/Shared/AlternatingBinOpTest.template index dee7f6c590..e4b0d8c883 100644 --- a/tests/src/JIT/HardwareIntrinsics/X86/Shared/AlternatingBinOpTest.template +++ b/tests/src/JIT/HardwareIntrinsics/X86/Shared/AlternatingBinOpTest.template @@ -279,8 +279,8 @@ namespace JIT.HardwareIntrinsics.X86 {Op2BaseType}[] inArray2 = new {Op2BaseType}[Op2ElementCount]; {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; - Unsafe.Write(Unsafe.AsPointer(ref inArray1[0]), left); - Unsafe.Write(Unsafe.AsPointer(ref inArray2[0]), right); + Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray1[0]), left); + Unsafe.WriteUnaligned(ref Unsafe.As<{Op2BaseType}, byte>(ref inArray2[0]), right); Unsafe.CopyBlockUnaligned(ref Unsafe.As<{RetBaseType}, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), VectorSize); ValidateResult(inArray1, inArray2, outArray, method); diff --git a/tests/src/JIT/HardwareIntrinsics/X86/Shared/BooleanBinOpTest.template b/tests/src/JIT/HardwareIntrinsics/X86/Shared/BooleanBinOpTest.template index bb60168666..4bb3e92de1 100644 --- a/tests/src/JIT/HardwareIntrinsics/X86/Shared/BooleanBinOpTest.template +++ b/tests/src/JIT/HardwareIntrinsics/X86/Shared/BooleanBinOpTest.template @@ -277,8 +277,8 @@ namespace JIT.HardwareIntrinsics.X86 {Op1BaseType}[] inArray1 = new {Op1BaseType}[Op1ElementCount]; {Op2BaseType}[] inArray2 = new {Op2BaseType}[Op2ElementCount]; - Unsafe.Write(Unsafe.AsPointer(ref inArray1[0]), left); - Unsafe.Write(Unsafe.AsPointer(ref inArray2[0]), right); + Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray1[0]), left); + Unsafe.WriteUnaligned(ref Unsafe.As<{Op2BaseType}, byte>(ref inArray2[0]), right); ValidateResult(inArray1, inArray2, result, method); } diff --git a/tests/src/JIT/HardwareIntrinsics/X86/Shared/BooleanCmpOpTest.template b/tests/src/JIT/HardwareIntrinsics/X86/Shared/BooleanCmpOpTest.template index b16b17a45f..893af47106 100644 --- a/tests/src/JIT/HardwareIntrinsics/X86/Shared/BooleanCmpOpTest.template +++ b/tests/src/JIT/HardwareIntrinsics/X86/Shared/BooleanCmpOpTest.template @@ -265,8 +265,8 @@ namespace JIT.HardwareIntrinsics.X86 {Op1BaseType}[] inArray1 = new {Op1BaseType}[Op1ElementCount]; {Op2BaseType}[] inArray2 = new {Op2BaseType}[Op2ElementCount]; - Unsafe.Write(Unsafe.AsPointer(ref inArray1[0]), left); - Unsafe.Write(Unsafe.AsPointer(ref inArray2[0]), right); + Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray1[0]), left); + Unsafe.WriteUnaligned(ref Unsafe.As<{Op2BaseType}, byte>(ref inArray2[0]), right); ValidateResult(inArray1, inArray2, result, method); } diff --git a/tests/src/JIT/HardwareIntrinsics/X86/Shared/BooleanTwoCmpOpTest.template b/tests/src/JIT/HardwareIntrinsics/X86/Shared/BooleanTwoCmpOpTest.template index 53c9cacd13..f6c1dd9972 100644 --- a/tests/src/JIT/HardwareIntrinsics/X86/Shared/BooleanTwoCmpOpTest.template +++ b/tests/src/JIT/HardwareIntrinsics/X86/Shared/BooleanTwoCmpOpTest.template @@ -276,8 +276,8 @@ namespace JIT.HardwareIntrinsics.X86 {Op1BaseType}[] inArray1 = new {Op1BaseType}[Op1ElementCount]; {Op2BaseType}[] inArray2 = new {Op2BaseType}[Op2ElementCount]; - Unsafe.Write(Unsafe.AsPointer(ref inArray1[0]), left); - Unsafe.Write(Unsafe.AsPointer(ref inArray2[0]), right); + Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray1[0]), left); + Unsafe.WriteUnaligned(ref Unsafe.As<{Op2BaseType}, byte>(ref inArray2[0]), right); ValidateResult(inArray1, inArray2, result, method); } diff --git a/tests/src/JIT/HardwareIntrinsics/X86/Shared/BooleanUnOpTest.template b/tests/src/JIT/HardwareIntrinsics/X86/Shared/BooleanUnOpTest.template index 422c4603ac..901f949ac2 100644 --- a/tests/src/JIT/HardwareIntrinsics/X86/Shared/BooleanUnOpTest.template +++ b/tests/src/JIT/HardwareIntrinsics/X86/Shared/BooleanUnOpTest.template @@ -246,7 +246,7 @@ namespace JIT.HardwareIntrinsics.X86 { {Op1BaseType}[] inArray = new {Op1BaseType}[Op1ElementCount]; - Unsafe.Write(Unsafe.AsPointer(ref inArray[0]), value); + Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray[0]), value); ValidateResult(inArray, result, method); } diff --git a/tests/src/JIT/HardwareIntrinsics/X86/Shared/ExtractScalarTest.template b/tests/src/JIT/HardwareIntrinsics/X86/Shared/ExtractScalarTest.template index 0fb09bb987..faa44df759 100644 --- a/tests/src/JIT/HardwareIntrinsics/X86/Shared/ExtractScalarTest.template +++ b/tests/src/JIT/HardwareIntrinsics/X86/Shared/ExtractScalarTest.template @@ -273,7 +273,7 @@ namespace JIT.HardwareIntrinsics.X86 {Op1BaseType}[] inArray = new {Op1BaseType}[Op1ElementCount]; {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; - Unsafe.Write(Unsafe.AsPointer(ref inArray[0]), firstOp); + Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray[0]), firstOp); Unsafe.CopyBlockUnaligned(ref Unsafe.As<{RetBaseType}, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), VectorSize); ValidateResult(inArray, outArray, method); diff --git a/tests/src/JIT/HardwareIntrinsics/X86/Shared/ExtractStoreTest.template b/tests/src/JIT/HardwareIntrinsics/X86/Shared/ExtractStoreTest.template index e686366914..fb5fe73764 100644 --- a/tests/src/JIT/HardwareIntrinsics/X86/Shared/ExtractStoreTest.template +++ b/tests/src/JIT/HardwareIntrinsics/X86/Shared/ExtractStoreTest.template @@ -250,7 +250,7 @@ namespace JIT.HardwareIntrinsics.X86 {Op1BaseType}[] inArray = new {Op1BaseType}[Op1ElementCount]; {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; - Unsafe.Write(Unsafe.AsPointer(ref inArray[0]), firstOp); + Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray[0]), firstOp); Unsafe.CopyBlockUnaligned(ref Unsafe.As<{RetBaseType}, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), VectorSize); ValidateResult(inArray, outArray, method); diff --git a/tests/src/JIT/HardwareIntrinsics/X86/Shared/ExtractVector128Test.template b/tests/src/JIT/HardwareIntrinsics/X86/Shared/ExtractVector128Test.template index 7765e86fe6..c9694647ba 100644 --- a/tests/src/JIT/HardwareIntrinsics/X86/Shared/ExtractVector128Test.template +++ b/tests/src/JIT/HardwareIntrinsics/X86/Shared/ExtractVector128Test.template @@ -266,7 +266,7 @@ namespace JIT.HardwareIntrinsics.X86 {Op1BaseType}[] inArray = new {Op1BaseType}[Op1ElementCount]; {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; - Unsafe.Write(Unsafe.AsPointer(ref inArray[0]), firstOp); + Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray[0]), firstOp); Unsafe.CopyBlockUnaligned(ref Unsafe.As<{RetBaseType}, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), VectorSize); ValidateResult(inArray, outArray, method); diff --git a/tests/src/JIT/HardwareIntrinsics/X86/Shared/GenericUnOpTest.template b/tests/src/JIT/HardwareIntrinsics/X86/Shared/GenericUnOpTest.template index 3285e506ff..a1947b54b7 100644 --- a/tests/src/JIT/HardwareIntrinsics/X86/Shared/GenericUnOpTest.template +++ b/tests/src/JIT/HardwareIntrinsics/X86/Shared/GenericUnOpTest.template @@ -262,7 +262,7 @@ namespace JIT.HardwareIntrinsics.X86 {Op1BaseType}[] inArray = new {Op1BaseType}[Op1ElementCount]; {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; - Unsafe.Write(Unsafe.AsPointer(ref inArray[0]), firstOp); + Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray[0]), firstOp); Unsafe.CopyBlockUnaligned(ref Unsafe.As<{RetBaseType}, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), VectorSize); ValidateResult(inArray, outArray, method); diff --git a/tests/src/JIT/HardwareIntrinsics/X86/Shared/HorizontalBinOpTest.template b/tests/src/JIT/HardwareIntrinsics/X86/Shared/HorizontalBinOpTest.template index bc05d9b04d..691bf58816 100644 --- a/tests/src/JIT/HardwareIntrinsics/X86/Shared/HorizontalBinOpTest.template +++ b/tests/src/JIT/HardwareIntrinsics/X86/Shared/HorizontalBinOpTest.template @@ -279,8 +279,8 @@ namespace JIT.HardwareIntrinsics.X86 {Op2BaseType}[] inArray2 = new {Op2BaseType}[Op2ElementCount]; {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; - Unsafe.Write(Unsafe.AsPointer(ref inArray1[0]), left); - Unsafe.Write(Unsafe.AsPointer(ref inArray2[0]), right); + Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray1[0]), left); + Unsafe.WriteUnaligned(ref Unsafe.As<{Op2BaseType}, byte>(ref inArray2[0]), right); Unsafe.CopyBlockUnaligned(ref Unsafe.As<{RetBaseType}, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), VectorSize); ValidateResult(inArray1, inArray2, outArray, method); diff --git a/tests/src/JIT/HardwareIntrinsics/X86/Shared/ImmBinOpTest.template b/tests/src/JIT/HardwareIntrinsics/X86/Shared/ImmBinOpTest.template index e24445932a..99cfe8ffd5 100644 --- a/tests/src/JIT/HardwareIntrinsics/X86/Shared/ImmBinOpTest.template +++ b/tests/src/JIT/HardwareIntrinsics/X86/Shared/ImmBinOpTest.template @@ -286,8 +286,8 @@ namespace JIT.HardwareIntrinsics.X86 {Op2BaseType}[] inArray2 = new {Op2BaseType}[Op2ElementCount]; {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; - Unsafe.Write(Unsafe.AsPointer(ref inArray1[0]), left); - Unsafe.Write(Unsafe.AsPointer(ref inArray2[0]), right); + Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray1[0]), left); + Unsafe.WriteUnaligned(ref Unsafe.As<{Op2BaseType}, byte>(ref inArray2[0]), right); Unsafe.CopyBlockUnaligned(ref Unsafe.As<{RetBaseType}, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), VectorSize); ValidateResult(inArray1, inArray2, outArray, method); diff --git a/tests/src/JIT/HardwareIntrinsics/X86/Shared/ImmUnOpTest.template b/tests/src/JIT/HardwareIntrinsics/X86/Shared/ImmUnOpTest.template index 6403add2cd..1889221102 100644 --- a/tests/src/JIT/HardwareIntrinsics/X86/Shared/ImmUnOpTest.template +++ b/tests/src/JIT/HardwareIntrinsics/X86/Shared/ImmUnOpTest.template @@ -266,7 +266,7 @@ namespace JIT.HardwareIntrinsics.X86 {Op1BaseType}[] inArray = new {Op1BaseType}[Op1ElementCount]; {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; - Unsafe.Write(Unsafe.AsPointer(ref inArray[0]), firstOp); + Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray[0]), firstOp); Unsafe.CopyBlockUnaligned(ref Unsafe.As<{RetBaseType}, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), VectorSize); ValidateResult(inArray, outArray, method); diff --git a/tests/src/JIT/HardwareIntrinsics/X86/Shared/InsertLoadTest.template b/tests/src/JIT/HardwareIntrinsics/X86/Shared/InsertLoadTest.template index 7759c8645b..8d44d2053e 100644 --- a/tests/src/JIT/HardwareIntrinsics/X86/Shared/InsertLoadTest.template +++ b/tests/src/JIT/HardwareIntrinsics/X86/Shared/InsertLoadTest.template @@ -288,7 +288,7 @@ namespace JIT.HardwareIntrinsics.X86 {Op2BaseType}[] inArray2 = new {Op2BaseType}[Op2ElementCount]; {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; - Unsafe.Write(Unsafe.AsPointer(ref inArray1[0]), left); + Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray1[0]), left); Unsafe.CopyBlockUnaligned(ref Unsafe.As<{Op2BaseType}, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(right), VectorSize); Unsafe.CopyBlockUnaligned(ref Unsafe.As<{RetBaseType}, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), VectorSize); diff --git a/tests/src/JIT/HardwareIntrinsics/X86/Shared/InsertScalarTest.template b/tests/src/JIT/HardwareIntrinsics/X86/Shared/InsertScalarTest.template index 22eaf24bdb..feb43564a1 100644 --- a/tests/src/JIT/HardwareIntrinsics/X86/Shared/InsertScalarTest.template +++ b/tests/src/JIT/HardwareIntrinsics/X86/Shared/InsertScalarTest.template @@ -280,7 +280,7 @@ namespace JIT.HardwareIntrinsics.X86 {Op1BaseType}[] inArray = new {Op1BaseType}[Op1ElementCount]; {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; - Unsafe.Write(Unsafe.AsPointer(ref inArray[0]), firstOp); + Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray[0]), firstOp); Unsafe.CopyBlockUnaligned(ref Unsafe.As<{RetBaseType}, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), VectorSize); ValidateResult(inArray, outArray, method); diff --git a/tests/src/JIT/HardwareIntrinsics/X86/Shared/InsertVector128Test.template b/tests/src/JIT/HardwareIntrinsics/X86/Shared/InsertVector128Test.template index 535ab774e6..5cba65f8d1 100644 --- a/tests/src/JIT/HardwareIntrinsics/X86/Shared/InsertVector128Test.template +++ b/tests/src/JIT/HardwareIntrinsics/X86/Shared/InsertVector128Test.template @@ -287,8 +287,8 @@ namespace JIT.HardwareIntrinsics.X86 {Op2BaseType}[] inArray2 = new {Op2BaseType}[Op2ElementCount]; {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; - Unsafe.Write(Unsafe.AsPointer(ref inArray1[0]), left); - Unsafe.Write(Unsafe.AsPointer(ref inArray2[0]), right); + Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray1[0]), left); + Unsafe.WriteUnaligned(ref Unsafe.As<{Op2BaseType}, byte>(ref inArray2[0]), right); Unsafe.CopyBlockUnaligned(ref Unsafe.As<{RetBaseType}, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), VectorSize); ValidateResult(inArray1, inArray2, outArray, method); diff --git a/tests/src/JIT/HardwareIntrinsics/X86/Shared/ScalarUnOpTest.template b/tests/src/JIT/HardwareIntrinsics/X86/Shared/ScalarUnOpTest.template index cb0b807147..b9ee8cba73 100644 --- a/tests/src/JIT/HardwareIntrinsics/X86/Shared/ScalarUnOpTest.template +++ b/tests/src/JIT/HardwareIntrinsics/X86/Shared/ScalarUnOpTest.template @@ -206,7 +206,7 @@ namespace JIT.HardwareIntrinsics.X86 {Op1BaseType}[] inArray = new {Op1BaseType}[Op1ElementCount]; {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; - Unsafe.Write(Unsafe.AsPointer(ref inArray[0]), firstOp); + Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray[0]), firstOp); Unsafe.CopyBlockUnaligned(ref Unsafe.As<{RetBaseType}, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), VectorSize); ValidateResult(inArray, outArray, method); diff --git a/tests/src/JIT/HardwareIntrinsics/X86/Shared/SimpleBinOpTest.template b/tests/src/JIT/HardwareIntrinsics/X86/Shared/SimpleBinOpTest.template index 8df00cedc1..0c759489c0 100644 --- a/tests/src/JIT/HardwareIntrinsics/X86/Shared/SimpleBinOpTest.template +++ b/tests/src/JIT/HardwareIntrinsics/X86/Shared/SimpleBinOpTest.template @@ -279,8 +279,8 @@ namespace JIT.HardwareIntrinsics.X86 {Op2BaseType}[] inArray2 = new {Op2BaseType}[Op2ElementCount]; {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; - Unsafe.Write(Unsafe.AsPointer(ref inArray1[0]), left); - Unsafe.Write(Unsafe.AsPointer(ref inArray2[0]), right); + Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray1[0]), left); + Unsafe.WriteUnaligned(ref Unsafe.As<{Op2BaseType}, byte>(ref inArray2[0]), right); Unsafe.CopyBlockUnaligned(ref Unsafe.As<{RetBaseType}, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), VectorSize); ValidateResult(inArray1, inArray2, outArray, method); diff --git a/tests/src/JIT/HardwareIntrinsics/X86/Shared/SimpleTernOpTest.template b/tests/src/JIT/HardwareIntrinsics/X86/Shared/SimpleTernOpTest.template index 6b62c21680..2544f4a677 100644 --- a/tests/src/JIT/HardwareIntrinsics/X86/Shared/SimpleTernOpTest.template +++ b/tests/src/JIT/HardwareIntrinsics/X86/Shared/SimpleTernOpTest.template @@ -299,9 +299,9 @@ namespace JIT.HardwareIntrinsics.X86 {Op3BaseType}[] inArray3 = new {Op3BaseType}[Op3ElementCount]; {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; - Unsafe.Write(Unsafe.AsPointer(ref inArray1[0]), firstOp); - Unsafe.Write(Unsafe.AsPointer(ref inArray2[0]), secondOp); - Unsafe.Write(Unsafe.AsPointer(ref inArray3[0]), thirdOp); + Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray1[0]), firstOp); + Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray2[0]), secondOp); + Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray3[0]), thirdOp); Unsafe.CopyBlockUnaligned(ref Unsafe.As<{RetBaseType}, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), VectorSize); ValidateResult(inArray1, inArray2, inArray3, outArray, method); diff --git a/tests/src/JIT/HardwareIntrinsics/X86/Shared/SimpleUnOpTest.template b/tests/src/JIT/HardwareIntrinsics/X86/Shared/SimpleUnOpTest.template index ff0098aff2..4c32d9cf98 100644 --- a/tests/src/JIT/HardwareIntrinsics/X86/Shared/SimpleUnOpTest.template +++ b/tests/src/JIT/HardwareIntrinsics/X86/Shared/SimpleUnOpTest.template @@ -259,7 +259,7 @@ namespace JIT.HardwareIntrinsics.X86 {Op1BaseType}[] inArray = new {Op1BaseType}[Op1ElementCount]; {RetBaseType}[] outArray = new {RetBaseType}[RetElementCount]; - Unsafe.Write(Unsafe.AsPointer(ref inArray[0]), firstOp); + Unsafe.WriteUnaligned(ref Unsafe.As<{Op1BaseType}, byte>(ref inArray[0]), firstOp); Unsafe.CopyBlockUnaligned(ref Unsafe.As<{RetBaseType}, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), VectorSize); ValidateResult(inArray, outArray, method); |