From 675186056385685cee581cabfada23a8afd7c97e Mon Sep 17 00:00:00 2001 From: Ryan Oldenburg Date: Wed, 3 Aug 2022 03:42:26 -0500 Subject: [PATCH] rm --- examples/basic.nim | 6 +-- src/nimsimd/sse2.nim | 100 ------------------------------------------- tests/test.nim | 6 +-- 3 files changed, 6 insertions(+), 106 deletions(-) diff --git a/examples/basic.nim b/examples/basic.nim index 1a03666..f093e16 100644 --- a/examples/basic.nim +++ b/examples/basic.nim @@ -2,9 +2,9 @@ import nimsimd/sse2 # SIMD floating point multiplication let - a = m128(1.0) # Vector of 4 float32 each with value 1.0 - b = m128(2.0) # Vector of 4 float32 each with value 2.0 - c = a * b # SIMD vector multiplication operator + a = mm_set1_ps(1.0) # Vector of 4 float32 each with value 1.0 + b = mm_set1_ps(2.0) # Vector of 4 float32 each with value 2.0 + c = mm_mul_ps(a, b) # SIMD vector multiplication operator # Cast the vector to echo as separate float32 values echo cast[array[4, float32]](c) diff --git a/src/nimsimd/sse2.nim b/src/nimsimd/sse2.nim index 8ae4908..36268e2 100644 --- a/src/nimsimd/sse2.nim +++ b/src/nimsimd/sse2.nim @@ -663,103 +663,3 @@ func mm_xor_pd*(a, b: M128d): M128d {.importc: "_mm_xor_pd".} func mm_xor_si128*(a, b: M128i): M128i {.importc: "_mm_xor_si128".} {.pop.} - -# For readability - -func m128*(): M128 {.inline.} = mm_setzero_ps() - -func m128*(a: float32): M128 {.inline.} = mm_set1_ps(a) - -func m128d*(): M128d {.inline.} = mm_setzero_pd() - -func m128i*(): M128i {.inline.} = mm_setzero_si128() - -func m128d*(a: float64): M128d {.inline.} = mm_set1_pd(a) - -func m128i*(a: int32): M128i {.inline.} = mm_set1_epi32(a) - -func `and`*(a, b: M128): M128 {.inline.} = mm_and_ps(a, b) - -func `and`*(a, b: M128d): M128d {.inline.} = mm_and_pd(a, b) - -func `and`*(a, b: M128i): M128i {.inline.} = mm_and_si128(a, b) - -func `or`*(a, b: M128): M128 {.inline.} = mm_or_ps(a, b) - -func `or`*(a, b: M128d): M128d {.inline.} = mm_or_pd(a, b) - -func `or`*(a, b: M128i): M128i {.inline.} = mm_or_si128(a, b) - -func `xor`*(a, b: M128): M128 {.inline.} = mm_xor_ps(a, b) - -func `xor`*(a, b: M128d): M128d {.inline.} = mm_xor_pd(a, b) - -func `xor`*(a, b: M128i): M128i {.inline.} = mm_xor_si128(a, b) - -func `==`*(a, b: M128): M128 {.inline.} = mm_cmpeq_ps(a, b) - -func `==`*(a, b: M128d): M128d {.inline.} = mm_cmpeq_pd(a, b) - -func `!=`*(a, b: M128): M128 {.inline.} = mm_cmpneq_ps(a, b) - -func `!=`*(a, b: M128d): M128d {.inline.} = mm_cmpneq_pd(a, b) - -func `>`*(a, b: M128): M128 {.inline.} = mm_cmpgt_ps(a, b) - -func `>`*(a, b: M128d): M128d {.inline.} = mm_cmpgt_pd(a, b) - -func `>=`*(a, b: M128): M128 {.inline.} = mm_cmpge_ps(a, b) - -func `>=`*(a, b: M128d): M128d {.inline.} = mm_cmpge_pd(a, b) - -func `<`*(a, b: M128): M128 {.inline.} = mm_cmplt_ps(a, b) - -func `<`*(a, b: M128d): M128d {.inline.} = mm_cmplt_pd(a, b) - -func `<=`*(a, b: M128): M128 {.inline.} = mm_cmple_ps(a, b) - -func `<=`*(a, b: M128d): M128d {.inline.} = mm_cmple_pd(a, b) - -func `+`*(a, b: M128): M128 {.inline.} = mm_add_ps(a, b) - -func `+`*(a, b: M128d): M128d {.inline.} = mm_add_pd(a, b) - -func `+=`*(a: var M128, b: M128) {.inline.} = a = a + b - -func `+=`*(a: var M128d, b: M128d) {.inline.} = a = a + b - -func `-`*(a, b: M128): M128 {.inline.} = mm_sub_ps(a, b) - -func `-`*(a, b: M128d): M128d {.inline.} = mm_sub_pd(a, b) - -func `-=`*(a: var M128, b: M128) {.inline.} = a = a - b - -func `-=`*(a: var M128d, b: M128d) {.inline.} = a = a - b - -func `*`*(a, b: M128): M128 {.inline.} = mm_mul_ps(a, b) - -func `*`*(a, b: M128d): M128d {.inline.} = mm_mul_pd(a, b) - -func `*=`*(a: var M128, b: M128) {.inline.} = a = a * b - -func `*=`*(a: var M128d, b: M128d) {.inline.} = a = a * b - -func `/`*(a, b: M128): M128 {.inline.} = mm_div_ps(a, b) - -func `/`*(a, b: M128d): M128d {.inline.} = mm_div_pd(a, b) - -func `/=`*(a: var M128, b: M128) {.inline.} = a = a / b - -func `/=`*(a: var M128d, b: M128d) {.inline.} = a = a / b - -func max*(a, b: M128): M128 {.inline.} = mm_max_ps(a, b) - -func max*(a, b: M128d): M128d {.inline.} = mm_max_pd(a, b) - -func min*(a, b: M128): M128 {.inline.} = mm_min_ps(a, b) - -func min*(a, b: M128d): M128d {.inline.} = mm_min_pd(a, b) - -func sqrt*(a: M128): M128 {.inline.} = mm_sqrt_ps(a) - -func sqrt*(a: M128d): M128d {.inline.} = mm_sqrt_pd(a) diff --git a/tests/test.nim b/tests/test.nim index d2dafcd..a2023ff 100644 --- a/tests/test.nim +++ b/tests/test.nim @@ -1,8 +1,8 @@ import nimsimd/sse42 let - a = m128(1.0) - b = m128(2.0) - c = a * b + a = mm_set1_ps(1.0) + b = mm_set1_ps(2.0) + c = mm_mul_ps(a, b) doAssert cast[array[4, float32]](c) == [2.0.float32, 2.0, 2.0, 2.0]