aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/saturating_arithmetic.zig
AgeCommit message (Collapse)Author
2025-07-22aarch64: add new from scratch self-hosted backendJacob Young
2025-06-19x86_64: increase passing test coverage on windowsJacob Young
Now that codegen has no references to linker state this is much easier. Closes #24153
2025-06-16rename spirv backend nameAli Cheraghi
`stage2_spirv64` -> `stage2_spirv`
2025-05-17x86_64: rewrite scalar `<<|`Jacob Young
Closes #23035
2025-05-17x86_64: rewrite scalar `*|`Jacob Young
2025-05-17x86_64: rewrite scalar `-|`Jacob Young
2025-05-17x86_64: rewrite scalar `+|`Jacob Young
2025-01-16x86_64: implement switch jump tablesJacob Young
2024-11-03std.Target: Replace isARM() with isArmOrThumb() and rename it to isArm().Alex Rønne Petersen
The old isARM() function was a portability trap. With the name it had, it seemed like the obviously correct function to use, but it didn't include Thumb. In the vast majority of cases where someone wants to ask "is the target Arm?", Thumb *should* be included. There are exactly 3 cases in the codebase where we do actually need to exclude Thumb, although one of those is in Aro and mirrors a check in Clang that is itself likely a bug. These rare cases can just add an extra isThumb() check.
2024-07-23stage2-wasm: mul_sat 32 bits <=, i64, i128Pavel Verigo
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-07-31std: finish cleanup up asmJacob Young
This also required implementing the necessary syntax in the x86_64 backend.
2023-07-31cbe: get behavior tests running on armJacob Young
Specifically without linking libc.
2023-06-13all: replace `comptime try` with `try comptime`Eric Joldasov
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-05-18x86_64: implement saturating add/sub for weird typesJacob Young
2023-05-11setup spirv backend in behavior testsAli Chraghi
2022-12-10stage2: sparc64: Skip unimplemented testsKoakuma
2022-12-06remove references to stage1 in behavior testsAndrew Kelley
Good riddance.
2022-10-25cbe: implement 128-bit and fix smaller integer builtinsJacob Young
2022-10-25cbe: fix typedef declaration orderJacob Young
2022-10-25cbe: fix infinite recursion on recursive typesJacob Young
2022-06-19wasm: enable passing behavior testsLuuk de Gram
This also splits the test cases for addition and subtraction as the wasm backend does not yet provide support for 128bit saturating arithmetic.
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-14Sema: fix shl_sat with comptime rhsAndrew Kelley
2022-02-15stage1: fix comptime saturation subtractionJan Philipp Hafer
- also simplifies code - adding a few more tests closes #10870
2022-01-29stage1: fix saturating arithmetic producing incorrect results on type ↵riverbl
comptime_int, allow saturating left shift on type comptime int
2022-01-26organize behavior testsAndrew Kelley
check the set of passing tests; move towards the disabling logic being inside each test rather than which files are included. this enables a few more passing tests.
2021-10-22stage2: fix Decl addrspace being undefinedAndrew Kelley
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-28saturating arithmetic modificationsAndrew Kelley
* Remove the builtins `@addWithSaturation`, `@subWithSaturation`, `@mulWithSaturation`, and `@shlWithSaturation` now that we have first-class syntax for saturating arithmetic. * langref: Clarify the behavior of `@shlExact`. * Ast: rename `bit_shift_left` to `shl` and `bit_shift_right` to `shr` for consistency. * Air: rename to include underscore separator with consistency with the rest of the ops. * Air: add shl_exact instruction * Use non-extended tags for saturating arithmetic, to keep it simple so that all the arithmetic operations can be done the same way. - Sema: unify analyzeArithmetic with analyzeSatArithmetic - implement comptime `+|`, `-|`, and `*|` - allow float operands to saturating arithmetic * `<<|` allows any integer type for the RHS. * C backend: fix rebase conflicts * LLVM backend: reduce the amount of branching for arithmetic ops * zig.h: fix magic number not matching actual size of C integer types
2021-09-28sat-arithmetic: don't test builtins in behavior testsTravis Staloch
- not necessary as we are testing the operators
2021-09-28sat-arithmetic: add operator supportTravis Staloch
- adds initial support for the operators +|, -|, *|, <<|, +|=, -|=, *|=, <<|= - uses operators in addition to builtins in behavior test - adds binOpExt() and assignBinOpExt() to AstGen.zig. these need to be audited
2021-09-01saturating arithmetic builtins: add, sub, mul, shl (#9619)travisstaloch
- adds 1 simple behavior tests for each which does integer and vector ops at runtime and comptime - adds bigint_*_sat() methods for each - use CreateIntrinsic() which accepts a variable number of arguments to pass the scale parameter * update langref - added case to test/compile_errors.zig given floats - explain upstream bug in llvm.smul.fix.sat and link to #9643 in langref and commented out test cases * sat-arithmetic: skip mul tests if arch == .wasm32 because ci is erroring with 'LLVM ERROR: Unable to expand fixed point multiplication' when compiling for wasm32