forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix : correctly compile a comple test program and issues mul/div emul…
…ation functions from compiler-rt runtime.
- Loading branch information
1 parent
1906bbc
commit d0226ac
Showing
8 changed files
with
125 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -108,6 +108,7 @@ set(GENERIC_SOURCES | |
muldc3.c | ||
muldf3.c | ||
muldi3.c | ||
mulsi3.c | ||
mulodi4.c | ||
mulosi4.c | ||
muloti4.c | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* Generic 32 bit multiply. | ||
Copyright (C) 2009-2024 Free Software Foundation, Inc. | ||
Contributed by Embecosm on behalf of Adapteva, Inc. | ||
This file is part of GCC. | ||
This file is free software; you can redistribute it and/or modify it | ||
under the terms of the GNU General Public License as published by the | ||
Free Software Foundation; either version 3, or (at your option) any | ||
later version. | ||
This file is distributed in the hope that it will be useful, but | ||
WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
General Public License for more details. | ||
Under Section 7 of GPL version 3, you are granted additional | ||
permissions described in the GCC Runtime Library Exception, version | ||
3.1, as published by the Free Software Foundation. | ||
You should have received a copy of the GNU General Public License and | ||
a copy of the GCC Runtime Library Exception along with this program; | ||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see | ||
<http://www.gnu.org/licenses/>. */ | ||
|
||
unsigned int | ||
__mulsi3 (unsigned int a, unsigned int b) | ||
{ | ||
unsigned int r = 0; | ||
|
||
while (a) | ||
{ | ||
if (a & 1) | ||
r += b; | ||
a >>= 1; | ||
b <<= 1; | ||
} | ||
return r; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.