github.com/xushiwei/go@v0.0.0-20130601165731-2b9d83f45bc9/src/pkg/runtime/vlop_386.s (about) 1 // Inferno's libkern/vlop-386.s 2 // http://code.google.com/p/inferno-os/source/browse/libkern/vlop-386.s 3 // 4 // Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. 5 // Revisions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com). All rights reserved. 6 // Portions Copyright 2009 The Go Authors. All rights reserved. 7 // 8 // Permission is hereby granted, free of charge, to any person obtaining a copy 9 // of this software and associated documentation files (the "Software"), to deal 10 // in the Software without restriction, including without limitation the rights 11 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 // copies of the Software, and to permit persons to whom the Software is 13 // furnished to do so, subject to the following conditions: 14 // 15 // The above copyright notice and this permission notice shall be included in 16 // all copies or substantial portions of the Software. 17 // 18 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 // THE SOFTWARE. 25 26 /* 27 * C runtime for 64-bit divide. 28 */ 29 30 TEXT _mul64by32(SB), 7, $0 31 MOVL r+0(FP), CX 32 MOVL a+4(FP), AX 33 MULL b+12(FP) 34 MOVL AX, 0(CX) 35 MOVL DX, BX 36 MOVL a+8(FP), AX 37 MULL b+12(FP) 38 ADDL AX, BX 39 MOVL BX, 4(CX) 40 RET 41 42 TEXT _div64by32(SB), 7, $0 43 MOVL r+12(FP), CX 44 MOVL a+0(FP), AX 45 MOVL a+4(FP), DX 46 DIVL b+8(FP) 47 MOVL DX, 0(CX) 48 RET