This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] ELF attribute for Zfh extension.
AbandonedPublic

Authored by HsiangKai on Nov 11 2020, 6:06 PM.

Details

Summary

Add Zfh into ELF march attribute.

Diff Detail

Event Timeline

HsiangKai created this revision.Nov 11 2020, 6:06 PM
HsiangKai requested review of this revision.Nov 11 2020, 6:06 PM
HsiangKai edited reviewers, added: craig.topper; removed: craig.scott.Nov 11 2020, 8:49 PM
jrtc27 added inline comments.Nov 11 2020, 9:09 PM
llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
2144

Having each X and Z extension hard-code its length is going to get ugly (and this doesn't match the code style for variable names). Instead I think we should be making good use of StringRef::consume_front.

llvm/test/MC/RISCV/attribute-with-insts.s
13

This changes the test; we're no longer checking whether D implies F but instead whether (D or Zfh) implies F.

luismarques added inline comments.Nov 24 2020, 2:24 AM
llvm/lib/Object/ELFObjectFile.cpp
335

Do we need to actually consume the prefix, or would using just startswith be fine?

jrtc27 added inline comments.Nov 24 2020, 3:19 AM
llvm/lib/Object/ELFObjectFile.cpp
335

For now, startswith would work due to the drop_until below. However, consume_front matches the take_front above, and will be important when we want to start parsing version numbers.

llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
2144

... ok but now we drop that many characters twice: once from consume_front and once from drop_front below.

HsiangKai abandoned this revision.Jan 19 2021, 12:53 AM

D94931 is more complete.