Skip to content

Commit 2e9bb45

Browse files
committed
Add an implementation for f128 multiplication
1 parent 890e236 commit 2e9bb45

File tree

4 files changed

+17
-4
lines changed

4 files changed

+17
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ These builtins are needed to support `f16` and `f128`, which are in the process
249249
- [ ] floatsitf.c
250250
- [ ] floatunditf.c
251251
- [ ] floatunsitf.c
252-
- [ ] multf3.c
252+
- [x] multf3.c
253253
- [ ] powitf2.c
254254
- [ ] ppc/fixtfdi.c
255255
- [ ] ppc/fixunstfdi.c

build.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,6 @@ mod c {
479479
("__floatsitf", "floatsitf.c"),
480480
("__floatunditf", "floatunditf.c"),
481481
("__floatunsitf", "floatunsitf.c"),
482-
("__multf3", "multf3.c"),
483482
("__divtf3", "divtf3.c"),
484483
("__powitf2", "powitf2.c"),
485484
("__fe_getround", "fp_mode.c"),
@@ -504,7 +503,6 @@ mod c {
504503
("__fixunstfsi", "fixunstfsi.c"),
505504
("__floatunsitf", "floatunsitf.c"),
506505
("__fe_getround", "fp_mode.c"),
507-
("__divtf3", "divtf3.c"),
508506
]);
509507
}
510508

@@ -517,7 +515,6 @@ mod c {
517515
("__fixunstfsi", "fixunstfsi.c"),
518516
("__floatunsitf", "floatunsitf.c"),
519517
("__fe_getround", "fp_mode.c"),
520-
("__divtf3", "divtf3.c"),
521518
]);
522519
}
523520

src/float/mul.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,11 @@ intrinsics! {
199199
mul(a, b)
200200
}
201201

202+
#[cfg(not(feature = "no-f16-f128"))]
203+
pub extern "C" fn __multf3(a: f128, b: f128) -> f128 {
204+
mul(a, b)
205+
}
206+
202207
#[cfg(target_arch = "arm")]
203208
pub extern "C" fn __mulsf3vfp(a: f32, b: f32) -> f32 {
204209
a * b

testcrate/tests/mul.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#![allow(unused_macros)]
2+
#![feature(f128)]
3+
#![feature(f16)]
24

35
use core::ops::Mul;
46
use testcrate::*;
@@ -114,6 +116,15 @@ fn float_mul() {
114116
f32, __mulsf3, Single, all();
115117
f64, __muldf3, Double, all();
116118
);
119+
120+
#[cfg(not(feature = "no-f16-f128"))]
121+
{
122+
use compiler_builtins::float::mul::__multf3;
123+
124+
float_mul!(
125+
f128, __multf3, Quad, not(feature = "no-sys-f128");
126+
);
127+
}
117128
}
118129

119130
#[cfg(target_arch = "arm")]

0 commit comments

Comments
 (0)