Skip to content

Commit 0cd41b9

Browse files
committed
add some more CRC tests
1 parent 7557177 commit 0cd41b9

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/tools/miri/tests/pass/shims/x86/intrinsics-x86-sse42.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ unsafe fn test_crc() {
4545
let v = 0xef;
4646
let i = _mm_crc32_u8(crc, v);
4747
assert_eq!(i, 0xb95511db);
48+
49+
let crc = 0xbadeafe;
50+
let v = 0xc0;
51+
let i = _mm_crc32_u8(crc, v);
52+
assert_eq!(i, 0x9c905b7c);
4853
}
4954
test_mm_crc32_u8();
5055

@@ -59,6 +64,11 @@ unsafe fn test_crc() {
5964
let v = 0xa6c0;
6065
let i = _mm_crc32_u16(crc, v);
6166
assert_eq!(i, 0xab04fe4e);
67+
68+
let crc = 0xbadeafe;
69+
let v = 0xc0fe;
70+
let i = _mm_crc32_u16(crc, v);
71+
assert_eq!(i, 0x4b5fad4b);
6272
}
6373
test_mm_crc32_u16();
6474

@@ -73,6 +83,11 @@ unsafe fn test_crc() {
7383
let v = 0x885585c2;
7484
let i = _mm_crc32_u32(crc, v);
7585
assert_eq!(i, 0x22443a7b);
86+
87+
let crc = 0xbadeafe;
88+
let v = 0xc0febeef;
89+
let i = _mm_crc32_u32(crc, v);
90+
assert_eq!(i, 0xb309502f);
7691
}
7792
test_mm_crc32_u32();
7893

@@ -88,6 +103,11 @@ unsafe fn test_crc() {
88103
let v = 0x1a7ea8fb571746b0;
89104
let i = _mm_crc32_u64(crc, v);
90105
assert_eq!(i, 0x315b4f6);
106+
107+
let crc = 0xbadeafe;
108+
let v = 0xc0febeefdadafefe;
109+
let i = _mm_crc32_u64(crc, v);
110+
assert_eq!(i, 0x5b44f54f);
91111
}
92112
#[cfg(not(target_arch = "x86_64"))]
93113
unsafe fn test_mm_crc32_u64() {}

0 commit comments

Comments
 (0)