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