aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/vector.zig
AgeCommit message (Collapse)Author
2022-08-22add behavior test for copying array of vectorsAndrew Kelley
closes #12026
2022-08-10stage2: fix crash with comptime vector reduceAndrew Kelley
2022-07-10stage1: Lower libcalls on Windows x86-64 correctlyCody Tapscott
This change is the Zig counterpart to https://reviews.llvm.org/D110413 Since we lower some libcalls directly (just like clang does), we need to make sure that the ABI we call with matches the ABI of the compiler-rt we are providing (and also the ABI expected by LLVM). While I was at it, I noticed some flawed vector handling in the binary soft float ops in stage 1, so I shored up the logic a bit and expanded an existing test to cover the missing functionality.
2022-07-05disable regressed behavior tests from llvm 14Andrew Kelley
See #12012 See #12013
2022-07-03stage2: update vector alignment logicAndrew Kelley
This follows LLVM14's lead on vector alignment, which computes byte count based on the length premultiplied by bits. This commit also disables behavior tests regressed by LLVM 14, only for stage1. stage2 fortunately does not trip the regression.
2022-06-30stage2: implement alignment calculation of vectorsAndrew Kelley
closes #11856
2022-06-17stage2: coerce tuple to vectorXavier Bouchoux
2022-05-16stage2: add more vector overflow testsWilliam Sengir
2022-05-16stage2: add vectorized overflow arithmetic behavior testsWilliam Sengir
2022-05-13target: Rename sparcv9 -> sparc64Koakuma
Rename all references of sparcv9 to sparc64, to make Zig align more with other projects. Also, added new function to convert glibc arch name to Zig arch name, since it refers to the architecture as sparcv9. This is based on the suggestion by @kubkon in PR 11847. (https://github.com/ziglang/zig/pull/11487#pullrequestreview-963761757)
2022-04-07use math/float.zig everywhereviri
2022-03-28Sema: allow mixing array and vector operandsAndrew Kelley
* Added peer type resolution for arrays and vectors: the vector type is selected. * Fixed passing the lhs type or rhs type instead of the peer resolved type when calling Value methods during analyzeArithmetic handling of comptime expressions. * `checkVectorizableBinaryOperands` now allows mixing vectors and arrays, as long as one of the operands is a vector. This matches stage1's handling of `^=` but apparently stage1 is inconsistent and does not handle e.g. `*=`. stage2 now will always allow mixing vector and array operands for all operations.
2022-03-21behavior tests: alter test coverage for vectorsAndrew Kelley
* Use `@Vector` syntax instead of `std.meta.Vector`. * Use `var` instead of `const` for tests so that we get runtime coverage instead of only comptime coverage. Comptime coverage is done with `comptime doTheTest()` calls.
2022-03-21behavior tests: enable all vector tests for the stage2 LLVM backendWilliam Sengir
2022-03-21behavior tests: use `expect` instead of `expectEqual` in vector.zigWilliam Sengir
2022-03-17stage2: implement `@reduce`Andrew Kelley
Notably, Value.eql and Value.hash are improved to treat NaN as equal to itself, so that Type/Value can be hash map keys. Likewise float hashing normalizes the float value before computing the hash.
2022-03-17stage2: prevent UB in the LLVM backendAndrew Kelley
* Sema: fix `zirTypeInfo` allocating with the wrong arenas for some stuff. * LLVM: split `airDbgInline` into two functions, one for each AIR tag. - remove the redundant copy to type_map_arena. This is the first thing that lowerDebugType does so this hack was probably just accidentally avoiding UB (which is still present prior to this commit). - don't store an inline fn inst into the di_map for the generic decl. - use a dummy function type for the debug info to avoid whatever UB is happening. - we are now ignoring the function type passed in with the dbg_inline_begin and dbg_inline_end. * behavior tests: prepare the vector tests to be enabled one at a time. Mitigates #11199.
2021-10-04migrate from `std.Target.current` to `@import("builtin").target`Andrew Kelley
closes #9388 closes #9321
2021-10-04stage2: fix Type max/min int calculationAndrew Kelley
This was an attempt to move saturating_arithmetic.zig to the "passing for stage2" section, which did not pan out due to the discovery of 2 prerequisite items that need to be done, but I did make a bug fix along the way of the calculation of max/min integers. This commit also simplifies the saturating arithmetic behavior tests to depend on less of the zig language that is not related to saturating arithmetic.
2021-09-24Spelling corrections (#9833)Josh Soref
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
2021-06-23stage1: `@shuffle` type and mask params in comptime scopeAndrew Kelley
2021-06-21std, src, doc, test: remove unused variablesJacob G-W
2021-06-09Re-enable multiple wasm32 vector testsJakub Konka
Fixes #5339
2021-06-05test: re-enable dragonfly testsMichael Dusan
Tests with LLVM assertions enabled are no longer failing. closes #3563
2021-05-08Merge remote-tracking branch 'origin/master' into stage2-whole-file-astgenAndrew Kelley
Conflicts: * doc/langref.html.in * lib/std/enums.zig * lib/std/fmt.zig * lib/std/hash/auto_hash.zig * lib/std/math.zig * lib/std/mem.zig * lib/std/meta.zig * test/behavior/alignof.zig * test/behavior/bitcast.zig * test/behavior/bugs/1421.zig * test/behavior/cast.zig * test/behavior/ptrcast.zig * test/behavior/type_info.zig * test/behavior/vector.zig Master branch added `try` to a bunch of testing function calls, and some lines also had changed how to refer to the native architecture and other `@import("builtin")` stuff.
2021-05-08Merge remote-tracking branch 'origin/master' into stage2-whole-file-astgenAndrew Kelley
Conflicts: * lib/std/os/linux/tls.zig * test/behavior/align.zig * test/behavior/atomics.zig * test/behavior/vector.zig
2021-04-29move behavior tests from test/stage1/ to test/Andrew Kelley
And fix test cases to make them pass. This is in preparation for starting to pass behavior tests with self-hosted.