| 2591 | return bv_variable_create_int(0); |
| 2592 | } |
| 2593 | bv_variable lib_common_findLSB(bv_program* prog, u8 count, bv_variable* args) |
| 2594 | { |
| 2595 | /* findLSB(genI/UType) */ |
| 2596 | if (count == 1) { |
| 2597 | if (args[0].type == bv_type_object) { |
| 2598 | bv_object* vec = bv_variable_get_object(args[0]); |
| 2599 | glm::ivec4 vecData = glm::findLSB(sd::AsVector<4, int>(args[0])); |
| 2600 | |
| 2601 | bv_type outType = vec->prop[0].type; |
| 2602 | bv_variable ret = Common::create_vec(prog, outType, vec->type->props.name_count); |
| 2603 | bv_object* retObj = bv_variable_get_object(ret); |
| 2604 | |
| 2605 | for (u16 i = 0; i < retObj->type->props.name_count; i++) |
| 2606 | retObj->prop[i] = bv_variable_cast(outType, bv_variable_create_int(vecData[i])); |
| 2607 | |
| 2608 | return ret; |
| 2609 | } |
| 2610 | // bitfieldReverse(scalar) |
| 2611 | else if (args[0].type == bv_type_int) |
| 2612 | return bv_variable_create_int(glm::findLSB(bv_variable_get_int(args[0]))); |
| 2613 | // bitfieldReverse(scalar) |
| 2614 | else |
| 2615 | return bv_variable_create_uint(glm::findLSB(bv_variable_get_uint(bv_variable_cast(bv_type_uint, args[0])))); |
| 2616 | } |
| 2617 | |
| 2618 | return bv_variable_create_int(0); |
| 2619 | } |
| 2620 | bv_variable lib_common_findMSB(bv_program* prog, u8 count, bv_variable* args) |
| 2621 | { |
| 2622 | /* bitfieldReverse(genI/UType) */ |
nothing calls this directly
no test coverage detected