You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For each of the routines that is implemented in platform-specific assembly, there are Rust fallback routines (originally C fallback routines) that are used when rav1d is built with asm disabled. A large part of this code is still raw c2rust output because cleanup of these routines wasn't necessary during the initial phases of development (initial development specifically focused on asm support, so the fallback routines weren't necessary).
Cleanup of these routines is also more difficult than other transpiled code because these routines need maintain an unsafe extern "C" interface since they replace unsafe asm calls. This often means that arguments can't be made fully safe, limiting how safe the body of the function can be. In general we try to split these functions into two parts:
foo_c_erased - An unsafe extern "C" function that acts as the fallback an asm routine.
foo_rust - A (hopefullly) safe implementation of the fallback routine.
The _c_erased variant takes the raw arguments that are passed to the asm routine and converts them to safe arguments to then pass to the _rust variant. This isn't always possible, though, and we may need to use unsafe arguments/operations in the _rust version.
The text was updated successfully, but these errors were encountered:
For each of the routines that is implemented in platform-specific assembly, there are Rust fallback routines (originally C fallback routines) that are used when rav1d is built with asm disabled. A large part of this code is still raw c2rust output because cleanup of these routines wasn't necessary during the initial phases of development (initial development specifically focused on asm support, so the fallback routines weren't necessary).
Cleanup of these routines is also more difficult than other transpiled code because these routines need maintain an unsafe
extern "C"
interface since they replace unsafe asm calls. This often means that arguments can't be made fully safe, limiting how safe the body of the function can be. In general we try to split these functions into two parts:foo_c_erased
- Anunsafe extern "C"
function that acts as the fallback an asm routine.foo_rust
- A (hopefullly) safe implementation of the fallback routine.The
_c_erased
variant takes the raw arguments that are passed to the asm routine and converts them to safe arguments to then pass to the_rust
variant. This isn't always possible, though, and we may need to use unsafe arguments/operations in the_rust
version.The text was updated successfully, but these errors were encountered: