From a15c109e8da2ae69dc138aafe0f10d16d341c38e Mon Sep 17 00:00:00 2001 From: Derek Hageman Date: Sat, 19 Feb 2022 16:22:08 -0700 Subject: [PATCH] Change hardware divider results structure order Putting the quotient first makes the compiler emit slightly better code by putting the quotient in r0 which is generally what the intrinsics want. --- rp2040-hal/src/sio.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rp2040-hal/src/sio.rs b/rp2040-hal/src/sio.rs index a2f769f..367c55d 100644 --- a/rp2040-hal/src/sio.rs +++ b/rp2040-hal/src/sio.rs @@ -43,10 +43,10 @@ pub struct HwDivider { /// Result of divide/modulo operation pub struct DivResult { - /// The remainder of divide/modulo operation - pub remainder: T, /// The quotient of divide/modulo operation pub quotient: T, + /// The remainder of divide/modulo operation + pub remainder: T, } /// Struct containing ownership markers for managing ownership of the SIO registers.