This is an archive of the discontinued LLVM Phabricator instance.

[mips] Add support for .cpload.
AbandonedPublic

Authored by matheusalmeida on Mar 11 2014, 10:11 AM.

Details

Reviewers
jacksprat
Summary

Add support for .cpload.

EDIT: CC'ing Daniel.

Diff Detail

Event Timeline

Comments inline.

lib/Target/Mips/AsmParser/MipsAsmParser.cpp
2564

If we are to use the magic to compare a string with "==" shouldn't this routine move to a switch/case?

lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp
343

I am concerned that this is all happening in TargetStream. Do we really want macros to be handled by this class object?

I would have thought that this would have been done in AsmParser and the final instructions would end up going through MC output.

Find out what the list thinks.

Comments inline.

I'm not going to commit this work straight away. I believe my understanding of how PIC works on Mips is right but there might be some corner case that I missed that is not clear on the ABI but it's implemented by GAS (like PIC/CPIC ehdr flags).

lib/Target/Mips/AsmParser/MipsAsmParser.cpp
2564

I suppose I could move this code into a new function (e.g. parseCpload) mainly because the function parseDirective will get bigger and bigger but I don't see why having a switch/case would help here. Do you mean using a StringSwitch ?

lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp
343

The AsmParser shouldn't be handling macro expansions nor handling some directives like .cpload. It's perfectly valid for CodeGen to emit macros (e.g. la) or assembly directives like .cpload[1]. If we were to implement macro expansions and handling these directives in the AsmParser, we would need to replicate that functionality in the target streamer because that's the correct way for CodeGen to interact with the MC layer. We don't want that =)

The list agrees with this view. See http://comments.gmane.org/gmane.comp.compilers.llvm.devel/70692

[1] I know this is not the case for our current backend but I'm also aware that we used to do that. See http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20120507/142706.html

matheusalmeida abandoned this revision.Apr 30 2014, 2:56 AM

Superseded by D3480.