Skip to content

Add support for mul[s/d]f3vfp and div[s/d]f3vfp #225

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 31, 2018

Conversation

paoloteti
Copy link
Contributor

Here using "C" the compiler will use "aapcs" or "aapcs-vfp" depending on target configuration.

Of course this translates in a call to __aeabi_fdiv / __aeabi_fmul on non-HF targets.

On eabi targets with +vfpv2/vfpv3 LLVM generate:

   vmov	s0, r1
   vmov	s2, r0
   vdiv.f32	s0, s2, s0
   vmov	r0, s0
   bx	lr

On eabihf targets with +vfpv3-d16/d32/f32 +fp-only-sp LLVM generate:

  vdiv.f32	s0, s0, s1
  bx	lr

That's exactly what We need for [div/mul][s/d]f3vfp.S

Here using `"C"` the compiler will use `"aapcs"` or `"aapcs-vfp"`
depending on target configuration.

Of course this translates in a call to `__aeabi_fdiv` / `__aeabi_fmul`
on non-HF targets.

On `eabi` targets with +vfpv2/vfpv3 LLVM generate:

   vmov	s0, r1
   vmov	s2, r0
   vdiv.f32	s0, s2, s0
   vmov	r0, s0
   bx	lr

On `eabihf` targets with +vfpv3-d16/d32/f32 +fp-only-sp LLVM generate:

  vdiv.f32	s0, s0, s1
  bx	lr

That's exactly what We need for [div/mul][s/d]f3vfp.S
@alexcrichton
Copy link
Member

Thanks! Could you be sure to add some tests for these as well?

@paoloteti
Copy link
Contributor Author

paoloteti commented Jan 30, 2018

Done! Of course on QEMU/TravisCI We still have an ICE:

error: internal compiler error: librustc_metadata/cstore_impl.rs:131: get_optimized_mir: missing MIR for DefId(3/0:10 ~ utest_cortex_m_qemu[f0f1]::lang_items[0]::start[0])

@alexcrichton
Copy link
Member

Thanks! Ah yeah it's fine to ignore the thumb targets on CI (feel free to add an allow_failure if you're enterprising!) but looks like other targets may be failing as well?

I removed std::mem, but We need it.
@alexcrichton alexcrichton merged commit 93977e6 into rust-lang:master Jan 31, 2018
@alexcrichton
Copy link
Member

Thanks!

@paoloteti paoloteti deleted the armhf branch January 31, 2018 18:15
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