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