| 1466 | } |
| 1467 | |
| 1468 | inline vec_float VecNegativeCeil(const vec_float& v) |
| 1469 | { |
| 1470 | #if defined(TERATHON_SSE) |
| 1471 | |
| 1472 | #if defined(TERATHON_SSE4) |
| 1473 | |
| 1474 | return (_mm_round_ps(v, _MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC)); |
| 1475 | |
| 1476 | #else |
| 1477 | |
| 1478 | const vec_float one = VecLoadVectorConstant<0x3F800000>(); |
| 1479 | const vec_float two23 = VecLoadVectorConstant<0x4B000000>(); |
| 1480 | |
| 1481 | vec_float result = _mm_add_ps(_mm_sub_ps(v, two23), two23); |
| 1482 | return (_mm_add_ps(result, _mm_and_ps(one, _mm_cmplt_ps(result, v)))); |
| 1483 | |
| 1484 | #endif |
| 1485 | |
| 1486 | #elif defined(TERATHON_NEON) |
| 1487 | |
| 1488 | const vec_uint32 one = vdupq_n_u32(0x3F800000); |
| 1489 | const vec_float two23 = vdupq_n_f32(8388608.0F); |
| 1490 | |
| 1491 | vec_float result = vaddq_f32(vsubq_f32(v, two23), two23); |
| 1492 | return (vaddq_f32(result, vreinterpretq_f32_u32(vandq_u32(one, vcltq_f32(result, v))))); |
| 1493 | |
| 1494 | #endif |
| 1495 | } |
| 1496 | |
| 1497 | inline vec_float VecNegativeCeilScalar(const vec_float& v) |
| 1498 | { |
nothing calls this directly
no outgoing calls
no test coverage detected