-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
207 additions
and
27 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2126,6 +2126,7 @@ symbols! { | |
vec_pop, | ||
vec_with_capacity, | ||
vecdeque_iter, | ||
vector, | ||
version, | ||
vfp2, | ||
vis, | ||
|
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
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,113 @@ | ||
//@ revisions: z10 z10_vector z13 z13_no_vector | ||
//@ assembly-output: emit-asm | ||
//@ compile-flags: -O | ||
//@[z10] compile-flags: --target s390x-unknown-linux-gnu --cfg no_vector | ||
//@[z10] needs-llvm-components: systemz | ||
//@[z10_vector] compile-flags: --target s390x-unknown-linux-gnu --cfg vector | ||
//@[z10_vector] needs-llvm-components: systemz | ||
//@[z13] compile-flags: --target s390x-unknown-linux-gnu -C target-cpu=z13 --cfg vector | ||
//@[z13] needs-llvm-components: systemz | ||
//@[z13_no_vector] compile-flags: --target s390x-unknown-linux-gnu -C target-cpu=z13 -C target-feature=-vector --cfg no_vector | ||
//@[z13_no_vector] needs-llvm-components: systemz | ||
|
||
#![feature(no_core, lang_items, repr_simd)] | ||
#![no_core] | ||
#![crate_type = "lib"] | ||
#![allow(non_camel_case_types)] | ||
|
||
#[lang = "sized"] | ||
trait Sized {} | ||
#[lang = "copy"] | ||
trait Copy {} | ||
#[lang = "freeze"] | ||
trait Freeze {} | ||
|
||
impl<T: Copy, const N: usize> Copy for [T; N] {} | ||
|
||
#[repr(simd)] | ||
pub struct i8x8([i8; 8]); | ||
#[repr(simd)] | ||
pub struct i8x16([i8; 16]); | ||
#[repr(simd)] | ||
pub struct i8x32([i8; 32]); | ||
pub struct Wrapper<T>(T); | ||
|
||
impl Copy for i8 {} | ||
impl Copy for i8x8 {} | ||
impl Copy for i8x16 {} | ||
impl Copy for i8x32 {} | ||
impl<T: Copy> Copy for Wrapper<T> {} | ||
|
||
// FIXME: ?? | ||
// CHECK-LABEL: vector_small | ||
// no_vector: lg %r0, 0(%r3) | ||
// no_vector-NEXT: stg %r0, 0(%r2) | ||
// no_vector-NEXT: br %r14 | ||
// vector: vlrepg %v24, 0(%r2) | ||
// vector-NEXT: br %r14 | ||
#[no_mangle] | ||
extern "C" fn vector_small(x: &i8x8) -> i8x8 { | ||
*x | ||
} | ||
// CHECK-LABEL: vector | ||
// no_vector: mvc 8(8,%r2), 8(%r3) | ||
// no_vector-NEXT: mvc 0(8,%r2), 0(%r3) | ||
// no_vector-NEXT: br %r14 | ||
// vector: vl %v24, 0(%r2), 3 | ||
// vector-NEXT: br %r14 | ||
#[no_mangle] | ||
extern "C" fn vector(x: &i8x16) -> i8x16 { | ||
*x | ||
} | ||
// CHECK-LABEL: vector_large | ||
// no_vector: mvc 24(8,%r2), 24(%r3) | ||
// no_vector-NEXT: mvc 16(8,%r2), 16(%r3) | ||
// no_vector-NEXT: mvc 8(8,%r2), 8(%r3) | ||
// no_vector-NEXT: mvc 0(8,%r2), 0(%r3) | ||
// no_vector-NEXT: br %r14 | ||
// vector: vl %v0, 0(%r3), 4 | ||
// vector-NEXT: vl %v1, 16(%r3), 4 | ||
// vector-NEXT: vst %v1, 16(%r2), 4 | ||
// vector-NEXT: vst %v0, 0(%r2), 4 | ||
// vector-NEXT: br %r14 | ||
#[no_mangle] | ||
extern "C" fn vector_large(x: &i8x32) -> i8x32 { | ||
*x | ||
} | ||
|
||
// FIXME: ?? | ||
// CHECK-LABEL: vector_wrapper_small | ||
// no_vector: lg %r0, 0(%r3) | ||
// no_vector-NEXT: stg %r0, 0(%r2) | ||
// no_vector-NEXT: br %r14 | ||
// vector: vlrepg %v24, 0(%r2) | ||
// vector-NEXT: br %r14 | ||
#[no_mangle] | ||
extern "C" fn vector_wrapper_small(x: &Wrapper<i8x8>) -> Wrapper<i8x8> { | ||
*x | ||
} | ||
// CHECK-LABEL: vector_wrapper | ||
// no_vector: mvc 8(8,%r2), 8(%r3) | ||
// no_vector-NEXT: mvc 0(8,%r2), 0(%r3) | ||
// no_vector-NEXT: br %r14 | ||
// vector: vl %v24, 0(%r2), 3 | ||
// vector-NEXT: br %r14 | ||
#[no_mangle] | ||
extern "C" fn vector_wrapper(x: &Wrapper<i8x16>) -> Wrapper<i8x16> { | ||
*x | ||
} | ||
// CHECK-LABEL: vector_wrapper_large | ||
// no_vector: mvc 24(8,%r2), 24(%r3) | ||
// no_vector-NEXT: mvc 16(8,%r2), 16(%r3) | ||
// no_vector-NEXT: mvc 8(8,%r2), 8(%r3) | ||
// no_vector-NEXT: mvc 0(8,%r2), 0(%r3) | ||
// no_vector-NEXT: br %r14 | ||
// vector: vl %v0, 0(%r3), 4 | ||
// vector-NEXT: vl %v1, 16(%r3), 4 | ||
// vector-NEXT: vst %v1, 16(%r2), 4 | ||
// vector-NEXT: vst %v0, 0(%r2), 4 | ||
// vector-NEXT: br %r14 | ||
#[no_mangle] | ||
extern "C" fn vector_wrapper_large(x: &Wrapper<i8x32>) -> Wrapper<i8x32> { | ||
*x | ||
} |