Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x86 backend is not passing all behavior tests #17645

Open
Tracked by #17748
andrewrk opened this issue Oct 20, 2023 · 0 comments
Open
Tracked by #17748

x86 backend is not passing all behavior tests #17645

andrewrk opened this issue Oct 20, 2023 · 0 comments
Labels
arch-x86_64 64-bit x86 backend-self-hosted bug Observed behavior contradicts documented or intended behavior enhancement Solving this issue will likely involve adding new logic or components to the codebase.
Milestone

Comments

@andrewrk
Copy link
Member

andrewrk commented Oct 20, 2023

Current progress relative to the LLVM backend: 1884/1923 (98%)

Once the following list gets small enough, this issue can be closed and separate issues filed for each one.

andy@ark ~/D/zig (master)> grep -RI 'stage2_x86_64.*Skip' test/behavior/ | grep -v elf
test/behavior/byteswap.zig:    if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
test/behavior/byteswap.zig:    if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
test/behavior/byteswap.zig:    if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
test/behavior/shuffle.zig:    if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
test/behavior/shuffle.zig:    if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
test/behavior/shuffle.zig:    if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
test/behavior/vector.zig:    if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
test/behavior/vector.zig:    if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
test/behavior/vector.zig:    if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
test/behavior/vector.zig:    if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
test/behavior/vector.zig:    if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
test/behavior/vector.zig:    if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
test/behavior/vector.zig:    if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
test/behavior/vector.zig:    if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
test/behavior/vector.zig:    if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
test/behavior/vector.zig:    if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
test/behavior/vector.zig:    if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
test/behavior/vector.zig:    if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
test/behavior/vector.zig:    if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
test/behavior/vector.zig:    if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
test/behavior/vector.zig:    if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
test/behavior/vector.zig:    if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
test/behavior/vector.zig:    if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
test/behavior/vector.zig:    if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
test/behavior/bitreverse.zig:    if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
test/behavior/bitreverse.zig:    if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
test/behavior/bitreverse.zig:    if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
test/behavior/import_c_keywords.zig:    if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt == .coff) return error.SkipZigTest;
test/behavior/call.zig:    if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
test/behavior/call.zig:    if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
test/behavior/call.zig:    if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
test/behavior/call.zig:    if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
test/behavior/bitcast.zig:    if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
test/behavior/asm.zig:    if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
test/behavior/popcount.zig:    if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
test/behavior/cast.zig:    if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
test/behavior/cast.zig:    if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
test/behavior/cast.zig:    if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
test/behavior/switch.zig:    if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
test/behavior/math.zig:    if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
test/behavior/math.zig:    if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
test/behavior/math.zig:    if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
test/behavior/math.zig:    if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
test/behavior/struct.zig:    if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
test/behavior/saturating_arithmetic.zig:    if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
test/behavior/saturating_arithmetic.zig:    if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
test/behavior/saturating_arithmetic.zig:    if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
test/behavior/saturating_arithmetic.zig:    if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
test/behavior/saturating_arithmetic.zig:    if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
test/behavior/x86_64.zig:    if (builtin.zig_backend != .stage2_x86_64) return error.SkipZigTest;

Related:

@andrewrk andrewrk added bug Observed behavior contradicts documented or intended behavior enhancement Solving this issue will likely involve adding new logic or components to the codebase. arch-x86_64 64-bit x86 backend-self-hosted labels Oct 20, 2023
@andrewrk andrewrk added this to the 0.13.0 milestone Oct 20, 2023
@mlugg mlugg moved this to Ditch LLVM in Performance Aug 22, 2024
xtexx added a commit to xtexx/zig that referenced this issue Jan 18, 2025
xtexx added a commit to xtexx/zig that referenced this issue Jan 18, 2025
Simliarly to shl_with_overflow, we first SHL/SAL the integer, then
SHR/SAR it back to compare if overflow happens.
If overflow happened, set result to the upper limit to make it saturing.

Theoretically, if the left shifting instruction is lowered as a single
SHL/SAL opcode, and the left operand fits into a register (so no
truncation is needed), the CF flag can be used to check for overflow.
However the optimization is not implemented right now (for my laziness).

Bug: ziglang#17645
xtexx added a commit to xtexx/zig that referenced this issue Jan 18, 2025
Simliarly to shl_with_overflow, we first SHL/SAL the integer, then
SHR/SAR it back to compare if overflow happens.
If overflow happened, set result to the upper limit to make it saturating.

Theoretically, if the left shifting instruction is lowered as a single
SHL/SAL opcode, and the left operand fits into a register (so no
truncation is needed), the CF flag can be used to check for overflow.
However the optimization is not implemented right now (for my laziness).

Bug: ziglang#17645
xtexx added a commit to xtexx/zig that referenced this issue Jan 18, 2025
Simliarly to shl_with_overflow, we first SHL/SAL the integer, then
SHR/SAR it back to compare if overflow happens.
If overflow happened, set result to the upper limit to make it saturating.

Bug: ziglang#17645
xtexx added a commit to xtexx/zig that referenced this issue Jan 20, 2025
Simliarly to shl_with_overflow, we first SHL/SAL the integer, then
SHR/SAR it back to compare if overflow happens.
If overflow happened, set result to the upper limit to make it saturating.

Bug: ziglang#17645
xtexx added a commit to xtexx/zig that referenced this issue Jan 20, 2025
Simliarly to shl_with_overflow, we first SHL/SAL the integer, then
SHR/SAR it back to compare if overflow happens.
If overflow happened, set result to the upper limit to make it saturating.

Bug: ziglang#17645
xtexx added a commit to xtexx/zig that referenced this issue Jan 20, 2025
Simliarly to shl_with_overflow, we first SHL/SAL the integer, then
SHR/SAR it back to compare if overflow happens.
If overflow happened, set result to the upper limit to make it saturating.

Bug: ziglang#17645
xtexx added a commit to xtexx/zig that referenced this issue Mar 1, 2025
Simliarly to shl_with_overflow, we first SHL/SAL the integer, then
SHR/SAR it back to compare if overflow happens.
If overflow happened, set result to the upper limit to make it saturating.

Bug: ziglang#17645
Signed-off-by: Bingwu Zhang <[email protected]>
xtexx added a commit to xtexx/zig that referenced this issue Mar 1, 2025
Simliarly to shl_with_overflow, we first SHL/SAL the integer, then
SHR/SAR it back to compare if overflow happens.
If overflow happened, set result to the upper limit to make it saturating.

Bug: ziglang#17645
Signed-off-by: Bingwu Zhang <[email protected]>
xtexx added a commit to xtexx/zig that referenced this issue Mar 1, 2025
Simliarly to shl_with_overflow, we first SHL/SAL the integer, then
SHR/SAR it back to compare if overflow happens.
If overflow happened, set result to the upper limit to make it saturating.

Bug: ziglang#17645
Signed-off-by: Bingwu Zhang <[email protected]>
xtexx added a commit to xtexx/zig that referenced this issue Mar 1, 2025
Simliarly to shl_with_overflow, we first SHL/SAL the integer, then
SHR/SAR it back to compare if overflow happens.
If overflow happened, set result to the upper limit to make it saturating.

Bug: ziglang#17645
Signed-off-by: Bingwu Zhang <[email protected]>
@jacobly0 jacobly0 modified the milestones: 0.14.0, 0.15.0 Mar 1, 2025
xtexx added a commit to xtexx/zig that referenced this issue Mar 2, 2025
Simliarly to shl_with_overflow, we first SHL/SAL the integer, then
SHR/SAR it back to compare if overflow happens.
If overflow happened, set result to the upper limit to make it saturating.

Bug: ziglang#17645
Signed-off-by: Bingwu Zhang <[email protected]>
xtexx added a commit to xtexx/zig that referenced this issue Mar 2, 2025
Simliarly to shl_with_overflow, we first SHL/SAL the integer, then
SHR/SAR it back to compare if overflow happens.
If overflow happened, set result to the upper limit to make it saturating.

Bug: ziglang#17645
Co-authored-by: Jacob Young <[email protected]>
Signed-off-by: Bingwu Zhang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch-x86_64 64-bit x86 backend-self-hosted bug Observed behavior contradicts documented or intended behavior enhancement Solving this issue will likely involve adding new logic or components to the codebase.
Projects
Status: Ditch LLVM
Development

No branches or pull requests

2 participants