Skip to content

Commit

Permalink
rm redundant clamp
Browse files Browse the repository at this point in the history
  • Loading branch information
ngxson committed Jan 27, 2025
1 parent 226d592 commit 9517aee
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions ggml/src/ggml-cpu/ggml-cpu-quants.c
Original file line number Diff line number Diff line change
Expand Up @@ -1722,14 +1722,8 @@ void quantize_row_q8_K(const float * restrict x, void * restrict y, int64_t k) {

// Pack into 16 i8 values
v128_t i8 = wasm_i8x16_narrow_i16x8(
wasm_i16x8_narrow_i32x4(
wasm_i32x4_min(wasm_i32x4_max(i0, wasm_i32x4_splat(-127)), wasm_i32x4_splat(127)),
wasm_i32x4_min(wasm_i32x4_max(i1, wasm_i32x4_splat(-127)), wasm_i32x4_splat(127))
),
wasm_i16x8_narrow_i32x4(
wasm_i32x4_min(wasm_i32x4_max(i2, wasm_i32x4_splat(-127)), wasm_i32x4_splat(127)),
wasm_i32x4_min(wasm_i32x4_max(i3, wasm_i32x4_splat(-127)), wasm_i32x4_splat(127))
)
wasm_i16x8_narrow_i32x4(i0, i1),
wasm_i16x8_narrow_i32x4(i2, i3)
);
wasm_v128_store(yc[i].qs + j, i8);

Expand Down

0 comments on commit 9517aee

Please sign in to comment.