Skip to content

Commit

Permalink
XOP Part 1: fma, hadd, and shifts-rotates
Browse files Browse the repository at this point in the history
Added testing support for xop. Intel SDE doesn't support XOP, so we need qemu for that.
  • Loading branch information
sayantn committed Aug 1, 2024
1 parent fb90dfa commit c24c6b8
Show file tree
Hide file tree
Showing 6 changed files with 1,107 additions and 11 deletions.
11 changes: 4 additions & 7 deletions ci/docker/x86_64-unknown-linux-gnu-emulated/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
file \
make \
ca-certificates \
wget \
xz-utils
qemu-system

RUN wget https://downloadmirror.intel.com/813591/sde-external-9.33.0-2024-01-07-lin.tar.xz
RUN tar -xJf sde-external-9.33.0-2024-01-07-lin.tar.xz
ENV CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER="/sde-external-9.33.0-2024-01-07-lin/sde64 \
-cpuid-in /checkout/ci/docker/x86_64-unknown-linux-gnu-emulated/cpuid.def \
-rtm-mode full -tsx --"
RUN lscpu
RUN chown root:kvm /dev/kvm
ENV CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER="qemu-system-x86_64 -enable-kvm -cpu max -nographic -kernel"
4 changes: 2 additions & 2 deletions ci/docker/x86_64-unknown-linux-gnu-emulated/cpuid.def
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
0000001e ******** => 00000000 00004010 00000000 00000000 #AMX Tmul
00000024 ******** => 00000000 00070001 00000000 00000000 #AVX10
80000000 ******** => 80000008 00000000 00000000 00000000
80000001 ******** => 00000000 00000000 00200961 2c100000
80000001 ******** => 00000000 00000000 00200161 2c100000
80000002 ******** => 00000000 00000000 00000000 00000000
80000003 ******** => 00000000 00000000 00000000 00000000
80000004 ******** => 00000000 00000000 00000000 00000000
Expand All @@ -57,5 +57,5 @@
80000008 ******** => 00003028 00000200 00000200 00000000

# This file was copied from intel-sde/misc/cpuid/future/cpuid.def, and modified to
# use "AuthenticAMD" as the vendor and the support for `XOP`, `SSE4a`, `TBM` and
# use "AuthenticAMD" as the vendor and the support for `SSE4a`, `TBM` and
# `AVX512_VP2INTERSECT` was added in the CPUID.
3 changes: 2 additions & 1 deletion crates/core_arch/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
generic_arg_infer,
asm_experimental_arch,
sha512_sm_x86,
f16
f16,
xop_target_feature
)]
#![cfg_attr(test, feature(test, abi_vectorcall, stdarch_internal))]
#![deny(clippy::missing_inline_in_public_items)]
Expand Down
9 changes: 9 additions & 0 deletions crates/core_arch/src/x86/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,11 @@ pub type _MM_MANTISSA_SIGN_ENUM = i32;
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
pub type _MM_PERM_ENUM = i32;

/// The `_MM_PCOMCTRL_ENUM` type used to specify comparison control operations in XOP intrinsics.
#[allow(non_camel_case_types)]
#[unstable(feature = "xop_target_feature", issue = "127208")]
pub type _MM_PCOMCTRL_ENUM = i32;

#[cfg(test)]
mod test;
#[cfg(test)]
Expand Down Expand Up @@ -1008,3 +1013,7 @@ pub use self::avxneconvert::*;
mod avx512fp16;
#[unstable(feature = "stdarch_x86_avx512_f16", issue = "127213")]
pub use self::avx512fp16::*;

mod xop;
#[unstable(feature = "xop_target_feature", issue = "127208")]
pub use self::xop::*;
Loading

0 comments on commit c24c6b8

Please sign in to comment.