Skip to content

vectors of floats have float type, not vector type #2708

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

Closed
shawnl opened this issue Jun 19, 2019 · 3 comments
Closed

vectors of floats have float type, not vector type #2708

shawnl opened this issue Jun 19, 2019 · 3 comments
Labels
bug Observed behavior contradicts documented or intended behavior
Milestone

Comments

@shawnl
Copy link
Contributor

shawnl commented Jun 19, 2019

$8 = {id = ZigTypeIdFloat, name = {list = {items = 0x555558195ed0 "f32", length = 4, capacity = 8}}, 

I'm not blocked on this so I am going to continue.

@andrewrk andrewrk added this to the 0.5.0 milestone Jun 19, 2019
@andrewrk andrewrk added the bug Observed behavior contradicts documented or intended behavior label Jun 19, 2019
@andrewrk
Copy link
Member

andrewrk commented Jun 19, 2019

issue checklist:

  • test case
  • expected output
  • actual output

plz?

@shawnl
Copy link
Contributor Author

shawnl commented Jun 19, 2019

That is not actual output, it is in gdb. You see length 4, capacity 8 (this is AVX-256), and the type should be ZigTypeIdVector (while the items type, f32, is correct).

And this bug cannot really be tested until simd branching is implemeted #2698, because zig assumes that comparisons return bool, when vector comparisons return vectors of bool.

But here is the code I used to get that in gdb:


    {
        var T: @Vector(2, f32) = undefined;
        var a: T = [_]f32{2.5, 5.5};
        var b: T = [_]f32{5.5, 2.5};
        var c: T = [_]f32{6.25, 5.25};
        expect(@mulAdd(T, a, b, c) == [_]f32{20, 19});
    }

@shawnl
Copy link
Contributor Author

shawnl commented Oct 3, 2019

considering that I got float op vectors working I think this is fixed

@shawnl shawnl closed this as completed Oct 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Observed behavior contradicts documented or intended behavior
Projects
None yet
Development

No branches or pull requests

2 participants