Previously global 64-bit versions of _Interlocked functions broke buildbots on i386, so now I'm adding them as builtins for x86-64 and ARM only (should they be also on AArch64? I had problems with testing it for AArch64, so I left it)
Details
Diff Detail
- Build Status
Buildable 447 Build 447: arc lint + arc unit
Event Timeline
lib/CodeGen/CGBuiltin.cpp | ||
---|---|---|
2730 | Can you make a helper similar to MakeBinaryAtomicValue for inc/dec and share this code with the 16 and 32-bit atomic increment implementations? You can do something like Builder.CreateBinOp(Inc ? Instruction::Add : Instruction::Sub, ...) |
lib/CodeGen/CGBuiltin.cpp | ||
---|---|---|
2730 | I thought about putting all the _Interlocked intrinsics here. Or do we want all the others to remain target-independent? |
lib/CodeGen/CGBuiltin.cpp | ||
---|---|---|
2730 | Sure, having the target-independent builtins call EmitMSVCBuiltinExpr seems reasonable. |
(should they be also on AArch64? I had problems with testing it for AArch64, so I left it)
Technically, I think they should be on AArch64 as well. But clang/LLVM probably doesn't support AArch64/Windows yet (I guess?), so testing it probably is impossible. When/if support later gets added for that, it's easy to complete these.
AArch64/Windows in general isn't available yet; the Windows 10 SDK contains some arm64 tools, and the Windows 10 SDK and MSVC 2015 headers have got ifdefs using _M_ARM64, but other than that, there's no public version of Visual Studio even having a compiler for it. So until then, and when someone tries to get clang/LLVM to support it, it's probably ok to just ignore it.
Can you make a helper similar to MakeBinaryAtomicValue for inc/dec and share this code with the 16 and 32-bit atomic increment implementations? You can do something like Builder.CreateBinOp(Inc ? Instruction::Add : Instruction::Sub, ...)