Commit graph

88 commits

Author SHA1 Message Date
Alex Crichton
b8bcdd93c6 Always test intrinsics unconditionally
This commit alters the test suite to unconditionally compile and run all tests,
regardless of the ambient target features enabled. This then uses a new
convenience macro, `#[simd_test]`, to guard all tests with the appropriate
`cfg_feature_enabled!` and also enable the `#[target_feature]` appropriately.
2017-09-26 14:38:58 -07:00
Alex Crichton
299b2f3c29 Merge pull request #41 from alexcrichton/assert-small
Assert that diassembly is "small"
2017-09-25 16:10:36 -05:00
Alex Crichton
e5a98843b4 Assert that diassembly is "small"
There's a lot of trickery in this crate which expands to a lot of code, so in
addition to asserting that we find the right instruction, let's assert we find
a small function as well (as these should all be just one or so instructions
anyway).
2017-09-25 13:55:48 -07:00
Alex Crichton
58119db1a0 Fix link in README 2017-09-25 13:45:00 -07:00
Alex Crichton
1d22fe36b9 Update CONTRIBUTING 2017-09-25 13:44:20 -07:00
Alex Crichton
a03935143f Add links to docs 2017-09-25 13:39:02 -07:00
Alex Crichton
b44d388d88 Add aarch64 docs 2017-09-25 13:38:12 -07:00
Alex Crichton
d978ac4c81 Write some short crate docs 2017-09-25 13:36:32 -07:00
Alex Crichton
f7a3fd65fd Add some doc urls 2017-09-25 13:18:52 -07:00
Alex Crichton
a5d562faba No need to debug so much 2017-09-25 13:17:41 -07:00
Alex Crichton
f17ac643a1 Tweak dox script 2017-09-25 13:15:32 -07:00
Alex Crichton
145a8694e1 Remove stray dir 2017-09-25 13:13:59 -07:00
Alex Crichton
63b5c09168 Add documentation generation 2017-09-25 13:13:01 -07:00
Alex Crichton
bcd2d9aa30 Update the README with some extra badges and info 2017-09-25 13:02:32 -07:00
Alex Crichton
903ed4f602 Add license files
Closes #12
2017-09-25 12:43:06 -07:00
Alex Crichton
d30ac624f8 Merge pull request #31 from gnzlbg/runtime_detection
[runtime] initial run-time feature detection support
2017-09-25 14:09:26 -05:00
Alex Crichton
4d504a7767 Merge pull request #38 from kocsis1david/master
Some SSE instructions
2017-09-25 14:05:38 -05:00
Alex Crichton
d888d2d350 Merge pull request #36 from alexcrichton/arm-ci
Add CI for more platforms
2017-09-25 14:04:33 -05:00
Dávid Kocsis
1d3f72c336 Some SSE instruction 2017-09-22 22:19:45 +02:00
Dávid Kocsis
ca55004659 Merge remote-tracking branch 'upstream/master' 2017-09-22 21:00:21 +02:00
Alex Crichton
5a8887b0c0 Add CI for more platforms
This commit adds CI for a few more targets:

* i686-unknown-linux-gnu
* arm-unknown-linux-gnueabihf
* armv7-unknown-linux-gnueabihf
* aarch64-unknown-linux-gnu

The CI here is structured around using a Docker container to set up a test
environment and then QEMU is used to actually execute code from these platforms.
QEMU's emulation actually makes it so we can continue to just use `cargo test`,
as processes can be spawned from QEMU like `objdump` and files can be read (for
libbacktrace). Ends up being a relatively seamless experience!

Note that a number of intrinsics were disabled on i686 because they were failing
tests, and otherwise a few ARM touch-ups were made to get tests passing.
2017-09-21 12:35:46 -07:00
Alex Crichton
119c205632 Merge pull request #29 from gnzlbg/arm_intrinsics
[arm] bitwise manipulation instructions
2017-09-21 11:24:58 -05:00
Alex Crichton
f1f513d461 Fix Windows MSVC CI
Pass the `/OPT:NOICF` flag to the linker to ensure that all functions don't get
eliminated (somethign we don't want in this scenario)
2017-09-21 09:24:15 -07:00
Alex Crichton
c77c903e88 Help debug missing assembly 2017-09-21 07:32:37 -07:00
gnzlbg
0ab8c0600d [assert-instr] simplify 2017-09-21 16:14:16 +02:00
gnzlbg
868399bcc4 [appveyor] enable panic backtraces 2017-09-21 13:49:03 +02:00
gnzlbg
4e52b8641a Merge branch 'master' into runtime_detection 2017-09-21 13:09:46 +02:00
gnzlbg
800b43ec59 [assert-instr] compare only the instruction prefix
When comparing the assembly instructions against
the expected instruction, depending on the platform,
we might end up with `tzcntl != tzcnt`. This
commit truncates the instructions to the length
of the expected instruction, such that `tzcntl => tzcnt`
and the comparison succeeds.
2017-09-21 09:34:06 +02:00
gnzlbg
bbeec63f52 [bmi] add some more code-gen tests 2017-09-21 09:07:52 +02:00
gnzlbg
53540f0eee [arm] bitwise manipulation instructions 2017-09-20 21:53:21 +02:00
gnzlbg
7ac777c523 remove explicit discriminant values 2017-09-20 20:56:33 +02:00
gnzlbg
0dc630020a [runtime] initial run-time feature detection support 2017-09-20 20:25:37 +02:00
Alex Crichton
8c89593883 Merge pull request #32 from alexcrichton/tests2
Migrate existing tests to #[assert_instr]
2017-09-20 12:33:41 -05:00
Alex Crichton
124f731ce2 Migrate existing tests to #[assert_instr]
Also add some documentation to the assert_instr infrastructure
2017-09-20 10:29:39 -07:00
Alex Crichton
5e8f0e72b5 Merge pull request #28 from alexcrichton/tests
Add assertions correct instructions are generated
2017-09-20 12:01:51 -05:00
Alex Crichton
ba7f62715a Add assertions correct instructions are generated
This commit adds a procedural macro which can be used to test instruction
generation in a lightweight way. The intention is that all functions are
annotated with:

    #[cfg_attr(test, assert_instr(maxps))]
    fn foo(...) {
        // ...
    }

and then during `cargo test --release` it'll assert the function `foo` does
indeed generate the instruction `maxps`. This only activates tests in optimized
mode to avoid debug mode inefficiencies, and it uses a literal invocation of
`objdump` and some parsing to figure out what instructions are inside each
function. Finally it also uses the `backtrace` crate to figure out the symbol
name of the relevant function and hook that up to the output of `objdump`.

I added a few assertions in the `sse` module to get some feedback, but curious
what y'all think of this!
2017-09-20 09:57:43 -07:00
Dávid Kocsis
fe5d8f939f SSE4.1 dot product instructions 2017-09-20 12:35:43 -04:00
Mohan Rajendran
9b96985000 Added _mm_unpackhi_ps function (#16)
Added _mm_unpackhi_ps
2017-09-20 06:50:06 -04:00
Dávid Kocsis
d6dceccb33 SSE4.1 dot product instructions 2017-09-20 07:30:40 +02:00
gnzlbg
e64f80e479 [abm] use lzcnt and popcnt features 2017-09-19 17:10:00 -04:00
gnzlbg
08a890a0a0 [tbm] check generated code 2017-09-19 17:10:00 -04:00
gnzlbg
59f6e21751 nitpicks, whitespace, etc 2017-09-19 17:10:00 -04:00
gnzlbg
4f1f53b707 [bmi] check assembly of bmi instructions 2017-09-19 17:10:00 -04:00
gnzlbg
cb1db00983 [abm] check generated assembly 2017-09-19 17:10:00 -04:00
gnzlbg
9483950d3e [bmi2] check generated assembly 2017-09-19 17:10:00 -04:00
gnzlbg
21091b0d71 [bmi] export all intrinsics 2017-09-19 17:10:00 -04:00
gnzlbg
4446e941ed [bmi] use llvm intrinsics instead of platform-intrinsic 2017-09-19 17:10:00 -04:00
gnzlbg
5c483e3773 [tbm] adds all tbm intrinsics 2017-09-19 17:10:00 -04:00
gnzlbg
c66003d259 [bmi] add module-level docs to bmi and bmi2 modules 2017-09-19 17:10:00 -04:00
gnzlbg
778d55a0bc [abm] support popcnt and lzcnt 2017-09-19 17:10:00 -04:00