aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/popcount.zig
AgeCommit message (Collapse)Author
2025-07-22aarch64: add new from scratch self-hosted backendJacob Young
2025-06-28riscv64: skip failing testsBingwu Zhang
2025-06-16rename spirv backend nameAli Cheraghi
`stage2_spirv64` -> `stage2_spirv`
2025-05-31Legalize: implement scalarization of binary operationsJacob Young
2025-05-31Legalize: implement scalarization of unary operationsJacob Young
2024-07-26riscv: update tests and fix reuse bugDavid Rubin
2024-05-11riscv: add stage2_riscv to test matrix and bypass failing testsDavid Rubin
2023-11-19test: update behavior to silence 'var is never mutated' errorsmlugg
2023-10-23x86_64: implement 128-bit builtinsJacob Young
* `@clz` * `@ctz` * `@popCount` * `@byteSwap` * `@bitReverse` * various encodings used by std
2023-06-24all: migrate code to new cast builtin syntaxmlugg
Most of this migration was performed automatically with `zig fmt`. There were a few exceptions which I had to manually fix: * `@alignCast` and `@addrSpaceCast` cannot be automatically rewritten * `@truncate`'s fixup is incorrect for vectors * Test cases are not formatted, and their error locations change
2023-06-13all: replace `comptime try` with `try comptime`Eric Joldasov
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-05-11setup spirv backend in behavior testsAli Chraghi
2023-04-26behavior: update passing cbe testsJacob Young
2023-03-05CBE: implement some big integer and vector unary operationsJacob Young
2022-12-10stage2: sparc64: Skip unimplemented testsKoakuma
2022-12-06remove references to stage1 in behavior testsAndrew Kelley
Good riddance.
2022-08-22stage2+stage1: remove type parameter from bit builtinsVeikka Tuominen
Closes #12529 Closes #12511 Closes #6835
2022-05-18wasm: enable 128bit integer behavior testsLuuk de Gram
2022-03-21wasm: Implement @popCountLuuk de Gram
2022-03-18organize behavior testsAndrew Kelley
* Identify the ones that are passing and stop skipping them. * Flatten out the main behavior.zig file and have each individual test disable itself if it is not passing.
2022-03-14CBE: split {clz,ctz,mod,popCount,byteSwap,bitReverse} by typeDaniele Cocca
This also surfaces the fact that clz, ctz and popCount didn't actually support 128 bit integers, despite what was claimed by 226fcd7c709ec664c5d883042cf7beb3026f66cb. This was partially hidden by the fact that the test code for popCount only exercised 128 bit integers in a comptime context. This commit duplicates that test case for runtime ints too.
2022-03-13CBE: implement popCount, byteSwap, bitReverse for ints <= 128 bitsDaniele Cocca
This folds the airCountZeroes() code from 226fcd7c709ec664c5d883042cf7beb3026f66cb back into airBuiltinCall(), since most of these builtins happen to require the same arguments and can be unified under a common function signature.
2022-02-12stage2: implement `@popCount` for SIMD vectorsAndrew Kelley
2022-01-12stage2: implement `@ctz` and `@clz` including SIMDAndrew Kelley
AIR: * `array_elem_val` is now allowed to be used with a vector as the array type. * New instructions: splat, vector_init AstGen: * The splat ZIR instruction uses coerced_ty for the ResultLoc, avoiding an unnecessary `as` instruction, since the coercion will be performed in Sema. * Builtins that accept vectors now ignore the type parameter. Comment from this commit reproduced here: The accepted proposal #6835 tells us to remove the type parameter from these builtins. To stay source-compatible with stage1, we still observe the parameter here, but we do not encode it into the ZIR. To implement this proposal in stage2, only AstGen code will need to be changed. Sema: * `clz` and `ctz` ZIR instructions are now handled by the same function which accept AIR tag and comptime eval function pointer to differentiate. * `@typeInfo` for vectors is implemented. * `@splat` is implemented. It takes advantage of `Value.Tag.repeated` 😎 * `elemValue` is implemented for vectors, when the index is a scalar. Handling a vector index is still TODO. * Element-wise coercion is implemented for vectors. It could probably be optimized a bit, but it is at least complete & correct. * `Type.intInfo` supports vectors, returning int info for the element. * `Value.ctz` initial implementation. Needs work. * `Value.eql` is implemented for arrays and vectors. LLVM backend: * Implement vector support when lowering `array_elem_val`. * Implement vector support when lowering `ctz` and `clz`. * Implement `splat` and `vector_init`.
2021-10-29stage2: implement `@popCount` for non-vectorsAndrew Kelley
2021-09-01re-enable mips behavior tests for vectorsAndrew Kelley
closes #3317
2021-07-25Add vector support for @popCountAuguste Rame
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-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.