Skip to content

Commit

Permalink
Auto merge of rust-lang#127027 - tgross35:f16-f128-math, r=<try>
Browse files Browse the repository at this point in the history
Add `f16` and `f128` math functions

WIP

This will be pretty finicky among selection failures, the lowering bug, and lack of symbols. But might as well start somewhere.

Checks will fail until rust-lang#126636 makes it to beta, which should be next week (July 19).

try-job: aarch64-gnu
  • Loading branch information
bors committed Jul 12, 2024
2 parents 5d76a13 + 9dd7bb8 commit 977d16e
Show file tree
Hide file tree
Showing 12 changed files with 3,705 additions and 100 deletions.
8 changes: 4 additions & 4 deletions compiler/rustc_codegen_llvm/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -739,10 +739,10 @@ impl<'ll> CodegenCx<'ll, '_> {
ifn!("llvm.debugtrap", fn() -> void);
ifn!("llvm.frameaddress", fn(t_i32) -> ptr);

ifn!("llvm.powi.f16", fn(t_f16, t_i32) -> t_f16);
ifn!("llvm.powi.f32", fn(t_f32, t_i32) -> t_f32);
ifn!("llvm.powi.f64", fn(t_f64, t_i32) -> t_f64);
ifn!("llvm.powi.f128", fn(t_f128, t_i32) -> t_f128);
ifn!("llvm.powi.f16.i32", fn(t_f16, t_i32) -> t_f16);
ifn!("llvm.powi.f32.i32", fn(t_f32, t_i32) -> t_f32);
ifn!("llvm.powi.f64.i32", fn(t_f64, t_i32) -> t_f64);
ifn!("llvm.powi.f128.i32", fn(t_f128, t_i32) -> t_f128);

ifn!("llvm.pow.f16", fn(t_f16, t_f16) -> t_f16);
ifn!("llvm.pow.f32", fn(t_f32, t_f32) -> t_f32);
Expand Down
8 changes: 4 additions & 4 deletions compiler/rustc_codegen_llvm/src/intrinsic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ fn get_simple_intrinsic<'ll>(
sym::sqrtf64 => "llvm.sqrt.f64",
sym::sqrtf128 => "llvm.sqrt.f128",

sym::powif16 => "llvm.powi.f16",
sym::powif32 => "llvm.powi.f32",
sym::powif64 => "llvm.powi.f64",
sym::powif128 => "llvm.powi.f128",
sym::powif16 => "llvm.powi.f16.i32",
sym::powif32 => "llvm.powi.f32.i32",
sym::powif64 => "llvm.powi.f64.i32",
sym::powif128 => "llvm.powi.f128.i32",

sym::sinf16 => "llvm.sin.f16",
sym::sinf32 => "llvm.sin.f32",
Expand Down
Loading

0 comments on commit 977d16e

Please sign in to comment.