[LLVMdev] LLC Bug x86 with thread local storage

Eric Christopher echristo at apple.com
Wed Jul 7 11:20:14 PDT 2010


On Jul 7, 2010, at 4:52 AM, Patrick Marlier wrote:

> Which one is correct ?
> - movl    $tm_nest_level at TPOFF, %ecx
> or
> - movq    $tm_nest_level at TPOFF, %rcx
> or
> - movl    tm_nest_level at TPOFF, %ecx
> 

I believe this is initial exec and so from:

http://people.redhat.com/drepper/tls.pdf

it would be movl tm_nest_level at TPOFF, %ecx

> Otherwise, Is there a way to remove this $ character?
> 
> I found that it is here in lib/Target/X86/AsmPrinter/X86ATTInstPrinter.cpp
> 
> void X86ATTInstPrinter::printOperand(const MCInst *MI, unsigned OpNo,
>                                     raw_ostream &O) {
>  const MCOperand &Op = MI->getOperand(OpNo);
>  if (Op.isReg()) {
>    O << '%' << getRegisterName(Op.getReg());
>  } else if (Op.isImm()) {
>    ...
>  } else {
>    assert(Op.isExpr() && "unknown operand kind in printOperand");
> // HERE I remove the '$' to make it work
>    O << '$' << *Op.getExpr();
>  }
> 

Hrm.  Something is wonky here.  Can you file a testcase with a .i file I can compile please?

-eric



More information about the llvm-dev mailing list