35 lines
986 B
ArmAsm
35 lines
986 B
ArmAsm
// Copyright (c) 2026 Petr Balvín <opensource@petrbalvin.org> (https://petrbalvin.org)
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
// Differential kernel for the arm64 FP immediate moves: the FMOV (immediate)
|
|
// instruction for the 8-bit encodable values and the FMOV-from-ZR move for
|
|
// zero. The values outside the 8-bit field pool through the toolchain's
|
|
// $f64 symbols with a PC-relative relocation; gasm carries no such pool and
|
|
// rejects the spelling instead (its previous encoding was wrong code).
|
|
// Every function is byte-compared against go tool asm.
|
|
|
|
#include "textflag.h"
|
|
|
|
// func encodable()
|
|
TEXT ·encodable(SB), NOSPLIT, $0-0
|
|
FMOVS $ (4.0), F0
|
|
FMOVD $ (4.0), F0
|
|
FMOVS $ (0.265625), F1
|
|
FMOVD $ (0.1796875), F2
|
|
FMOVS $ (0.96875), F3
|
|
FMOVD $ (28.0), F4
|
|
FMOVD $ (-4.0), F6
|
|
FMOVD $ (1.0), F7
|
|
FMOVD $ (0.5), F8
|
|
RET
|
|
|
|
// func zeroes()
|
|
TEXT ·zeroes(SB), NOSPLIT, $0-0
|
|
FMOVD $0, F0
|
|
FMOVS $0, F1
|
|
FMOVD $ (0.0), F5
|
|
FMOVS $ (0.0), F6
|
|
FMOVD ZR, F2
|
|
FMOVS ZR, F3
|
|
RET
|