本文介绍了相当于GCC的__builtin_darn()的lang声的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试发现等效于 Power9上GCC的__builtin_darn() .抓取Clang 7.0源,看起来LLVM支持它:

I'm trying to discover Clang's equivalent to GCC's __builtin_darn() on Power9. Grepping Clang 7.0 sources it looks like LLVM supports it:

llvm_source$ cat llvm/test/MC/PowerPC/ppc64-encoding.s | grep darn -B 1 -A 1

# CHECK-BE: darn 2, 3                       # encoding: [0x7c,0x43,0x05,0xe6]
# CHECK-LE: darn 2, 3                       # encoding: [0xe6,0x05,0x43,0x7c]
            darn 2, 3

但是,我看不到找到内置函数:

However, I can't seen to find the builtin:

llvm_source$ grep -IR darn | grep builtin
llvm_source$

与CCC __builtin_darn()等效的Clang是什么?

What is Clang equivalent of GCC's __builtin_darn()?

推荐答案

您可以在扩展ASM中编写(可能已经完成):

You could write in in extended ASM (which you've already done probably):

void t2()
{
    static unsigned int x;
    asm __volatile__("darn %0,1": "=r" (x));
}

您的错误参考: https://bugs.llvm.org/show_bug.cgi ?id = 39800

这篇关于相当于GCC的__builtin_darn()的lang声的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-29 08:59