public static unsafe int test_0_ldind() { byte *ptr = stackalloc byte [20]; for (int i = 0; i < 20; ++i) { ptr [i] = (byte)i; } if (Intrinsics.UnalignedLdInd2(ptr + 0) != 0x0100) { return(1); } if (Intrinsics.UnalignedLdInd2(ptr + 1) != 0x0201) { return(2); } if (Intrinsics.UnalignedLdInd2(ptr + 2) != 0x0302) { return(3); } if (Intrinsics.UnalignedLdInd4(ptr + 1) != 0x04030201) { return(4); } if (Intrinsics.UnalignedLdInd4(ptr + 2) != 0x05040302) { return(5); } if (Intrinsics.UnalignedLdInd8(ptr + 1) != 0x0807060504030201) { return(6); } if (Intrinsics.UnalignedLdInd8(ptr + 6) != 0xD0C0B0A09080706) { return(7); } return(0); }
public static unsafe int test_0_ldind() { byte *ptr = stackalloc byte [20]; for (int i = 0; i < 20; ++i) { ptr [i] = (byte)i; } if (BitConverter.IsLittleEndian) { if (Intrinsics.UnalignedLdInd2(ptr + 0) != 0x0100) { return(1); } if (Intrinsics.UnalignedLdInd2(ptr + 1) != 0x0201) { return(2); } if (Intrinsics.UnalignedLdInd2(ptr + 2) != 0x0302) { return(3); } if (Intrinsics.UnalignedLdInd4(ptr + 1) != 0x04030201) { return(4); } if (Intrinsics.UnalignedLdInd4(ptr + 2) != 0x05040302) { return(5); } if (Intrinsics.UnalignedLdInd8(ptr + 1) != 0x0807060504030201) { return(6); } if (Intrinsics.UnalignedLdInd8(ptr + 6) != 0xD0C0B0A09080706) { return(7); } } else { if (Intrinsics.UnalignedLdInd2(ptr + 0) != 0x0001) { return(1); } if (Intrinsics.UnalignedLdInd2(ptr + 1) != 0x0102) { return(2); } if (Intrinsics.UnalignedLdInd2(ptr + 2) != 0x0203) { return(3); } if (Intrinsics.UnalignedLdInd4(ptr + 1) != 0x01020304) { return(4); } if (Intrinsics.UnalignedLdInd4(ptr + 2) != 0x02030405) { return(5); } if (Intrinsics.UnalignedLdInd8(ptr + 1) != 0x0102030405060708) { return(6); } if (Intrinsics.UnalignedLdInd8(ptr + 6) != 0x60708090A0B0C0D) { return(7); } } return(0); }