Skip to content

Commit 5f9bbc9

Browse files
committed
More attempts for intrinsics example
1 parent e423f3c commit 5f9bbc9

File tree

1 file changed

+3
-23
lines changed

1 file changed

+3
-23
lines changed

examples/intrinsics.rs

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,11 @@
1515
#![feature(global_allocator)]
1616
#![feature(allocator_api)]
1717
#![cfg_attr(windows, feature(panic_unwind))]
18-
#![no_core]
19-
20-
extern crate core;
18+
#![no_std]
2119

2220
#[cfg(not(thumb))]
23-
extern crate alloc_system;
24-
extern crate compiler_builtins;
25-
#[cfg(windows)]
26-
extern crate panic_unwind;
27-
28-
#[cfg(not(thumb))]
29-
#[global_allocator]
30-
static A: alloc_system::System = alloc_system::System;
21+
#[link(name = "c")]
22+
extern {}
3123

3224
// NOTE cfg(not(thumbv6m)) means that the operation is not supported on ARMv6-M at all. Not even
3325
// compiler-rt provides a C/assembly implementation.
@@ -38,8 +30,6 @@ static A: alloc_system::System = alloc_system::System;
3830
// have an additional comment: the function name is the ARM name for the intrinsic and the comment
3931
// in the non-ARM name for the intrinsic.
4032
mod intrinsics {
41-
use core::num::Float;
42-
4333
// trunccdfsf2
4434
pub fn aeabi_d2f(x: f64) -> f32 {
4535
x as f32
@@ -299,14 +289,6 @@ mod intrinsics {
299289
a * b
300290
}
301291

302-
pub fn powidf2(a: f64, b: i32) -> f64 {
303-
a.powi(b)
304-
}
305-
306-
pub fn powisf2(a: f32, b: i32) -> f32 {
307-
a.powi(b)
308-
}
309-
310292
pub fn umoddi3(a: u64, b: u64) -> u64 {
311293
a % b
312294
}
@@ -398,8 +380,6 @@ fn run() {
398380
bb(aeabi_uldivmod(bb(2), bb(3)));
399381
bb(moddi3(bb(2), bb(3)));
400382
bb(mulodi4(bb(2), bb(3)));
401-
bb(powidf2(bb(2.), bb(3)));
402-
bb(powisf2(bb(2.), bb(3)));
403383
bb(umoddi3(bb(2), bb(3)));
404384
bb(muloti4(bb(2), bb(2)));
405385
bb(multi3(bb(2), bb(2)));

0 commit comments

Comments
 (0)