Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove MMX from Rust #76295

Merged
merged 1 commit into from
Sep 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion compiler/rustc_codegen_llvm/src/llvm/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,6 @@ extern "C" {

// Operations on other types
pub fn LLVMVoidTypeInContext(C: &Context) -> &Type;
pub fn LLVMX86MMXTypeInContext(C: &Context) -> &Type;
pub fn LLVMRustMetadataTypeInContext(C: &Context) -> &Type;

// Operations on all values
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_codegen_llvm/src/llvm_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ const X86_ALLOWED_FEATURES: &[(&str, Option<Symbol>)] = &[
("fma", None),
("fxsr", None),
("lzcnt", None),
("mmx", Some(sym::mmx_target_feature)),
("movbe", Some(sym::movbe_target_feature)),
("pclmulqdq", None),
("popcnt", None),
Expand Down
4 changes: 0 additions & 4 deletions compiler/rustc_codegen_llvm/src/type_.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@ impl CodegenCx<'ll, 'tcx> {
unsafe { llvm::LLVMIntTypeInContext(self.llcx, num_bits as c_uint) }
}

crate fn type_x86_mmx(&self) -> &'ll Type {
unsafe { llvm::LLVMX86MMXTypeInContext(self.llcx) }
}

crate fn type_vector(&self, ty: &'ll Type, len: u64) -> &'ll Type {
unsafe { llvm::LLVMVectorType(ty, len as c_uint) }
}
Expand Down
19 changes: 2 additions & 17 deletions compiler/rustc_codegen_llvm/src/type_of.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,8 @@ fn uncached_llvm_type<'a, 'tcx>(
match layout.abi {
Abi::Scalar(_) => bug!("handled elsewhere"),
Abi::Vector { ref element, count } => {
// LLVM has a separate type for 64-bit SIMD vectors on X86 called
// `x86_mmx` which is needed for some SIMD operations. As a bit of a
// hack (all SIMD definitions are super unstable anyway) we
// recognize any one-element SIMD vector as "this should be an
// x86_mmx" type. In general there shouldn't be a need for other
// one-element SIMD vectors, so it's assumed this won't clash with
// much else.
let use_x86_mmx = count == 1
&& layout.size.bits() == 64
&& (cx.sess().target.target.arch == "x86"
|| cx.sess().target.target.arch == "x86_64");
if use_x86_mmx {
return cx.type_x86_mmx();
} else {
let element = layout.scalar_llvm_type_at(cx, element, Size::ZERO);
return cx.type_vector(element, count);
}
let element = layout.scalar_llvm_type_at(cx, element, Size::ZERO);
return cx.type_vector(element, count);
}
Abi::ScalarPair(..) => {
return cx.type_struct(
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_feature/src/active.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,6 @@ declare_features! (
(active, powerpc_target_feature, "1.27.0", Some(44839), None),
(active, mips_target_feature, "1.27.0", Some(44839), None),
(active, avx512_target_feature, "1.27.0", Some(44839), None),
(active, mmx_target_feature, "1.27.0", Some(44839), None),
(active, sse4a_target_feature, "1.27.0", Some(44839), None),
(active, tbm_target_feature, "1.27.0", Some(44839), None),
(active, wasm_target_feature, "1.30.0", Some(44839), None),
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_span/src/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,6 @@ symbols! {
minnumf32,
minnumf64,
mips_target_feature,
mmx_target_feature,
module,
module_path,
more_struct_aliases,
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_typeck/src/collect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2361,7 +2361,6 @@ fn from_target_feature(
Some(sym::mips_target_feature) => rust_features.mips_target_feature,
Some(sym::riscv_target_feature) => rust_features.riscv_target_feature,
Some(sym::avx512_target_feature) => rust_features.avx512_target_feature,
Some(sym::mmx_target_feature) => rust_features.mmx_target_feature,
Some(sym::sse4a_target_feature) => rust_features.sse4a_target_feature,
Some(sym::tbm_target_feature) => rust_features.tbm_target_feature,
Some(sym::wasm_target_feature) => rust_features.wasm_target_feature,
Expand Down
1 change: 0 additions & 1 deletion library/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@
#![feature(unwind_attributes)]
#![feature(variant_count)]
#![cfg_attr(bootstrap, feature(doc_alias))]
#![feature(mmx_target_feature)]
#![feature(tbm_target_feature)]
#![feature(sse4a_target_feature)]
#![feature(arm_target_feature)]
Expand Down
27 changes: 0 additions & 27 deletions src/test/codegen/x86_mmx.rs

This file was deleted.

4 changes: 2 additions & 2 deletions src/test/ui/auxiliary/using-target-feature-unstable.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![feature(mmx_target_feature)]
#![feature(avx512_target_feature)]

#[inline]
#[target_feature(enable = "mmx")]
#[target_feature(enable = "avx512ifma")]
pub unsafe fn foo() {}
4 changes: 1 addition & 3 deletions src/test/ui/target-feature/gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
// gate-test-aarch64_target_feature
// gate-test-hexagon_target_feature
// gate-test-mips_target_feature
// gate-test-mmx_target_feature
// gate-test-wasm_target_feature
// gate-test-adx_target_feature
// gate-test-cmpxchg16b_target_feature
Expand All @@ -30,7 +29,6 @@

#[target_feature(enable = "avx512bw")]
//~^ ERROR: currently unstable
unsafe fn foo() {
}
unsafe fn foo() {}

fn main() {}
2 changes: 1 addition & 1 deletion src/test/ui/target-feature/gate.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0658]: the target feature `avx512bw` is currently unstable
--> $DIR/gate.rs:31:18
--> $DIR/gate.rs:30:18
|
LL | #[target_feature(enable = "avx512bw")]
| ^^^^^^^^^^^^^^^^^^^
Expand Down