[PATCH] D63617: [COFF, ARM64] Fix encoding of __debugbreak

2019-06-21 Thread Tom Tan via Phabricator via cfe-commits
TomTan abandoned this revision. TomTan added a comment. The fix in LLVM was merged as https://reviews.llvm.org/rL364115. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D63617/new/ https://reviews.llvm.org/D63617 ___

[PATCH] D63617: [COFF, ARM64] Fix encoding of __debugbreak

2019-06-20 Thread Tom Tan via Phabricator via cfe-commits
TomTan added a comment. In D63617#1552615 , @rnk wrote: > Even if `BRK #0xF000` is a Windows convention, it's still possible for ISel > to select different instructions for different OSs, and I'd prefer to > implement it that way. Ok, did the

[PATCH] D63617: [COFF, ARM64] Fix encoding of __debugbreak

2019-06-20 Thread Tom Tan via Phabricator via cfe-commits
TomTan added a comment. In D63617#1552561 , @rnk wrote: > I think it would be preferable to make `llvm.debugtrap` emit `brk #0xF000` on > aarch64-windows-*, so other frontends (Rust etc) get the right behavior by > default. Right now, AArch64 doesn't do

[PATCH] D63617: [COFF, ARM64] Fix encoding of __debugbreak

2019-06-20 Thread Tom Tan via Phabricator via cfe-commits
TomTan created this revision. TomTan added reviewers: efriedma, rnk. Herald added subscribers: cfe-commits, kristof.beyls, javed.absar. Herald added a project: clang. On Windows ARM64, intrinsic `__debugbreak` should be compiled into `brk #0xF000` which is different from llvm intrinsic

[PATCH] D61225: [COFF, ARM64] Align global symbol by size for ARM64 MSVC ABI

2019-05-01 Thread Tom Tan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL359744: [COFF, ARM64] Align global symbol by size for ARM64 MSVC ABI (authored by TomTan, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to commit:

[PATCH] D61225: [COFF, ARM64] Align global symbol by size for ARM64 MSVC ABI

2019-04-29 Thread Tom Tan via Phabricator via cfe-commits
TomTan updated this revision to Diff 197208. TomTan added a comment. Herald added a subscriber: jholewinski. Added test cases and also merged this alignment adjustment to `getMinGlobalAlign` in `MicrosoftARM64TargetInfo`. Repository: rC Clang CHANGES SINCE LAST ACTION

[PATCH] D61225: [COFF, ARM64] Align global symbol by size for ARM64 MSVC ABI

2019-04-27 Thread Tom Tan via Phabricator via cfe-commits
TomTan created this revision. TomTan added a reviewer: efriedma. Herald added subscribers: cfe-commits, kristof.beyls, javed.absar. Herald added a project: clang. According to alignment section in below ARM64 ABI document, MSVC could increase alignment of global data based on its total size.

[PATCH] D60349: [COFF, ARM64] Fix ABI implementation of struct returns

2019-04-25 Thread Tom Tan via Phabricator via cfe-commits
TomTan added a comment. In D60349#1479604 , @efriedma wrote: > > Return info for HFA and HVA is updated > > That's helpful, but not really sufficient; according to the AAPCS rules, both > "Pod" and "NotPod" from my testcase are HFAs. Could you provide

[PATCH] D60349: [COFF, ARM64] Fix ABI implementation of struct returns

2019-04-25 Thread Tom Tan via Phabricator via cfe-commits
TomTan added a comment. In D60349#140 , @TomTan wrote: > In D60349#1477183 , @efriedma wrote: > > > > For NotPod, it is aggregate which is specific in the document > > > > Yes, it's an aggregate which is

[PATCH] D60349: [COFF, ARM64] Fix ABI implementation of struct returns

2019-04-24 Thread Tom Tan via Phabricator via cfe-commits
TomTan added a comment. In D60349#1477183 , @efriedma wrote: > > For NotPod, it is aggregate which is specific in the document > > Yes, it's an aggregate which is returned in registers... but it's returned in > integer registers, unlike Pod which is

[PATCH] D60349: [COFF, ARM64] Fix ABI implementation of struct returns

2019-04-23 Thread Tom Tan via Phabricator via cfe-commits
TomTan added a comment. In D60349#1476371 , @efriedma wrote: > It looks like there's some missing documentation in the ARM64 ABI document > involving homogeneous aggregates... in particular, it looks like non-POD > types are never homogeneous, or

[PATCH] D57915: [COFF, ARM64] Remove definitions for _byteswap library functions

2019-02-11 Thread Tom Tan via Phabricator via cfe-commits
TomTan added a comment. In D57915#1393510 , @thakis wrote: > In D57915#1389722 , @TomTan wrote: > > > In D57915#1389560 , @lebedev.ri > > wrote: > > > > > In D57915#1389549

[PATCH] D57915: [COFF, ARM64] Remove definitions for _byteswap library functions

2019-02-11 Thread Tom Tan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL353740: [COFF, ARM64] Remove definitions for _byteswap library functions (authored by TomTan, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to

[PATCH] D57915: [COFF, ARM64] Remove definitions for _byteswap library functions

2019-02-07 Thread Tom Tan via Phabricator via cfe-commits
TomTan added a comment. In D57915#1389788 , @efriedma wrote: > I did some quick testing with MSVC; apparently it inlines the implementations > of these functions when optimizations are on. We definitely want to support > inlining these. Since these are

[PATCH] D57915: [COFF, ARM64] Remove definitions for _byteswap library functions

2019-02-07 Thread Tom Tan via Phabricator via cfe-commits
TomTan added a comment. In D57915#1389750 , @lebedev.ri wrote: > In D57915#1389722 , @TomTan wrote: > > > In D57915#1389560 , @lebedev.ri > > wrote: > > > > > In

[PATCH] D57915: [COFF, ARM64] Remove definitions for _byteswap library functions

2019-02-07 Thread Tom Tan via Phabricator via cfe-commits
TomTan added a comment. In D57915#1389560 , @lebedev.ri wrote: > In D57915#1389549 , @TomTan wrote: > > > Added the tests back. Clang IR should not lower these to bswap calls > > because they are global library

[PATCH] D57915: [COFF, ARM64] Remove definitions for _byteswap library functions

2019-02-07 Thread Tom Tan via Phabricator via cfe-commits
TomTan updated this revision to Diff 185849. TomTan added a comment. Added the tests back. Clang IR should not lower these to bswap calls because they are global library functions. It might be slower to make the call to library function than bswap, but this is the same for other architectures

[PATCH] D57915: [COFF, ARM64] Remove definitions for _byteswap library functions

2019-02-07 Thread Tom Tan via Phabricator via cfe-commits
TomTan created this revision. TomTan added reviewers: mgrang, efriedma, mstorsjo. Herald added subscribers: cfe-commits, kristof.beyls, javed.absar. Herald added a project: clang. _byteswap_* functions are are implemented in below file as normal function from libucrt.lib and declared in stdlib.h.

[PATCH] D57631: [COFF, ARM64] Add ARM64 support for MS intrinsic _fastfail

2019-02-06 Thread Tom Tan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL353337: [COFF, ARM64] Add ARM64 support for MS intrinsic _fastfail (authored by TomTan, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to commit:

[PATCH] D57636: [COFF, ARM64] Fix types for _ReadStatusReg, _WriteStatusReg

2019-02-04 Thread Tom Tan via Phabricator via cfe-commits
TomTan added a comment. Thanks for finding out and fixing this. Seems there is also issue in expanding `_WriteStatusReg` in `CodeGenFunction::EmitAArch64BuiltinExpr`. The last argument for `_WriteStatusReg` is __zero extended__ to `__in64`, which is not expected (see below link).

[PATCH] D57631: [COFF, ARM64] Add ARM64 support for MS intrinsic _fastfail

2019-02-04 Thread Tom Tan via Phabricator via cfe-commits
TomTan added a comment. In D57631#1381806 , @efriedma wrote: > LGTM Thanks Eli. Could you please help commit this change when it is ready? Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D57631/new/

[PATCH] D57631: [COFF, ARM64] Add ARM64 support for MS intrinsic _fastfail

2019-02-01 Thread Tom Tan via Phabricator via cfe-commits
TomTan created this revision. TomTan added reviewers: rnk, mstorsjo, efriedma. Herald added subscribers: cfe-commits, kristof.beyls. Herald added a project: clang. The MSDN document was also updated to reflect this, but it probably will take a few days to show in below link.

[PATCH] D56620: [COFF, ARM64] Declare intrinsics: __nop, _byteswap_[ushort/ulong/uint64]

2019-01-11 Thread Tom Tan via Phabricator via cfe-commits
TomTan added a comment. We need full definition for __nop in intrin.h. Comment at: lib/Headers/intrin.h:569 +unsigned __int64 _byteswap_uint64 (unsigned __int64 val); +void __nop(); #endif efriedma wrote: > Isn't there already a declaration of __nop in