about summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa/src/mir
diff options
context:
space:
mode:
authorTrevor Gross <tmgross@umich.edu>2024-02-28 03:44:23 -0500
committerTrevor Gross <tmgross@umich.edu>2024-02-28 12:58:32 -0500
commite3f63d93755f2f62b4a52686f608b9664e87f092 (patch)
tree6d29765020fdfbd6bd2d049b5079baa83c4a4382 /compiler/rustc_codegen_ssa/src/mir
parentef324565d071c6d7e2477a195648549e33d6a465 (diff)
downloadrust-e3f63d93755f2f62b4a52686f608b9664e87f092.tar.gz
rust-e3f63d93755f2f62b4a52686f608b9664e87f092.zip
Add `f16` and `f128` to `rustc_type_ir::FloatTy` and `rustc_abi::Primitive`
Make changes necessary to support these types in the compiler.
Diffstat (limited to 'compiler/rustc_codegen_ssa/src/mir')
-rw-r--r--compiler/rustc_codegen_ssa/src/mir/rvalue.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/compiler/rustc_codegen_ssa/src/mir/rvalue.rs b/compiler/rustc_codegen_ssa/src/mir/rvalue.rs
index 5c6060a7159..f7ff36c0467 100644
--- a/compiler/rustc_codegen_ssa/src/mir/rvalue.rs
+++ b/compiler/rustc_codegen_ssa/src/mir/rvalue.rs
@@ -303,15 +303,17 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
         self.assume_scalar_range(bx, imm, from_scalar, from_backend_ty);
 
         imm = match (from_scalar.primitive(), to_scalar.primitive()) {
-            (Int(..) | F32 | F64, Int(..) | F32 | F64) => bx.bitcast(imm, to_backend_ty),
+            (Int(..) | F16 | F32 | F64 | F128, Int(..) | F16 | F32 | F64 | F128) => {
+                bx.bitcast(imm, to_backend_ty)
+            }
             (Pointer(..), Pointer(..)) => bx.pointercast(imm, to_backend_ty),
             (Int(..), Pointer(..)) => bx.inttoptr(imm, to_backend_ty),
             (Pointer(..), Int(..)) => bx.ptrtoint(imm, to_backend_ty),
-            (F32 | F64, Pointer(..)) => {
+            (F16 | F32 | F64 | F128, Pointer(..)) => {
                 let int_imm = bx.bitcast(imm, bx.cx().type_isize());
                 bx.inttoptr(int_imm, to_backend_ty)
             }
-            (Pointer(..), F32 | F64) => {
+            (Pointer(..), F16 | F32 | F64 | F128) => {
                 let int_imm = bx.ptrtoint(imm, bx.cx().type_isize());
                 bx.bitcast(int_imm, to_backend_ty)
             }