1
0
mirror of https://github.com/golang/go synced 2024-11-17 12:54:47 -07:00

math: implement Sqrt in assembly for riscv64

Change-Id: I9a5dc33271434e58335f5562a30cc131c6a8332c
Reviewed-on: https://go-review.googlesource.com/c/go/+/220918
Reviewed-by: Robert Griesemer <gri@golang.org>
This commit is contained in:
Joel Sing 2020-02-26 03:05:57 +11:00 committed by Robert Griesemer
parent 80e67324f0
commit 89f249a40d
2 changed files with 14 additions and 3 deletions

14
src/math/sqrt_riscv64.s Normal file
View File

@ -0,0 +1,14 @@
// Copyright 2020 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build riscv64
#include "textflag.h"
// func Sqrt(x float64) float64
TEXT ·Sqrt(SB),NOSPLIT,$0
MOVD x+0(FP), F0
FSQRTD F0, F0
MOVD F0, ret+8(FP)
RET

View File

@ -97,9 +97,6 @@ TEXT ·Cos(SB),NOSPLIT,$0
TEXT ·Cosh(SB),NOSPLIT,$0
JMP ·cosh(SB)
TEXT ·Sqrt(SB),NOSPLIT,$0
JMP ·sqrt(SB)
TEXT ·Tan(SB),NOSPLIT,$0
JMP ·tan(SB)