Source/Packages

Compiler.MachineX86NativeAssembly

packages/compiler/src/Compiler/MachineX86NativeAssembly.alpha

548 lines56 declarations22.2 KiBSHA-256 4a24f06c7be3

def · lines 340–388

x86NativeEncodeLEAToLabel

Full file
340def x86NativeEncodeLEAToLabel :
341  (pi unrestricted destination : (family X86NativeRegister64) .
342    (pi unrestricted targetName : Bytes .
343      (pi unrestricted labels : (family X86NativeLabelTable) .
344        (pi unrestricted sourceEnd : (family X86NativeUnsigned32) .
345          (pi unrestricted tailResult : (family X86NativeAssemblyResult) .
346            (family X86NativeAssemblyResult)))))) =
347  (lambda unrestricted destination : (family X86NativeRegister64) .
348    (lambda unrestricted targetName : Bytes .
349      (lambda unrestricted labels : (family X86NativeLabelTable) .
350        (lambda unrestricted sourceEnd : (family X86NativeUnsigned32) .
351          (lambda unrestricted tailResult : (family X86NativeAssemblyResult) .
352            (eliminate
353              X86NativeLabelLookupResult
354              (lambda unrestricted lookup : (family X86NativeLabelLookupResult) .
355                (family X86NativeAssemblyResult))
356              (x86NativeLookupLabel targetName labels)
357              (branch
358                X86NativeLabelFound
359                targetOffset
360                .
361                (eliminate
362                  X86NativeRelativeDisplacementResult
363                  (lambda unrestricted displacementResult : (family X86NativeRelativeDisplacementResult) .
364                    (family X86NativeAssemblyResult))
365                  (x86NativeRelativeDisplacement targetOffset sourceEnd)
366                  (branch
367                    X86NativeRelativeDisplacementSuccess
368                    displacement
369                    .
370                    (x86NativePrependAssemblyBytes
371                      (x86EncodeNativeInstruction
372                        (constructor
373                          X86NativeInstruction
374                          X86NativeLoadEffectiveAddressRIP
375                          destination
376                          (x86NativeUnsigned32Displacement displacement)))
377                      tailResult))
378                  (branch
379                    X86NativeRelativeDisplacementOutOfRange
380                    .
381                    (constructor
382                      X86NativeAssemblyResult
383                      X86NativeAssemblyDisplacementOutOfRange
384                      targetName))))
385              (branch
386                X86NativeLabelMissing
387                .
388                (constructor X86NativeAssemblyResult X86NativeAssemblyMissingLabel targetName))))))))

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.