Skip to content

Does not work on Apple M1 CPU #5

Open
@BrunoDutertre

Description

@BrunoDutertre

The code does not compile on MacOS but that can be fixed.

But after fixing the compilation issues, the test fails for max and min.

The reference implementation does this:

  • min(-zero,+zero) = -zero
  • min(+zero,-zero) = -zero
  • min(x,NaN) = NaN
  • min(NaN,x) = NaN

The computed values don't agree with this. I'm not sure who is right.

Here are some of the failed tests (for min):

vector[1 -> (1,0)] input1 = 0x80000000, input2 = 0x0, computed = 0x0, reference = 0x80000000
vector[1316165 -> (1659,0)] input1 = 0xff800001, input2 = 0x0, computed = 0x0, reference = 0xffc00001
vector[1316166 -> (1658,1)] input1 = 0x7f800001, input2 = 0x80000000, computed = 0x80000000, reference = 0x7fc00001
vector[1316172 -> (1658,2)] input1 = 0x7f800001, input2 = 0x3f800000, computed = 0x3f800000, reference = 0x7fc00001
vector[1316173 -> (1659,2)] input1 = 0xff800001, input2 = 0x3f800000, computed = 0x3f800000, reference = 0xffc00001

The compiler is clang++:

Apple clang version 12.0.5 (clang-1205.0.22.11)
Target: arm64-apple-darwin20.5.0

and here are the compilation flags I used:

CXXFLAGS+=-std=c++17 -g -Wall -W -ffp-model=strict -pedantic

But it looks like -ffp-model=strict is ignored by this compiler.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions