Commit af9bd920 by Kwok Cheung Yeung Committed by Kwok Cheung Yeung

[amdgcn] Remove dependency on stdint.h in libgcc

2020-01-10  Kwok Cheung Yeung  <kcy@codesourcery.com>

	libgcc/
	* config/gcn/atomic.c: Remove include of stdint.h.
	(__sync_val_compare_and_swap_##SIZE): Replace uintptr_t with
	__UINTPTR_TYPE__.

From-SVN: r280152
parent 6fc0385c
2020-01-10 Kwok Cheung Yeung <kcy@codesourcery.com>
* config/gcn/atomic.c: Remove include of stdint.h.
(__sync_val_compare_and_swap_##SIZE): Replace uintptr_t with
__UINTPTR_TYPE__.
2020-01-09 Kwok Cheung Yeung <kcy@codesourcery.com> 2020-01-09 Kwok Cheung Yeung <kcy@codesourcery.com>
* config/gcn/atomic.c: New. * config/gcn/atomic.c: New.
......
...@@ -22,15 +22,14 @@ ...@@ -22,15 +22,14 @@
<http://www.gnu.org/licenses/>. */ <http://www.gnu.org/licenses/>. */
#include <stdbool.h> #include <stdbool.h>
#include <stdint.h>
#define __SYNC_SUBWORD_COMPARE_AND_SWAP(TYPE, SIZE) \ #define __SYNC_SUBWORD_COMPARE_AND_SWAP(TYPE, SIZE) \
\ \
TYPE \ TYPE \
__sync_val_compare_and_swap_##SIZE (TYPE *ptr, TYPE oldval, TYPE newval) \ __sync_val_compare_and_swap_##SIZE (TYPE *ptr, TYPE oldval, TYPE newval) \
{ \ { \
unsigned int *wordptr = (unsigned int *)((uintptr_t) ptr & ~3UL); \ unsigned int *wordptr = (unsigned int *)((__UINTPTR_TYPE__ ) ptr & ~3UL); \
int shift = ((uintptr_t) ptr & 3UL) * 8; \ int shift = ((__UINTPTR_TYPE__ ) ptr & 3UL) * 8; \
unsigned int valmask = (1 << (SIZE * 8)) - 1; \ unsigned int valmask = (1 << (SIZE * 8)) - 1; \
unsigned int wordmask = ~(valmask << shift); \ unsigned int wordmask = ~(valmask << shift); \
unsigned int oldword = *wordptr; \ unsigned int oldword = *wordptr; \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment