-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
x86-sse2 ABI: use SSE registers for floats and SIMD
- Loading branch information
Showing
14 changed files
with
273 additions
and
151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
//@ compile-flags: -Z merge-functions=disabled | ||
|
||
//@ revisions: x86-64 | ||
//@[x86-64] compile-flags: --target x86_64-unknown-linux-gnu | ||
//@[x86-64] needs-llvm-components: x86 | ||
|
||
//@ revisions: x86-32 | ||
//@[x86-32] compile-flags: --target i686-unknown-linux-gnu | ||
//@[x86-32] needs-llvm-components: x86 | ||
|
||
//@ revisions: x86-32-nosse | ||
//@[x86-32-nosse] compile-flags: --target i586-unknown-linux-gnu | ||
//@[x86-32-nosse] needs-llvm-components: x86 | ||
|
||
#![feature(no_core, lang_items, rustc_attrs, repr_simd)] | ||
#![no_core] | ||
#![crate_type = "lib"] | ||
|
||
#[lang = "sized"] | ||
trait Sized {} | ||
|
||
#[lang = "copy"] | ||
trait Copy {} | ||
|
||
// Ensure this type is passed without ptr indirection on targets that | ||
// require SSE2. | ||
#[repr(simd)] | ||
pub struct Sse([f32; 4]); | ||
|
||
// x86-64: <4 x float> @sse_id(<4 x float> {{[^,]*}}) | ||
// x86-32: <4 x float> @sse_id(<4 x float> {{[^,]*}}) | ||
// x86-32-nosse: void @sse_id(ptr{{( [^,]*)?}} sret([16 x i8]){{( .*)?}}, ptr{{( [^,]*)?}}) | ||
#[no_mangle] | ||
pub fn sse_id(x: Sse) -> Sse { | ||
x | ||
} |
Oops, something went wrong.