aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/math.zig
AgeCommit message (Collapse)Author
2022-08-24Merge pull request #12574 from Vexu/remove-bit-op-type-paramAndrew Kelley
stage2+stage1: remove type parameter from bit builtins
2022-08-23skip failing f80 behavior tests on WindowsJakub Konka
2022-08-22stage2+stage1: remove type parameter from bit builtinsVeikka Tuominen
Closes #12529 Closes #12511 Closes #6835
2022-08-18AstGen: disallow leading zeroes in int literals and int typeszooster
This makes `0123` and `u0123` etc. illegal. I'm now confident that this is a good change because I actually caught two C header translation mistakes in `haiku.zig` with this. Clearly, `0123` being octal in C (TIL) can cause confusion, and we make this easier to read by requiring `0o` as the prefix and now also disallowing leading zeroes in integers. For consistency and because it looks weird, we disallow it for integer types too (e.g. `u0123`). Fixes #11963 Fixes #12417
2022-08-10stage2: Handle lazy values for the % operatorIsaac Freund
2022-07-23Sema: exact division safetyVeikka Tuominen
2022-07-13LLVM: implement signext/zeroext attributesAndrew Kelley
For calling convention ABI purposes, integer attributes and return values need to have an LLVM attribute signext or zeroext added sometimes. This commit implements that logic. It also implements a proof-of-concept of moving the F16T type from being a compiler_rt hack to being how the compiler lowers f16 in functions that need to match certain calling conventions. Closes #12054
2022-07-09these riscv64 behavior tests work for stage1 but not stage2Andrew Kelley
2022-07-08disable failing riscv64 tests from LLVM 14 upgradeAndrew Kelley
See #12054
2022-07-05compiler_rt: work around LLVM optimizing __muloti4 to call itselfAndrew Kelley
This is a workaround for https://github.com/llvm/llvm-project/issues/56403
2022-07-05disable regressed behavior tests from llvm 14Andrew Kelley
See #12012 See #12013
2022-07-05disable regressed wasm32 behavior tests from LLVM 14Andrew Kelley
2022-06-25stage2 ARM: implement basic intCast and error union wrappingjoachimschmidt557
2022-05-19x64: re-enable behavior testsJakub Konka
2022-05-18wasm: enable 128bit integer behavior testsLuuk de Gram
2022-05-16aarch64: sub_with_overflow should always track V flagJakub Konka
2022-05-11Merge pull request #11628 from ziglang/x64-shiftsJakub Konka
2022-05-10Sema: comptime float negation supports negative zeroAndrew Kelley
When handling the `negate` ZIR instruction, Zig now checks for a comptime operand and handles it as a special case rather than lowering it as `0 - x` so that the expression `-x` where `x` is a floating point value known at compile-time, will get the negative zero bitwise representation.
2022-05-10x64: fix binary not implementationJakub Konka
2022-05-10x64: enable additional math testJakub Konka
2022-05-10x64: implement shl with overflow for non-pow-2Jakub Konka
2022-05-10x64: implement shl_with_overflow for powers of twoJakub Konka
2022-05-10x64: implement missing bits in add_with_overflow and sub_with_overflowJakub Konka
2022-05-10x64: implement shl_exact and shr_exactJakub Konka
2022-05-09x64: add naive impl of shrJakub Konka
2022-05-07stage2: Split `@mulWithOverflow` testsLuuk de Gram
2022-05-05test: pass extended mul_with_overflow tests on x64Jakub Konka
2022-05-05test: test bitwidths between 1...8 and 8...16 for mul_with_overflowJakub Konka
2022-05-05test: test more int sizes for @mulWithOverflow builtinJakub Konka
2022-05-05aarch64: implement mul_with_overflow for <= 32bit intsJakub Konka
Add emitters for `smull`, `umull` and `tst (immediate)` instructions.
2022-05-05stage2 AArch64: implement shl_with_overflowjoachimschmidt557
2022-05-05stage2 AArch64: initial implementation of {add,sub}_with_overflowjoachimschmidt557
2022-05-03temporary fix for stage2/stage1 f128 rounding discrepencyMarc Tiehuis
This is only to get tests running again. The root issue should be fixed in stage1 so rounding is consistent between stages.
2022-04-27stage1: fix i386-windows f80 sizeof/alignofAndrew Kelley
2022-04-27disable failing behavior testAndrew Kelley
This is a new test added in this branch but it is not yet passing for i386-windows with the stage1 compiler.
2022-04-27enable newly passing behavior testsAndrew Kelley
closes #11030
2022-04-27disable failing behavior testsAndrew Kelley
2022-04-27compiler-rt: math functions reorgAndrew Kelley
* unify the logic for exporting math functions from compiler-rt, with the appropriate suffixes and prefixes. - add all missing f128 and f80 exports. Functions with missing implementations call other functions and have TODO comments. - also add f16 functions * move math functions from freestanding libc to compiler-rt (#7265) * enable all the f128 and f80 code in the stage2 compiler and behavior tests (#11161). * update std lib to use builtins rather than `std.math`.
2022-04-19stage2 AArch64: fix shl, shr, shl_exact, shr_exactjoachimschmidt557
Introduces the necessary truncation after shift
2022-04-19stage2 AArch64: implement addwrap, subwrap, mulwrapjoachimschmidt557
2022-04-12Skip `@rem`/`@mod` tests on stage2, due to missing `fmodl` implementationCody Tapscott
2022-04-02wasm: Enable passing behavior testsLuuk de Gram
This shuffles some tests do ensure the new instructions are tested for the wasm backend, by moving vectors into their own tests as well as move the f16 test cases as those require special operating also.
2022-04-01stage2 ARM: implement mul_with_overflow for ints <= 16 bitsjoachimschmidt557
2022-04-01stage2 ARM: implement shl_with_overflow for ints <= 32 bitsjoachimschmidt557
2022-04-01stage2 ARM: implement add/sub_with_overflow for ints < 32 bitsjoachimschmidt557
2022-04-01x64: implement add/sub with wrapping and xor opJakub Konka
2022-03-30replace other uses of `std.meta.Vector` with `@Vector` (#11346)Meghan
2022-03-30x64: redo @mulWithOverflow using rax/rdx based multiplicationJakub Konka
2022-03-28x64: partially fix genImul, enable overflow testsJakub Konka
2022-03-27wasm: Enable overflow behavior testsLuuk de Gram