1module Platform.AArch64.PublicationRoutine
2
3import Compiler.MachineAArch64
4import Compiler.MachineAArch64Assembly
5import Model.Config
6
7-- The AAPCS64 twin of Runtime.NativePhysicalTrainingRoutine's Publish32:
8-- x0 points to GPPut, w1 is its new value, x2 points to the doorbell, w3 is
9-- the submit token. DSB SY completes preceding normal-memory writes before
10-- the device-memory doorbell store. A second host thread is not involved.
11-- The barrier's encoding is checked separately; single-thread test output
12-- cannot establish this ordering property on a GPU.
13def aarch64Publish32Assembly : (family AArch64Assembly) =
14 (constructor AArch64Assembly AArch64AssemblyEmit
15 (constructor AArch64Instruction AArch64StoreMemory32
16 (constructor AArch64Register AArch64X0) 0 (constructor AArch64Register AArch64X1))
17 (constructor AArch64Assembly AArch64AssemblyEmit
18 (constructor AArch64Instruction AArch64DataSynchronizationBarrierSystem)
19 (constructor AArch64Assembly AArch64AssemblyEmit
20 (constructor AArch64Instruction AArch64StoreMemory32
21 (constructor AArch64Register AArch64X2) 0 (constructor AArch64Register AArch64X3))
22 (constructor AArch64Assembly AArch64AssemblyEmit
23 (constructor AArch64Instruction AArch64MoveWideZero
24 (constructor AArch64Register AArch64X0) 0 (constructor AArch64HalfwordShift AArch64Shift0))
25 (constructor AArch64Assembly AArch64AssemblyEmit
26 (constructor AArch64Instruction AArch64Return)
27 (constructor AArch64Assembly AArch64AssemblyEnd))))))
28
29def aarch64Publish32Routine : Bytes =
30 (eliminate AArch64AssemblyResult (lambda unrestricted result : (family AArch64AssemblyResult) . Bytes)
31 (aarch64Assemble aarch64Publish32Assembly)
32 (branch AArch64AssemblyEncoded code . code)
33 (branch AArch64AssemblyEncodeDuplicateLabel name . b"")
34 (branch AArch64AssemblyMissingLabel name . b"")
35 (branch AArch64AssemblyDisplacementOutOfRange name . b"")
36 (branch AArch64AssemblyOperandRefused value . b""))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.