f64FromParts
On this page

f64FromParts()

Function in Builtins

Assemble an f64 from its (hi, lo) f32 halves, the shader-side counterpart of splitF64 for a value that arrives as two f32 components.

import { f64FromParts } from 'typeshade'

The signature, the description and the examples come from the compiler's own source at commit 26de7be8.

Syntax

const f64FromParts: (
hi: ReadonlyNode<"f32"> | number,
lo: ReadonlyNode<"f32"> | number,
) => Node<"f64">

Parameters

hi ReadonlyNode<'f32'> | number
lo ReadonlyNode<'f32'> | number

Return value

Node<'f64'>

Description

Assemble an f64 from its (hi, lo) f32 halves, the shader-side counterpart of splitF64 for a value that arrives as two f32 components (a hi/lo vertex attribute pair, a packed buffer). It costs nothing: the result is the pair (hi, lo) itself. The halves must be a normalized split, lo = x − hi as splitF64 produces. Nothing renormalizes a pair that is not: the comparisons decide on hi first and can answer wrongly for it ((1, 1) is 2, yet it compares below (1.5, 0)), and a multiply or divide by a power-of-two literal scales the two words as they are, so the product is exactly as un-normalized as the operand.

Targets

TargetSupportNotes
WGSL (WebGPU) Emulated

Rewritten by fp64Lower into a pair of f32 lanes before the backend runs.

GLSL ES 3.00 (WebGL2) Emulated

Rewritten by fp64Lower into a pair of f32 lanes before the backend runs.

CPU oracle Supported

Evaluated in f64 by the oracle.

In the guide

Source

src/core/ir/node.ts, line 2389, at commit 26de7be8

Edit this page Report a problem