Skip to content

Commit

Permalink
Add some missing functions to examples/intrinsics
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross35 committed May 21, 2024
1 parent 2ad1a15 commit 8b2f5da
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions examples/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ mod intrinsics {
x as i64
}

pub fn fixsfti(x: f32) -> i128 {
x as i128
}

// fixunssfsi
pub fn aeabi_f2uiz(x: f32) -> u32 {
x as u32
Expand All @@ -78,6 +82,10 @@ mod intrinsics {
x as u64
}

pub fn fixunssfti(x: f32) -> u128 {
x as u128
}

// addsf3
pub fn aeabi_fadd(a: f32, b: f32) -> f32 {
a + b
Expand Down Expand Up @@ -130,6 +138,10 @@ mod intrinsics {
x as i64
}

pub fn fixdfti(x: f64) -> i128 {
x as i128
}

// fixunsdfsi
pub fn aeabi_d2uiz(x: f64) -> u32 {
x as u32
Expand All @@ -140,6 +152,10 @@ mod intrinsics {
x as u64
}

pub fn fixunsdfti(x: f64) -> u128 {
x as u128
}

// adddf3
pub fn aeabi_dadd(a: f64, b: f64) -> f64 {
a + b
Expand Down Expand Up @@ -431,12 +447,16 @@ fn run() {
#[cfg(not(any(target_arch = "powerpc", target_arch = "powerpc64")))]
bb(extendhftf(bb(2.)));
bb(extendsftf(bb(2.)));
bb(fixdfti(bb(2.)));
bb(fixsfti(bb(2.)));
#[cfg(not(any(target_arch = "powerpc", target_arch = "powerpc64")))]
bb(fixtfdi(bb(2.)));
#[cfg(not(any(target_arch = "powerpc", target_arch = "powerpc64")))]
bb(fixtfsi(bb(2.)));
#[cfg(not(any(target_arch = "powerpc", target_arch = "powerpc64")))]
bb(fixtfti(bb(2.)));
bb(fixunsdfti(bb(2.)));
bb(fixunssfti(bb(2.)));
#[cfg(not(any(target_arch = "powerpc", target_arch = "powerpc64")))]
bb(fixunstfdi(bb(2.)));
#[cfg(not(any(target_arch = "powerpc", target_arch = "powerpc64")))]
Expand Down

0 comments on commit 8b2f5da

Please sign in to comment.