Source/Packages

Platform.AArch64.FloatRoutine

packages/hardware/platforms/dgx-spark/src/Platform/AArch64/FloatRoutine.alpha

48 lines2 declarations1.6 KiBSHA-256 8021faa8dbc0

Complete file

FloatRoutine.alpha

Definition view
1module Platform.AArch64.FloatRoutine
2
3import Compiler.MachineAArch64
4import Compiler.MachineAArch64Assembly
5import Platform.AArch64.RoutineEmitter
6
7-- x0 holds a binary64 value's bits, not a pointer. Only x0/x1 and flags
8-- change. Eleven exponent bits equal to 2047 identify infinities/NaNs;
9-- all finite values, including signed zero and subnormals, return zero.
10def aarch64Float64FiniteAssembly =
11  (ahrEmit
12    (constructor
13      AArch64Instruction
14      AArch64ShiftRightImmediate
15      (constructor AArch64Register AArch64X0)
16      (constructor AArch64Register AArch64X0)
17      52)
18    (ahrMovImm
19      (constructor AArch64Register AArch64X1)
20      2047
21      (ahrEmit
22        (constructor
23          AArch64Instruction
24          AArch64AndRegister
25          (constructor AArch64Register AArch64X0)
26          (constructor AArch64Register AArch64X0)
27          (constructor AArch64Register AArch64X1))
28        (ahrEmit
29          (constructor
30            AArch64Instruction
31            AArch64CompareImmediate
32            (constructor AArch64Register AArch64X0)
33            2047)
34          (constructor
35            AArch64Assembly
36            AArch64AssemblyBranchIf
37            (constructor AArch64Condition AArch64NotEqual)
38            b"finite"
39            (ahrMovImm
40              (constructor AArch64Register AArch64X0)
41              1
42              (ahrReturn
43                (ahrLabel
44                  b"finite"
45                  (ahrMovImm (constructor AArch64Register AArch64X0) 0 (ahrReturn ahrEnd))))))))))
46
47def aarch64Float64FiniteCode =
48  (aarch64RoutineBytes aarch64Float64FiniteAssembly)

The compiler supplied declaration spans and resolved links from this source snapshot. This page does not assert that this file belongs to a checked closure.