This is an archive of the discontinued LLVM Phabricator instance.

[mips][ias] Correct ELF eflags when Octeon is the target.
ClosedPublic

Authored by dsanders on Apr 8 2016, 7:01 AM.

Diff Detail

Event Timeline

dsanders updated this revision to Diff 53023.Apr 8 2016, 7:01 AM
dsanders retitled this revision from to [mips][ias] Correct ELF eflags when Octeon is the target..
dsanders updated this object.
dsanders added subscribers: llvm-commits, spetrovic, mpf, petarj.
sdardis edited edge metadata.Apr 14 2016, 6:29 AM

With clang -target mipsel-unknown-linux -mcpu=octeon trival.s -fintegrated-as -c -o blah.o

objdump is giving me:

private flags = 808b0006: [no abi set] [mips64r2] [not32bitmode] [PIC] [CPIC]

The ISA (64r2) and machine type (E_MIPS_MACH_OCTEON) flags seem to be coming out correct, and the EF_MIPS_CPIC / EF_MIPS_PIC are expected.

However GCC / as is giving me:

private flags = 808b0026: [ABI=N32] [mips64r2] [not 32bitmode] [PIC] [CPIC]

The Is the missing ABI information a separate issue?

mpf added a comment.Apr 14 2016, 6:45 AM

I'd leave the ABI issue as a separate change or this could easily end up covering a huge amount of work.

It did occur to me that the .MIPS.abiflags data also needs updating when targetting octeon to set the isa_ext field.

Matthew

In D18899#401063, @mpf wrote:

I'd leave the ABI issue as a separate change or this could easily end up covering a huge amount of work.

I've had a quick look at this and I think it's caused by the way the ABI feature bits are tied to the processor. With a mipsel-* triple we end up with half-O32 half-N64 output but it should do the right thing with a mips64el-* triple.

I think we can leave this as a separate change since MIPS64 processors on a mipsel-* triple is known to be buggy at the moment.

It did occur to me that the .MIPS.abiflags data also needs updating when targetting octeon to set the isa_ext field.

Ok, I'll add that to this patch.

sdardis requested changes to this revision.May 6 2016, 2:38 AM
sdardis edited edge metadata.

Flagging this as requiring changes so you see it in your queue.

This revision now requires changes to proceed.May 6 2016, 2:38 AM
dsanders updated this revision to Diff 56577.May 9 2016, 7:34 AM
dsanders edited edge metadata.

Implement the effect on the .MIPS.abiflags option too.
The ISA Extension field values are all mutually exclusive. Corrected the field
name accordingly.

sdardis accepted this revision.May 10 2016, 6:12 AM
sdardis edited edge metadata.

LGTM.

This revision is now accepted and ready to land.May 10 2016, 6:12 AM
dsanders closed this revision.May 12 2016, 4:37 AM