Skip to content

Conversation

Amanieu
Copy link
Member

@Amanieu Amanieu commented Aug 18, 2016

No description provided.

@Amanieu Amanieu force-pushed the sdiv branch 3 times, most recently from 5382cf5 to aa2561a Compare August 18, 2016 23:47

#[naked]
#[cfg_attr(not(test), no_mangle)]
pub unsafe fn __aeabi_idivmod() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to add a test for this assembly routine (and the one below)? Just to check its expected signature (fn(u32, u32) -> (u32,u32) in this case, I think) works as expected?

@japaric
Copy link
Contributor

japaric commented Aug 19, 2016

I thought the aeabi intrinsics could have been tested by calling let (q, r) = __aeabi_uldivmod(n, d) in the test function (instead of the current asm! block) but I guess is not possible because of the custom calling convention these intrinsics use?

@Amanieu
Copy link
Member Author

Amanieu commented Aug 19, 2016

Yea, you need asm to call them with the custom convention.

src/sdiv.rs Outdated
}

macro_rules! divmod {
($intrinsic:ident, $div:ident: $ty:ty, $uty:ty) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$uty is not used in this macro?

@japaric
Copy link
Contributor

japaric commented Aug 19, 2016

Yea, you need asm to call them with the custom convention.

OK. Thanks for clarifying.

I left some comments about nits. r=me after those are addressed.

@Amanieu Amanieu force-pushed the sdiv branch 2 times, most recently from ca354ff to 95d3b84 Compare August 19, 2016 11:12
@japaric japaric merged commit 8603e64 into rust-lang:master Aug 19, 2016
@japaric
Copy link
Contributor

japaric commented Aug 19, 2016

Thanks @Amanieu!

tgross35 pushed a commit to tgross35/compiler-builtins that referenced this pull request Feb 23, 2025
108: coshf tanhf and atan2f r=japaric a=burrbull

closes rust-lang#44
closes rust-lang#52
closes rust-lang#41

Co-authored-by: Andrey Zgarbul <[email protected]>
Co-authored-by: Zgarbul Andrey <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants