Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Correct typos in paraminstanceapi.h #32

Merged
merged 1 commit into from
Feb 3, 2015
Merged

Correct typos in paraminstanceapi.h #32

merged 1 commit into from
Feb 3, 2015

Conversation

jasssonpet
Copy link

No description provided.

@gkhanna79
Copy link
Member

LGTM

1 similar comment
@jkotas
Copy link
Member

jkotas commented Feb 3, 2015

LGTM

jkotas added a commit that referenced this pull request Feb 3, 2015
Correct typos in paraminstanceapi.h
@jkotas jkotas merged commit 56e4370 into dotnet:master Feb 3, 2015
kyulee1 added a commit to kyulee1/coreclr that referenced this pull request Mar 1, 2016
For 4 byte integer multiplication, JIT emits a bad-code which is valid
only for 8 byte (i8) multiplication.
For the fix, I use ```smull```(signed)/```umull```(unsigned) instructions
that contain 8 byte results from 4 byte by 4 byte multiplication.
So only one multiplication is needed instead of two for this case.
By simply shifting the results, we could get the upper results that is
used for sign check to detect overflow.
Similar transform is made for the unsigned case. But for this case, we
might trash the destination register by the extra register,
I added register check to optionally emit additional multiplication. I
guess we might revisit this to allocate two register like the signed one
to ensure only one multiplication for 4 bye case, but I think we should
follow this up later if needed.

Before
smulh   w10, w8, w9  --> Incorrect use: smulh is for obtaining the upper
bits [127:64] of x8 * x9
mul     w8, w8, w9
cmp     x10, x8, ASR dotnet#63

After
smull   x8, x8, x9   --> x8 = w8 * w9
lsr     x10, x8, dotnet#32 --> shift the upper bit of x8 to get sign bit
cmp     w10, w8, ASR #31 --> check sign bit
kyulee1 added a commit to kyulee1/coreclr that referenced this pull request Mar 2, 2016
For 4 byte integer multiplication, JIT emits a bad-code which is valid
only for 8 byte (i8) multiplication.
For the fix, I use ```smull```(signed)/```umull```(unsigned) instructions
that contain 8 byte results from 4 byte by 4 byte multiplication.
So only one multiplication is needed instead of two for this case.
By simply shifting the results, we could get the upper results that is
used to detect overflow.
Similar transform is made for the unsigned case.
Lower is also changed to reserve a register for overflow check.

Before
smulh   w10, w8, w9  --> Incorrect use: smulh is for obtaining the upper
bits [127:64] of x8 * x9
mul     w8, w8, w9
cmp     x10, x8, ASR dotnet#63

After
smull   x8, x8, x9   --> x8 = w8 * w9
lsr     x10, x8, dotnet#32 --> shift the upper bit of x8 to get sign bit
cmp     w10, w8, ASR #31 --> check sign bit
kyulee1 added a commit to kyulee1/coreclr that referenced this pull request Mar 2, 2016
For 4 byte integer multiplication, JIT emits a bad-code which is valid
only for 8 byte (i8) multiplication.
For the fix, I use ```smull```(signed)/```umull```(unsigned) instructions
that contain 8 byte results from 4 byte by 4 byte multiplication.
So only one multiplication is needed instead of two for this case.
By simply shifting the results, we could get the upper results that is
used to detect overflow.
Similar transform is made for the unsigned case.
Lower is also changed to reserve a register for overflow check.

Before
smulh   w10, w8, w9  --> Incorrect use: smulh is for obtaining the upper
bits [127:64] of x8 * x9
mul     w8, w8, w9
cmp     x10, x8, ASR dotnet#63

After
smull   x8, x8, x9   --> x8 = w8 * w9
lsr     x10, x8, dotnet#32 --> shift the upper bit of x8 to get sign bit
cmp     w10, w8, ASR #31 --> check sign bit
franksinankaya added a commit to franksinankaya/coreclr that referenced this pull request Feb 4, 2019
src/pal/src/libunwind/include/libunwind-aarch64.h:201:5: warning: right-hand operand of comma expression has no effect [-Wunused-value]
 #define unw_tdep_getcontext(uc) (({     \
                                 ~~~~~~~~~
   unw_tdep_context_t *unw_ctx = (uc);     \
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   register uint64_t *unw_base asm ("x0") = (uint64_t*) unw_ctx->uc_mcontext.regs;  \
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   __asm__ __volatile__ (      \
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x0, x1, [%[base], #0]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x2, x3, [%[base], dotnet#16]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x4, x5, [%[base], dotnet#32]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x6, x7, [%[base], dotnet#48]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x8, x9, [%[base], dotnet#64]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x10, x11, [%[base], dotnet#80]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x12, x13, [%[base], dotnet#96]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x14, x13, [%[base], dotnet#112]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x16, x17, [%[base], #128]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x18, x19, [%[base], dotnet#144]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x20, x21, [%[base], dotnet#160]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x22, x23, [%[base], #176]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x24, x25, [%[base], #192]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x26, x27, [%[base], #208]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x28, x29, [%[base], dotnet#224]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "str x30, [%[base], #240]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "mov x1, sp\n" \
      ~~~~~~~~~~~~~~~~
      "stp x1, x30, [%[base], dotnet#248]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      : [base] "+r" (unw_base) : : "x1", "memory"); \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   }), 0)
franksinankaya added a commit to franksinankaya/coreclr that referenced this pull request Feb 5, 2019
src/pal/src/libunwind/include/libunwind-aarch64.h:201:5: warning: right-hand operand of comma expression has no effect [-Wunused-value]
 #define unw_tdep_getcontext(uc) (({     \
                                 ~~~~~~~~~
   unw_tdep_context_t *unw_ctx = (uc);     \
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   register uint64_t *unw_base asm ("x0") = (uint64_t*) unw_ctx->uc_mcontext.regs;  \
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   __asm__ __volatile__ (      \
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x0, x1, [%[base], #0]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x2, x3, [%[base], dotnet#16]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x4, x5, [%[base], dotnet#32]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x6, x7, [%[base], dotnet#48]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x8, x9, [%[base], dotnet#64]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x10, x11, [%[base], dotnet#80]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x12, x13, [%[base], dotnet#96]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x14, x13, [%[base], dotnet#112]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x16, x17, [%[base], #128]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x18, x19, [%[base], dotnet#144]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x20, x21, [%[base], dotnet#160]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x22, x23, [%[base], #176]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x24, x25, [%[base], #192]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x26, x27, [%[base], #208]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x28, x29, [%[base], dotnet#224]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "str x30, [%[base], #240]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "mov x1, sp\n" \
      ~~~~~~~~~~~~~~~~
      "stp x1, x30, [%[base], dotnet#248]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      : [base] "+r" (unw_base) : : "x1", "memory"); \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   }), 0)
franksinankaya added a commit to franksinankaya/coreclr that referenced this pull request Feb 5, 2019
src/pal/src/libunwind/include/libunwind-aarch64.h:201:5: warning: right-hand operand of comma expression has no effect [-Wunused-value]
 #define unw_tdep_getcontext(uc) (({     \
                                 ~~~~~~~~~
   unw_tdep_context_t *unw_ctx = (uc);     \
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   register uint64_t *unw_base asm ("x0") = (uint64_t*) unw_ctx->uc_mcontext.regs;  \
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   __asm__ __volatile__ (      \
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x0, x1, [%[base], #0]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x2, x3, [%[base], dotnet#16]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x4, x5, [%[base], dotnet#32]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x6, x7, [%[base], dotnet#48]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x8, x9, [%[base], dotnet#64]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x10, x11, [%[base], dotnet#80]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x12, x13, [%[base], dotnet#96]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x14, x13, [%[base], dotnet#112]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x16, x17, [%[base], #128]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x18, x19, [%[base], dotnet#144]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x20, x21, [%[base], dotnet#160]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x22, x23, [%[base], #176]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x24, x25, [%[base], #192]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x26, x27, [%[base], #208]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x28, x29, [%[base], dotnet#224]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "str x30, [%[base], #240]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "mov x1, sp\n" \
      ~~~~~~~~~~~~~~~~
      "stp x1, x30, [%[base], dotnet#248]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      : [base] "+r" (unw_base) : : "x1", "memory"); \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   }), 0)
franksinankaya added a commit to franksinankaya/coreclr that referenced this pull request Feb 6, 2019
src/pal/src/libunwind/include/libunwind-aarch64.h:201:5: warning: right-hand operand of comma expression has no effect [-Wunused-value]
 #define unw_tdep_getcontext(uc) (({     \
                                 ~~~~~~~~~
   unw_tdep_context_t *unw_ctx = (uc);     \
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   register uint64_t *unw_base asm ("x0") = (uint64_t*) unw_ctx->uc_mcontext.regs;  \
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   __asm__ __volatile__ (      \
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x0, x1, [%[base], #0]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x2, x3, [%[base], dotnet#16]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x4, x5, [%[base], dotnet#32]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x6, x7, [%[base], dotnet#48]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x8, x9, [%[base], dotnet#64]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x10, x11, [%[base], dotnet#80]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x12, x13, [%[base], dotnet#96]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x14, x13, [%[base], dotnet#112]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x16, x17, [%[base], #128]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x18, x19, [%[base], dotnet#144]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x20, x21, [%[base], dotnet#160]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x22, x23, [%[base], #176]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x24, x25, [%[base], #192]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x26, x27, [%[base], #208]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x28, x29, [%[base], dotnet#224]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "str x30, [%[base], #240]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "mov x1, sp\n" \
      ~~~~~~~~~~~~~~~~
      "stp x1, x30, [%[base], dotnet#248]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      : [base] "+r" (unw_base) : : "x1", "memory"); \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   }), 0)
franksinankaya added a commit to franksinankaya/coreclr that referenced this pull request Feb 6, 2019
src/pal/src/libunwind/include/libunwind-aarch64.h:201:5: warning: right-hand operand of comma expression has no effect [-Wunused-value]
 #define unw_tdep_getcontext(uc) (({     \
                                 ~~~~~~~~~
   unw_tdep_context_t *unw_ctx = (uc);     \
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   register uint64_t *unw_base asm ("x0") = (uint64_t*) unw_ctx->uc_mcontext.regs;  \
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   __asm__ __volatile__ (      \
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x0, x1, [%[base], #0]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x2, x3, [%[base], dotnet#16]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x4, x5, [%[base], dotnet#32]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x6, x7, [%[base], dotnet#48]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x8, x9, [%[base], dotnet#64]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x10, x11, [%[base], dotnet#80]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x12, x13, [%[base], dotnet#96]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x14, x13, [%[base], dotnet#112]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x16, x17, [%[base], #128]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x18, x19, [%[base], dotnet#144]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x20, x21, [%[base], dotnet#160]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x22, x23, [%[base], #176]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x24, x25, [%[base], #192]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x26, x27, [%[base], #208]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x28, x29, [%[base], dotnet#224]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "str x30, [%[base], #240]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "mov x1, sp\n" \
      ~~~~~~~~~~~~~~~~
      "stp x1, x30, [%[base], dotnet#248]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      : [base] "+r" (unw_base) : : "x1", "memory"); \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   }), 0)
franksinankaya added a commit to franksinankaya/coreclr that referenced this pull request Feb 6, 2019
src/pal/src/libunwind/include/libunwind-aarch64.h:201:5: warning: right-hand operand of comma expression has no effect [-Wunused-value]
 #define unw_tdep_getcontext(uc) (({     \
                                 ~~~~~~~~~
   unw_tdep_context_t *unw_ctx = (uc);     \
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   register uint64_t *unw_base asm ("x0") = (uint64_t*) unw_ctx->uc_mcontext.regs;  \
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   __asm__ __volatile__ (      \
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x0, x1, [%[base], #0]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x2, x3, [%[base], dotnet#16]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x4, x5, [%[base], dotnet#32]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x6, x7, [%[base], dotnet#48]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x8, x9, [%[base], dotnet#64]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x10, x11, [%[base], dotnet#80]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x12, x13, [%[base], dotnet#96]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x14, x13, [%[base], dotnet#112]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x16, x17, [%[base], #128]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x18, x19, [%[base], dotnet#144]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x20, x21, [%[base], dotnet#160]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x22, x23, [%[base], #176]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x24, x25, [%[base], #192]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x26, x27, [%[base], #208]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x28, x29, [%[base], dotnet#224]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "str x30, [%[base], #240]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "mov x1, sp\n" \
      ~~~~~~~~~~~~~~~~
      "stp x1, x30, [%[base], dotnet#248]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      : [base] "+r" (unw_base) : : "x1", "memory"); \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   }), 0)
franksinankaya added a commit to franksinankaya/coreclr that referenced this pull request Feb 7, 2019
src/pal/src/libunwind/include/libunwind-aarch64.h:201:5: warning: right-hand operand of comma expression has no effect [-Wunused-value]
 #define unw_tdep_getcontext(uc) (({     \
                                 ~~~~~~~~~
   unw_tdep_context_t *unw_ctx = (uc);     \
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   register uint64_t *unw_base asm ("x0") = (uint64_t*) unw_ctx->uc_mcontext.regs;  \
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   __asm__ __volatile__ (      \
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x0, x1, [%[base], #0]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x2, x3, [%[base], dotnet#16]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x4, x5, [%[base], dotnet#32]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x6, x7, [%[base], dotnet#48]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x8, x9, [%[base], dotnet#64]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x10, x11, [%[base], dotnet#80]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x12, x13, [%[base], dotnet#96]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x14, x13, [%[base], dotnet#112]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x16, x17, [%[base], #128]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x18, x19, [%[base], dotnet#144]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x20, x21, [%[base], dotnet#160]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x22, x23, [%[base], #176]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x24, x25, [%[base], #192]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x26, x27, [%[base], #208]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x28, x29, [%[base], dotnet#224]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "str x30, [%[base], #240]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "mov x1, sp\n" \
      ~~~~~~~~~~~~~~~~
      "stp x1, x30, [%[base], dotnet#248]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      : [base] "+r" (unw_base) : : "x1", "memory"); \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   }), 0)
janvorli pushed a commit that referenced this pull request Feb 7, 2019
…22369)

* Declare throw only when compiling for c++

Prevent the definition from getting defined multiple times and
map it to throw() only when compiling c++ code.

* Suppress warnings for tests

Suppress:
 -Wno-write-strings
 -Wno-sign-compare
 -Wno-narrowing
 -fpermissive
 -Wno-int-to-pointer-cast

to allow tests to compile

* Add gcc option to build.sh script

Following clangx.y model add -gccx.y command line
arguments with gcc5 and gcc7 being the currnetly supported
options.

* Allow environment variable to be used for TOOLCHAIN

Remove CLANG specific compiler options as well.

* Hide non-GNU compiler options

* Do not include local directory if cross compiling

[  0%] Building CXX object src/pal/src/eventprovider/tracepointprovider/CMakeFiles/coreclrtraceptprovider.dir/__/lttng/traceptprovdotnetruntime.cpp.o
cc1plus: error: include location "/usr/local/include" is unsafe for cross-compilation [-Werror=poison-system-directories]

* Suppress unknown pragma warnings

src/pal/src/exception/seh-unwind.cpp:37:0:
warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas]
    #pragma clang diagnostic pop

Removing these cause compilation error on clang7 and arm as follows:

In file included from /bin/obj/Linux.arm.Debug/src/pal/src/libunwind/include/libunwind.h:9:
/src/pal/src/libunwind/include/libunwind-arm.h:247:9: error: empty struct has size 0 in C, size 1 in C++ [-Werror,-Wextern-c-compat]
typedef struct unw_tdep_save_loc
        ^
/src/pal/src/libunwind/include/libunwind-arm.h:288:9: error: empty struct has size 0 in C, size 1 in C++ [-Werror,-Wextern-c-compat]
typedef struct

* plt not useful for GNU and ARM64/ARM

src/pal/src/arch/arm64/callsignalhandlerwrapper.S: Assembler messages:
src/pal/src/arch/arm64/callsignalhandlerwrapper.S:31: Error: unexpected characters following instruction at operand 1 -- `bl signal_handler_worker@plt'
src/pal/src/arch/arm64/callsignalhandlerwrapper.S:32: Error: unexpected characters following instruction at operand 1 -- `bl signal_handler_worker@plt'

* Remove double const from argv in PAL_Initialize

Seeing compilation error with GNU for C source files as follows:

if (PAL_Initialize(argc, argv) != 0)
                          ^
src/pal/tests/palsuite/common/palsuite.h:21:0,
from src/pal/tests/palsuite/c_runtime/asinhf/test1/test1.c:18:
src/pal/inc/pal.h:374:1: note: expected ‘const char * const*’ but argument is of type ‘char **’

* Suppress format warnings using GNU for libunwind

warning: format ‘%li’ expects argument of type ‘long int’, but argument 3 has type ‘int’ [-Wformat=]
     Debug (4, " aligned frame, offset %li\n", f->cfa_reg_offset);

* Fix -fpermissive warnings for GNU

* Suppress unused variable warning in libunwind

src/pal/src/libunwind/include/libunwind-aarch64.h:201:5: warning: right-hand operand of comma expression has no effect [-Wunused-value]
 #define unw_tdep_getcontext(uc) (({     \
                                 ~~~~~~~~~
   unw_tdep_context_t *unw_ctx = (uc);     \
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   register uint64_t *unw_base asm ("x0") = (uint64_t*) unw_ctx->uc_mcontext.regs;  \
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   __asm__ __volatile__ (      \
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x0, x1, [%[base], #0]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x2, x3, [%[base], #16]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x4, x5, [%[base], #32]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x6, x7, [%[base], #48]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x8, x9, [%[base], #64]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x10, x11, [%[base], #80]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x12, x13, [%[base], #96]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x14, x13, [%[base], #112]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x16, x17, [%[base], #128]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x18, x19, [%[base], #144]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x20, x21, [%[base], #160]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x22, x23, [%[base], #176]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x24, x25, [%[base], #192]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x26, x27, [%[base], #208]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x28, x29, [%[base], #224]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "str x30, [%[base], #240]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "mov x1, sp\n" \
      ~~~~~~~~~~~~~~~~
      "stp x1, x30, [%[base], #248]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      : [base] "+r" (unw_base) : : "x1", "memory"); \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   }), 0)

* Fix warning: ‘memset’ used with length equal to number of elements warning

Fix similar warnings to these by including the element size into total size
calculation.

src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test1/test.cpp: In function ‘int main(int, char**)’:
src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test1/test.cpp:89:31: warning: ‘memset’ used with length equal to number of elements without multiplication by element size [-Wmemset-elt-size]
     memset(NewValue,0,BUF_SIZE);

* Define CLR specific compiler option CLR_CMAKE_COMPILER

By the time toolchain.cmake is called, the compiler detection from
cmake is not active. We need an intermediate definition to pass
to compiler detection.
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
…otnet/coreclr#22369)

* Declare throw only when compiling for c++

Prevent the definition from getting defined multiple times and
map it to throw() only when compiling c++ code.

* Suppress warnings for tests

Suppress:
 -Wno-write-strings
 -Wno-sign-compare
 -Wno-narrowing
 -fpermissive
 -Wno-int-to-pointer-cast

to allow tests to compile

* Add gcc option to build.sh script

Following clangx.y model add -gccx.y command line
arguments with gcc5 and gcc7 being the currnetly supported
options.

* Allow environment variable to be used for TOOLCHAIN

Remove CLANG specific compiler options as well.

* Hide non-GNU compiler options

* Do not include local directory if cross compiling

[  0%] Building CXX object src/pal/src/eventprovider/tracepointprovider/CMakeFiles/coreclrtraceptprovider.dir/__/lttng/traceptprovdotnetruntime.cpp.o
cc1plus: error: include location "/usr/local/include" is unsafe for cross-compilation [-Werror=poison-system-directories]

* Suppress unknown pragma warnings

src/pal/src/exception/seh-unwind.cpp:37:0:
warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas]
    #pragma clang diagnostic pop

Removing these cause compilation error on clang7 and arm as follows:

In file included from /bin/obj/Linux.arm.Debug/src/pal/src/libunwind/include/libunwind.h:9:
/src/pal/src/libunwind/include/libunwind-arm.h:247:9: error: empty struct has size 0 in C, size 1 in C++ [-Werror,-Wextern-c-compat]
typedef struct unw_tdep_save_loc
        ^
/src/pal/src/libunwind/include/libunwind-arm.h:288:9: error: empty struct has size 0 in C, size 1 in C++ [-Werror,-Wextern-c-compat]
typedef struct

* plt not useful for GNU and ARM64/ARM

src/pal/src/arch/arm64/callsignalhandlerwrapper.S: Assembler messages:
src/pal/src/arch/arm64/callsignalhandlerwrapper.S:31: Error: unexpected characters following instruction at operand 1 -- `bl signal_handler_worker@plt'
src/pal/src/arch/arm64/callsignalhandlerwrapper.S:32: Error: unexpected characters following instruction at operand 1 -- `bl signal_handler_worker@plt'

* Remove double const from argv in PAL_Initialize

Seeing compilation error with GNU for C source files as follows:

if (PAL_Initialize(argc, argv) != 0)
                          ^
src/pal/tests/palsuite/common/palsuite.h:21:0,
from src/pal/tests/palsuite/c_runtime/asinhf/test1/test1.c:18:
src/pal/inc/pal.h:374:1: note: expected ‘const char * const*’ but argument is of type ‘char **’

* Suppress format warnings using GNU for libunwind

warning: format ‘%li’ expects argument of type ‘long int’, but argument 3 has type ‘int’ [-Wformat=]
     Debug (4, " aligned frame, offset %li\n", f->cfa_reg_offset);

* Fix -fpermissive warnings for GNU

* Suppress unused variable warning in libunwind

src/pal/src/libunwind/include/libunwind-aarch64.h:201:5: warning: right-hand operand of comma expression has no effect [-Wunused-value]
 #define unw_tdep_getcontext(uc) (({     \
                                 ~~~~~~~~~
   unw_tdep_context_t *unw_ctx = (uc);     \
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   register uint64_t *unw_base asm ("x0") = (uint64_t*) unw_ctx->uc_mcontext.regs;  \
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   __asm__ __volatile__ (      \
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x0, x1, [%[base], dotnet/coreclr#0]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x2, x3, [%[base], dotnet/coreclr#16]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x4, x5, [%[base], dotnet/coreclr#32]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x6, x7, [%[base], dotnet/coreclr#48]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x8, x9, [%[base], dotnet/coreclr#64]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x10, x11, [%[base], dotnet/coreclr#80]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x12, x13, [%[base], dotnet/coreclr#96]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x14, x13, [%[base], dotnet/coreclr#112]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x16, x17, [%[base], dotnet/coreclr#128]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x18, x19, [%[base], dotnet/coreclr#144]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x20, x21, [%[base], dotnet/coreclr#160]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x22, x23, [%[base], dotnet/coreclr#176]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x24, x25, [%[base], dotnet/coreclr#192]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x26, x27, [%[base], dotnet/coreclr#208]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "stp x28, x29, [%[base], dotnet/coreclr#224]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "str x30, [%[base], dotnet/coreclr#240]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "mov x1, sp\n" \
      ~~~~~~~~~~~~~~~~
      "stp x1, x30, [%[base], dotnet/coreclr#248]\n" \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      : [base] "+r" (unw_base) : : "x1", "memory"); \
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   }), 0)

* Fix warning: ‘memset’ used with length equal to number of elements warning

Fix similar warnings to these by including the element size into total size
calculation.

src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test1/test.cpp: In function ‘int main(int, char**)’:
src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test1/test.cpp:89:31: warning: ‘memset’ used with length equal to number of elements without multiplication by element size [-Wmemset-elt-size]
     memset(NewValue,0,BUF_SIZE);

* Define CLR specific compiler option CLR_CMAKE_COMPILER

By the time toolchain.cmake is called, the compiler detection from
cmake is not active. We need an intermediate definition to pass
to compiler detection.


Commit migrated from dotnet/coreclr@34d50b0
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants