changed to `cc = vcc` in `nim.cfg` and it seems to work, with and without the 
`when defined(vcc)`.
    
    
    import nimsimd/avx2
    
    when defined(gcc) or defined(clang):
      {.localPassc: "-mavx2".}
    
    when defined(vcc):
      {.localPassC: "/arch:AVX2".}
    
    
    func mm256_abs_ps(x: M256): M256 {.inline.} =
      mm256_andnot_ps(mm256_set1_ps(-0.0), x)
    
    func mul (a, b: M256): M256 {.inline.} =
      mm256_mul_ps(a, b)
    
    let
      a = mm256_setr_ps(1.1, 2.2, 3.3, 4.0, 5.0, 6.0, 7.0, 8.0)
      b = mm256_set1_ps(-2.0)
      #c = mm256_mul_ps(a, b)
      c = mul(a, b)
      #d = mm256_andnot_ps(mm256_set1_ps(-0.0), c) #abs
      d = mm256_abs_ps(c)
    
    echo cast[array[8, float32]](d)
    
    
    Run

Reply via email to