| 1408 | } |
| 1409 | |
| 1410 | inline vec_float VecPositiveCeil(const vec_float& v) |
| 1411 | { |
| 1412 | #if defined(TERATHON_SSE) |
| 1413 | |
| 1414 | #if defined(TERATHON_SSE4) |
| 1415 | |
| 1416 | return (_mm_round_ps(v, _MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC)); |
| 1417 | |
| 1418 | #else |
| 1419 | |
| 1420 | const vec_float one = VecLoadVectorConstant<0x3F800000>(); |
| 1421 | const vec_float two23 = VecLoadVectorConstant<0x4B000000>(); |
| 1422 | |
| 1423 | vec_float result = _mm_sub_ps(_mm_add_ps(v, two23), two23); |
| 1424 | return (_mm_add_ps(result, _mm_and_ps(one, _mm_cmplt_ps(result, v)))); |
| 1425 | |
| 1426 | #endif |
| 1427 | |
| 1428 | #elif defined(TERATHON_NEON) |
| 1429 | |
| 1430 | const vec_uint32 one = vdupq_n_u32(0x3F800000); |
| 1431 | const vec_float two23 = vdupq_n_f32(8388608.0F); |
| 1432 | |
| 1433 | vec_float result = vsubq_f32(vaddq_f32(v, two23), two23); |
| 1434 | return (vaddq_f32(result, vreinterpretq_f32_u32(vandq_u32(one, vcltq_f32(result, v))))); |
| 1435 | |
| 1436 | #endif |
| 1437 | } |
| 1438 | |
| 1439 | inline vec_float VecPositiveCeilScalar(const vec_float& v) |
| 1440 | { |
nothing calls this directly
no outgoing calls
no test coverage detected