~ubuntu-branches/ubuntu/saucy/golang/saucy

« back to all changes in this revision

Viewing changes to src/pkg/math/modf_386.s

  • Committer: Package Import Robot
  • Author(s): Adam Conrad
  • Date: 2013-07-08 05:52:37 UTC
  • mfrom: (29.1.1 sid)
  • Revision ID: package-import@ubuntu.com-20130708055237-at01839e0hp8z3ni
Tags: 2:1.1-1ubuntu1
016-armhf-elf-header.patch: Use correct ELF header for armhf binaries.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
// Use of this source code is governed by a BSD-style
3
3
// license that can be found in the LICENSE file.
4
4
 
5
 
// func Modf(x float64) (int float64, frac float64)
 
5
// func Modf(f float64) (int float64, frac float64)
6
6
TEXT ·Modf(SB),7,$0
7
 
        FMOVD   x+0(FP), F0  // F0=x
8
 
        FMOVD   F0, F1       // F0=x, F1=x
 
7
        FMOVD   f+0(FP), F0  // F0=f
 
8
        FMOVD   F0, F1       // F0=f, F1=f
9
9
        FSTCW   -2(SP)       // save old Control Word
10
10
        MOVW    -2(SP), AX
11
11
        ORW     $0x0c00, AX  // Rounding Control set to truncate
12
12
        MOVW    AX, -4(SP)   // store new Control Word
13
13
        FLDCW   -4(SP)       // load new Control Word
14
 
        FRNDINT              // F0=trunc(x), F1=x
 
14
        FRNDINT              // F0=trunc(f), F1=f
15
15
        FLDCW   -2(SP)       // load old Control Word
16
 
        FSUBD   F0, F1       // F0=trunc(x), F1=x-trunc(x)
17
 
        FMOVDP  F0, i+8(FP)  // F0=x-trunc(x)
18
 
        FMOVDP  F0, f+16(FP)
 
16
        FSUBD   F0, F1       // F0=trunc(f), F1=f-trunc(f)
 
17
        FMOVDP  F0, int+8(FP)  // F0=f-trunc(f)
 
18
        FMOVDP  F0, frac+16(FP)
19
19
        RET