Luce packages
LuceLuce BaseLuciaOS

dymokomi/luce-base

Source of release 0.41.0

0.41.0 / src / back / native / arm64 / inline_asm.lucb

#==============================================================================================
#
#   arm64/inline_asm - Inline assembly
#
#   DESCRIPTION:
#       An `asm` block written for arm64, its text copied into the function; a block for
#       another architecture writes nothing here (ยง8.9).
#
#==============================================================================================
extend Generator:
    # mark: Inline assembly ====================================================================

    ## The block's text, when it is written for arm64.
    func inline_asm(n: ir.Instr) -> !:
        let arch = self.program_unit.texts.get((usize)n.a.index).bytes
        if arch != "arm64":
            return
        let body = self.program_unit.texts.get((usize)n.b.index).bytes
        try self.writer.put("\n")
        try self.writer.put(body)