Skip to content

Commit 0664391

Browse files
committed
Emerald: removed -sse,-mmx,+soft_float to enable SSE
x86_64 CPUs will have SSE available, but need to be enabled by the kernel. which we will do next.
1 parent e3c2e85 commit 0664391

File tree

3 files changed

+89
-9
lines changed

3 files changed

+89
-9
lines changed
Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
1-
use crate::spec::{base, StackProbeType, Target, TargetOptions};
1+
use crate::spec::{base, StackProbeType, Target};
22

33
pub fn target() -> Target {
4+
let mut base = base::emerald::opts();
5+
base.cpu = "x86-64".into();
6+
base.plt_by_default = false;
7+
base.max_atomic_width = Some(64);
8+
base.stack_probes = StackProbeType::Inline;
9+
410
Target {
511
llvm_target: "x86_64-unknown-none".into(),
612
pointer_width: 64,
713
arch: "x86_64".into(),
814
data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
915
.into(),
10-
options: TargetOptions {
11-
cpu: "x86-64".into(),
12-
features: "-mmx,-sse,+soft-float".into(),
13-
plt_by_default: false,
14-
max_atomic_width: Some(64),
15-
stack_probes: StackProbeType::Inline,
16-
..base::emerald::opts()
17-
},
16+
options: base,
1817
}
1918
}

library/std/src/sys/cmath/emerald.rs

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
extern "C" {
2+
pub fn acos(n: f64) -> f64;
3+
pub fn acosf(n: f32) -> f32;
4+
pub fn asin(n: f64) -> f64;
5+
pub fn asinf(n: f32) -> f32;
6+
pub fn atan(n: f64) -> f64;
7+
pub fn atan2(a: f64, b: f64) -> f64;
8+
pub fn atan2f(a: f32, b: f32) -> f32;
9+
pub fn atanf(n: f32) -> f32;
10+
pub fn cbrt(n: f64) -> f64;
11+
pub fn cbrtf(n: f32) -> f32;
12+
pub fn cosh(n: f64) -> f64;
13+
pub fn coshf(n: f32) -> f32;
14+
pub fn expm1(n: f64) -> f64;
15+
pub fn expm1f(n: f32) -> f32;
16+
pub fn fdim(a: f64, b: f64) -> f64;
17+
pub fn fdimf(a: f32, b: f32) -> f32;
18+
pub fn hypot(x: f64, y: f64) -> f64;
19+
pub fn hypotf(x: f32, y: f32) -> f32;
20+
pub fn log1p(n: f64) -> f64;
21+
pub fn log1pf(n: f32) -> f32;
22+
pub fn sinh(n: f64) -> f64;
23+
pub fn sinhf(n: f32) -> f32;
24+
pub fn tan(n: f64) -> f64;
25+
pub fn tanf(n: f32) -> f32;
26+
pub fn tanh(n: f64) -> f64;
27+
pub fn tanhf(n: f32) -> f32;
28+
pub fn tgamma(n: f64) -> f64;
29+
pub fn tgammaf(n: f32) -> f32;
30+
pub fn lgamma_r(n: f64, s: &mut i32) -> f64;
31+
pub fn lgammaf_r(n: f32, s: &mut i32) -> f32;
32+
}
33+
34+
// pub fn j() {
35+
// emerald_builtins::math::fmod(1.0);
36+
// }
37+
38+
// macro_rules! no_mangle {
39+
// ($(fn $fun:ident($($iid:ident : $ity:ty),+) -> $oty:ty;)+) => {
40+
// $(
41+
// #[no_mangle]
42+
// pub unsafe extern "C" fn $fun($($iid: $ity),+) -> $oty {
43+
// emerald_builtins::math::$fun($($iid),+)
44+
// }
45+
// )+
46+
// }
47+
// }
48+
49+
// no_mangle! {
50+
// fn acos(n: f64) -> f64;
51+
// fn acosf(n: f32) -> f32;
52+
// fn asin(n: f64) -> f64;
53+
// fn asinf(n: f32) -> f32;
54+
// fn atan(n: f64) -> f64;
55+
// fn atan2(a: f64, b: f64) -> f64;
56+
// fn atan2f(a: f32, b: f32) -> f32;
57+
// fn atanf(n: f32) -> f32;
58+
// fn cbrt(n: f64) -> f64;
59+
// fn cbrtf(n: f32) -> f32;
60+
// fn cosh(n: f64) -> f64;
61+
// fn coshf(n: f32) -> f32;
62+
// fn expm1(n: f64) -> f64;
63+
// fn expm1f(n: f32) -> f32;
64+
// fn fdim(a: f64, b: f64) -> f64;
65+
// fn fdimf(a: f32, b: f32) -> f32;
66+
// fn hypot(x: f64, y: f64) -> f64;
67+
// fn hypotf(x: f32, y: f32) -> f32;
68+
// fn log1p(n: f64) -> f64;
69+
// fn log1pf(n: f32) -> f32;
70+
// fn sinh(n: f64) -> f64;
71+
// fn sinhf(n: f32) -> f32;
72+
// fn tan(n: f64) -> f64;
73+
// fn tanf(n: f32) -> f32;
74+
// fn tanh(n: f64) -> f64;
75+
// fn tanhf(n: f32) -> f32;
76+
// fn tgamma(n: f64) -> f64;
77+
// fn tgammaf(n: f32) -> f32;
78+
// fn lgamma_r(n: f64, s: &mut i32) -> f64;
79+
// fn lgammaf_r(n: f32, s: &mut i32) -> f32;
80+
// }

src/tools/build-manifest/src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ static TARGETS: &[&str] = &[
166166
"x86_64-unknown-redox",
167167
"x86_64-unknown-hermit",
168168
"x86_64-unknown-uefi",
169+
"x86_64-unknown-emerald",
169170
];
170171

171172
/// This allows the manifest to contain rust-docs for hosts that don't build

0 commit comments

Comments
 (0)