]>
Commit | Line | Data |
---|---|---|
1e57a462 | 1 | /** @file\r |
2 | Compiler intrinsic for 64-bit unisigned div, ported from LLVM code.\r | |
3 | \r | |
4 | Copyright (c) 2008-2009, Apple Inc. All rights reserved.<BR>\r | |
3402aac7 | 5 | \r |
1e57a462 | 6 | This program and the accompanying materials\r |
7 | are licensed and made available under the terms and conditions of the BSD License\r | |
8 | which accompanies this distribution. The full text of the license may be found at\r | |
9 | http://opensource.org/licenses/bsd-license.php\r | |
10 | \r | |
11 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
12 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
13 | \r | |
14 | **/\r | |
15 | /**\r | |
16 | University of Illinois/NCSA\r | |
17 | Open Source License\r | |
3402aac7 | 18 | \r |
1e57a462 | 19 | Copyright (c) 2003-2008 University of Illinois at Urbana-Champaign.\r |
20 | All rights reserved.\r | |
3402aac7 | 21 | \r |
1e57a462 | 22 | Developed by:\r |
3402aac7 | 23 | \r |
1e57a462 | 24 | LLVM Team\r |
3402aac7 | 25 | \r |
1e57a462 | 26 | University of Illinois at Urbana-Champaign\r |
3402aac7 | 27 | \r |
1e57a462 | 28 | http://llvm.org\r |
3402aac7 | 29 | \r |
1e57a462 | 30 | Permission is hereby granted, free of charge, to any person obtaining a copy of\r |
31 | this software and associated documentation files (the "Software"), to deal with\r | |
32 | the Software without restriction, including without limitation the rights to\r | |
33 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\r | |
34 | of the Software, and to permit persons to whom the Software is furnished to do\r | |
35 | so, subject to the following conditions:\r | |
3402aac7 | 36 | \r |
1e57a462 | 37 | * Redistributions of source code must retain the above copyright notice,\r |
38 | this list of conditions and the following disclaimers.\r | |
3402aac7 | 39 | \r |
1e57a462 | 40 | * Redistributions in binary form must reproduce the above copyright notice,\r |
41 | this list of conditions and the following disclaimers in the\r | |
42 | documentation and/or other materials provided with the distribution.\r | |
3402aac7 | 43 | \r |
1e57a462 | 44 | * Neither the names of the LLVM Team, University of Illinois at\r |
45 | Urbana-Champaign, nor the names of its contributors may be used to\r | |
46 | endorse or promote products derived from this Software without specific\r | |
47 | prior written permission.\r | |
3402aac7 | 48 | \r |
1e57a462 | 49 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r |
50 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\r | |
51 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r | |
52 | CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r | |
53 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r | |
54 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE\r | |
55 | SOFTWARE.\r | |
56 | **/\r | |
57 | \r | |
58 | \r | |
59 | #include "Llvm_int_lib.h"\r | |
60 | \r | |
61 | UINT64 __udivmoddi4 (UINT64 a, UINT64 b, UINT64 *rem);\r | |
62 | \r | |
63 | // Returns: a / b\r | |
64 | \r | |
65 | UINT64\r | |
66 | __udivdi3(UINT64 a, UINT64 b)\r | |
67 | {\r | |
68 | return __udivmoddi4(a, b, 0);\r | |
69 | }\r | |
70 | \r | |
71 | \r |