thardalignmentconstraint.nim 378 B

123456789101112131415161718
  1. discard """
  2. disabled: true
  3. """
  4. # does not yet work
  5. {.passC: "-march=native".}
  6. type
  7. m256d {.importc: "__m256d", header: "immintrin.h".} = object
  8. proc set1(x: float): m256d {.importc: "_mm256_set1_pd", header: "immintrin.h".}
  9. for _ in 1..1000:
  10. var x = newSeq[m256d](1)
  11. x[0] = set1(1.0) # test if operation causes segfault
  12. doAssert (cast[uint](x[0].addr) and 31) == 0