MCPcopy Create free account
hub / github.com/bitsandbytes-foundation/bitsandbytes / neon_fp4_lut

Function neon_fp4_lut

csrc/cpu_ops.cpp:72–81  ·  view source on GitHub ↗

ARM NEON FP4 lookup table

Source from the content-addressed store, hash-verified

70
71// ARM NEON FP4 lookup table
72static inline void neon_fp4_lut(float32x4_t lut[4]) {
73 static const float fp4_values[16] = {
74 0.0f, 5.208333333e-03f, 0.66666667f, 1.0f, 0.33333333f, 0.5f, 0.16666667f, 0.25f,
75 0.0f, -5.208333333e-03f, -0.66666667f, -1.0f, -0.33333333f, -0.5f, -0.16666667f, -0.25f
76 };
77 lut[0] = vld1q_f32(fp4_values);
78 lut[1] = vld1q_f32(fp4_values + 4);
79 lut[2] = vld1q_f32(fp4_values + 8);
80 lut[3] = vld1q_f32(fp4_values + 12);
81}
82
83// Efficient NEON float LUT lookup using indexed lane extraction
84// The LUT has 16 float entries stored as a flat array for direct indexing

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected