GNU Binutils with patches for OS216
Revision | 038842797bbd161906362278f9e8eaf0bbfc0f07 (tree) |
---|---|
Zeit | 2018-06-19 00:27:20 |
Autor | Simon Marchi <simon.marchi@eric...> |
Commiter | Simon Marchi |
include: Sync with GCC
Bring changes from GCC in shared headers.
include/ChangeLog:
Sync with GCC
2018-05-24 Tom Rix <trix@juniper.net>
* dwarf2.def (DW_FORM_strx*, DW_FORM_addrx*): New.
2017-11-20 Kito Cheng <kito.cheng@gmail.com>
* longlong.h [__riscv] (umulsidi3): Define.
[__riscv] (umul_ppmm): Likewise.
[__riscv] (muluw3): Likewise.
@@ -220,6 +220,14 @@ DW_FORM (DW_FORM_implicit_const, 0x21) | ||
220 | 220 | DW_FORM (DW_FORM_loclistx, 0x22) |
221 | 221 | DW_FORM (DW_FORM_rnglistx, 0x23) |
222 | 222 | DW_FORM (DW_FORM_ref_sup8, 0x24) |
223 | +DW_FORM (DW_FORM_strx1, 0x25) | |
224 | +DW_FORM (DW_FORM_strx2, 0x26) | |
225 | +DW_FORM (DW_FORM_strx3, 0x27) | |
226 | +DW_FORM (DW_FORM_strx4, 0x28) | |
227 | +DW_FORM (DW_FORM_addrx1, 0x29) | |
228 | +DW_FORM (DW_FORM_addrx2, 0x2a) | |
229 | +DW_FORM (DW_FORM_addrx3, 0x2b) | |
230 | +DW_FORM (DW_FORM_addrx4, 0x2c) | |
223 | 231 | /* Extensions for Fission. See http://gcc.gnu.org/wiki/DebugFission. */ |
224 | 232 | DW_FORM (DW_FORM_GNU_addr_index, 0x1f01) |
225 | 233 | DW_FORM (DW_FORM_GNU_str_index, 0x1f02) |
@@ -1050,6 +1050,56 @@ extern UDItype __umulsidi3 (USItype, USItype); | ||
1050 | 1050 | } while (0) |
1051 | 1051 | #endif |
1052 | 1052 | |
1053 | +#if defined(__riscv) | |
1054 | +#ifdef __riscv_mul | |
1055 | +#define __umulsidi3(u,v) ((UDWtype)(UWtype)(u) * (UWtype)(v)) | |
1056 | +#define __muluw3(a, b) ((UWtype)(a) * (UWtype)(b)) | |
1057 | +#else | |
1058 | +#if __riscv_xlen == 32 | |
1059 | + #define MULUW3 "call __mulsi3" | |
1060 | +#elif __riscv_xlen == 64 | |
1061 | + #define MULUW3 "call __muldi3" | |
1062 | +#else | |
1063 | +#error unsupport xlen | |
1064 | +#endif /* __riscv_xlen */ | |
1065 | +/* We rely on the fact that MULUW3 doesn't clobber the t-registers. | |
1066 | + It can get better register allocation result. */ | |
1067 | +#define __muluw3(a, b) \ | |
1068 | + ({ \ | |
1069 | + register UWtype __op0 asm ("a0") = a; \ | |
1070 | + register UWtype __op1 asm ("a1") = b; \ | |
1071 | + asm volatile (MULUW3 \ | |
1072 | + : "+r" (__op0), "+r" (__op1) \ | |
1073 | + : \ | |
1074 | + : "ra", "a2", "a3"); \ | |
1075 | + __op0; \ | |
1076 | + }) | |
1077 | +#endif /* __riscv_mul */ | |
1078 | +#define umul_ppmm(w1, w0, u, v) \ | |
1079 | + do { \ | |
1080 | + UWtype __x0, __x1, __x2, __x3; \ | |
1081 | + UHWtype __ul, __vl, __uh, __vh; \ | |
1082 | + \ | |
1083 | + __ul = __ll_lowpart (u); \ | |
1084 | + __uh = __ll_highpart (u); \ | |
1085 | + __vl = __ll_lowpart (v); \ | |
1086 | + __vh = __ll_highpart (v); \ | |
1087 | + \ | |
1088 | + __x0 = __muluw3 (__ul, __vl); \ | |
1089 | + __x1 = __muluw3 (__ul, __vh); \ | |
1090 | + __x2 = __muluw3 (__uh, __vl); \ | |
1091 | + __x3 = __muluw3 (__uh, __vh); \ | |
1092 | + \ | |
1093 | + __x1 += __ll_highpart (__x0);/* this can't give carry */ \ | |
1094 | + __x1 += __x2; /* but this indeed can */ \ | |
1095 | + if (__x1 < __x2) /* did we get it? */ \ | |
1096 | + __x3 += __ll_B; /* yes, add it in the proper pos. */ \ | |
1097 | + \ | |
1098 | + (w1) = __x3 + __ll_highpart (__x1); \ | |
1099 | + (w0) = __ll_lowpart (__x1) * __ll_B + __ll_lowpart (__x0); \ | |
1100 | + } while (0) | |
1101 | +#endif /* __riscv */ | |
1102 | + | |
1053 | 1103 | #if defined(__sh__) && W_TYPE_SIZE == 32 |
1054 | 1104 | #ifndef __sh1__ |
1055 | 1105 | #define umul_ppmm(w1, w0, u, v) \ |