blob: da58653d694c8a2f25cd2b0e1237943159f04286 [file] [log] [blame]
Lynn Boger38604782017-10-30 10:36:15 -04001// Copyright 2017 The Go Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5// +build ppc64 ppc64le
6
7#include "textflag.h"
8
9// func Modf(f float64) (int float64, frac float64)
10TEXT ·Modf(SB),NOSPLIT,$0
11 FMOVD f+0(FP), F0
12 FRIZ F0, F1
13 FMOVD F1, int+8(FP)
14 FSUB F1, F0, F2
15 FCPSGN F2, F0, F2
16 FMOVD F2, frac+16(FP)
17 RET