mozilla/rust — pull request #12917 by DiamondLovesYou (2014-03-15 19:17:45+00:00)
Title: More ergonomic multiple-data expressions.

### The gist:
```rust
#[phase(syntax)] extern crate simd_syntax;
extern crate simd;
use simd::{Simd, i32x8};
// Two new expressions, with inference:
let v = gather_simd!(1, 2, 3, 4);
let w = swizzle_simd!(v -> (3, 2, 1, 0));
let x: i32x8 = swizzle_simd!(v .. w -> (0, 7, 1, 6, 2, 5, 3, 4));
// multiple-data compare:
let cond = (x == gather_simd!(1, 1, 2, 2, 3, 3, 4, 4));
assert!(cond.every_true());

// New type (libsimd defines all the types anyone would realistically need,
// so most users won't need to use this):
def_type_simd!(pub type f32x4 = ;)
def_type_simd!(pub struct i32x4();)
```
I should emphasize that there are no parse changes in this PR; I choose to expose the ergonomics with a syntax extension so others can use a different syntax than the one provided in libsimd_syntax, hopefully without too much issue.

### Pre-merge FIXME's (off the top of my head):
* Moar tests.
* Documentation.
* Drop single instruction-ness in nomenclature. This feature makes no such guarantee anyway.
* Transition to single expression w/ opcode.
* Remove std::unstable::simd.
* #[deriving] for single-element struct tuples wrapping multiple-data types.

I wouldn't call this ready to be merged; as per the FIXME's I've still got work to do. However, I'd very much like some feedback!