Skip to content

Commit 71574cd

Browse files
committed
Add simd_extmul_* support for x64
1 parent a83497e commit 71574cd

5 files changed

Lines changed: 495 additions & 21 deletions

File tree

build.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -190,12 +190,9 @@ fn x64_should_panic(testsuite: &str, testname: &str, strategy: &str) -> bool {
190190

191191
match (testsuite, testname) {
192192
("simd", "simd_i16x8_extadd_pairwise_i8x16") => return true,
193-
("simd", "simd_i16x8_extmul_i8x16") => return true,
194193
("simd", "simd_i16x8_q15mulr_sat_s") => return true,
195194
("simd", "simd_i32x4_extadd_pairwise_i16x8") => return true,
196-
("simd", "simd_i32x4_extmul_i16x8") => return true,
197195
("simd", "simd_i32x4_trunc_sat_f64x2") => return true,
198-
("simd", "simd_i64x2_extmul_i32x4") => return true,
199196
("simd", "simd_int_to_int_extend") => return true,
200197
("simd", _) => return false,
201198
_ => {}
@@ -229,10 +226,7 @@ fn ignore(testsuite: &str, testname: &str, strategy: &str) -> bool {
229226
// These are new instructions that are not really implemented in any backend.
230227
("simd", "simd_conversions")
231228
| ("simd", "simd_i16x8_extadd_pairwise_i8x16")
232-
| ("simd", "simd_i16x8_extmul_i8x16")
233-
| ("simd", "simd_i32x4_extadd_pairwise_i16x8")
234-
| ("simd", "simd_i32x4_extmul_i16x8")
235-
| ("simd", "simd_i64x2_extmul_i32x4") => return true,
229+
| ("simd", "simd_i32x4_extadd_pairwise_i16x8") => return true,
236230

237231
_ => {}
238232
},

cranelift/codegen/src/isa/x64/inst/args.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,9 @@ pub enum SseOpcode {
593593
Pmovzxwd,
594594
Pmovzxwq,
595595
Pmovzxdq,
596+
Pmuldq,
597+
Pmulhw,
598+
Pmulhuw,
596599
Pmulld,
597600
Pmullw,
598601
Pmuludq,
@@ -617,7 +620,9 @@ pub enum SseOpcode {
617620
Psubusw,
618621
Ptest,
619622
Punpckhbw,
623+
Punpckhwd,
620624
Punpcklbw,
625+
Punpcklwd,
621626
Pxor,
622627
Rcpss,
623628
Roundps,
@@ -742,6 +747,8 @@ impl SseOpcode {
742747
| SseOpcode::Pminsw
743748
| SseOpcode::Pminub
744749
| SseOpcode::Pmovmskb
750+
| SseOpcode::Pmulhw
751+
| SseOpcode::Pmulhuw
745752
| SseOpcode::Pmullw
746753
| SseOpcode::Pmuludq
747754
| SseOpcode::Por
@@ -763,7 +770,9 @@ impl SseOpcode {
763770
| SseOpcode::Psubusb
764771
| SseOpcode::Psubusw
765772
| SseOpcode::Punpckhbw
773+
| SseOpcode::Punpckhwd
766774
| SseOpcode::Punpcklbw
775+
| SseOpcode::Punpcklwd
767776
| SseOpcode::Pxor
768777
| SseOpcode::Sqrtpd
769778
| SseOpcode::Sqrtsd
@@ -808,6 +817,7 @@ impl SseOpcode {
808817
| SseOpcode::Pmovzxwd
809818
| SseOpcode::Pmovzxwq
810819
| SseOpcode::Pmovzxdq
820+
| SseOpcode::Pmuldq
811821
| SseOpcode::Pmulld
812822
| SseOpcode::Ptest
813823
| SseOpcode::Roundps
@@ -953,6 +963,9 @@ impl fmt::Debug for SseOpcode {
953963
SseOpcode::Pmovzxwd => "pmovzxwd",
954964
SseOpcode::Pmovzxwq => "pmovzxwq",
955965
SseOpcode::Pmovzxdq => "pmovzxdq",
966+
SseOpcode::Pmuldq => "pmuldq",
967+
SseOpcode::Pmulhw => "pmulhw",
968+
SseOpcode::Pmulhuw => "pmulhuw",
956969
SseOpcode::Pmulld => "pmulld",
957970
SseOpcode::Pmullw => "pmullw",
958971
SseOpcode::Pmuludq => "pmuludq",
@@ -977,7 +990,9 @@ impl fmt::Debug for SseOpcode {
977990
SseOpcode::Psubusw => "psubusw",
978991
SseOpcode::Ptest => "ptest",
979992
SseOpcode::Punpckhbw => "punpckhbw",
993+
SseOpcode::Punpckhwd => "punpckhwd",
980994
SseOpcode::Punpcklbw => "punpcklbw",
995+
SseOpcode::Punpcklwd => "punpcklwd",
981996
SseOpcode::Pxor => "pxor",
982997
SseOpcode::Rcpss => "rcpss",
983998
SseOpcode::Roundps => "roundps",

cranelift/codegen/src/isa/x64/inst/emit.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1509,6 +1509,9 @@ pub(crate) fn emit(
15091509
SseOpcode::Pminub => (LegacyPrefixes::_66, 0x0FDA, 2),
15101510
SseOpcode::Pminuw => (LegacyPrefixes::_66, 0x0F383A, 3),
15111511
SseOpcode::Pminud => (LegacyPrefixes::_66, 0x0F383B, 3),
1512+
SseOpcode::Pmuldq => (LegacyPrefixes::_66, 0x0F3828, 3),
1513+
SseOpcode::Pmulhw => (LegacyPrefixes::_66, 0x0FE5, 2),
1514+
SseOpcode::Pmulhuw => (LegacyPrefixes::_66, 0x0FE4, 2),
15121515
SseOpcode::Pmulld => (LegacyPrefixes::_66, 0x0F3840, 3),
15131516
SseOpcode::Pmullw => (LegacyPrefixes::_66, 0x0FD5, 2),
15141517
SseOpcode::Pmuludq => (LegacyPrefixes::_66, 0x0FF4, 2),
@@ -1523,7 +1526,9 @@ pub(crate) fn emit(
15231526
SseOpcode::Psubusb => (LegacyPrefixes::_66, 0x0FD8, 2),
15241527
SseOpcode::Psubusw => (LegacyPrefixes::_66, 0x0FD9, 2),
15251528
SseOpcode::Punpckhbw => (LegacyPrefixes::_66, 0x0F68, 2),
1529+
SseOpcode::Punpckhwd => (LegacyPrefixes::_66, 0x0F69, 2),
15261530
SseOpcode::Punpcklbw => (LegacyPrefixes::_66, 0x0F60, 2),
1531+
SseOpcode::Punpcklwd => (LegacyPrefixes::_66, 0x0F61, 2),
15271532
SseOpcode::Pxor => (LegacyPrefixes::_66, 0x0FEF, 2),
15281533
SseOpcode::Subps => (LegacyPrefixes::None, 0x0F5C, 2),
15291534
SseOpcode::Subpd => (LegacyPrefixes::_66, 0x0F5C, 2),

0 commit comments

Comments
 (0)