Page MenuHomePhabricator

[RISCV] Add support for 'pause' as an alias for 'fence w, 0' [do not merge]
AcceptedPublic

Authored by mundaym on Dec 10 2020, 3:17 AM.

Details

Summary

Do not merge:

  1. the pause hint is still in the proposal stage (https://github.com/riscv/riscv-isa-manual/pull/398)
  2. the syntax for representing empty sets in fence operands is not yet finalized (likely to be either 0, as in this patch, or -)

Add support for the 'pause' hint instruction as an alias for
'fence w, 0'. To do this allow the 'fence' operands pred and succ
to be set to 0 (the empty set). This will also allow future hints
to be encoded as 'fence 0, <x>' and 'fence <x>, 0'.

Diff Detail

Unit TestsFailed

TimeTest
20 msx64 debian > LLVM.MC/Disassembler/RISCV::unknown-fence-field.txt
Script: -- : 'RUN: at line 1'; /mnt/disks/ssd0/agent/llvm-project/build/bin/llvm-mc -disassemble -triple=riscv32 < /mnt/disks/ssd0/agent/llvm-project/llvm/test/MC/Disassembler/RISCV/unknown-fence-field.txt 2>&1 | /mnt/disks/ssd0/agent/llvm-project/build/bin/FileCheck /mnt/disks/ssd0/agent/llvm-project/llvm/test/MC/Disassembler/RISCV/unknown-fence-field.txt
70 msx64 windows > LLVM.CodeGen/XCore::threads.ll
Script: -- : 'RUN: at line 1'; c:\ws\w16c2-1\llvm-project\premerge-checks\build\bin\llc.exe -march=xcore < C:\ws\w16c2-1\llvm-project\premerge-checks\llvm\test\CodeGen\XCore\threads.ll | c:\ws\w16c2-1\llvm-project\premerge-checks\build\bin\filecheck.exe C:\ws\w16c2-1\llvm-project\premerge-checks\llvm\test\CodeGen\XCore\threads.ll
50 msx64 windows > LLVM.MC/Disassembler/RISCV::unknown-fence-field.txt
Script: -- : 'RUN: at line 1'; c:\ws\w16c2-1\llvm-project\premerge-checks\build\bin\llvm-mc.exe -disassemble -triple=riscv32 < C:\ws\w16c2-1\llvm-project\premerge-checks\llvm\test\MC\Disassembler\RISCV\unknown-fence-field.txt 2>&1 | c:\ws\w16c2-1\llvm-project\premerge-checks\build\bin\filecheck.exe C:\ws\w16c2-1\llvm-project\premerge-checks\llvm\test\MC\Disassembler\RISCV\unknown-fence-field.txt

Event Timeline

mundaym created this revision.Dec 10 2020, 3:17 AM
mundaym requested review of this revision.Dec 10 2020, 3:17 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 10 2020, 3:17 AM
mundaym retitled this revision from [RISCV] Add support for 'pause' as an alias for 'fence w, 0' to [RISCV] Add support for 'pause' as an alias for 'fence w, 0' [do not merge].Dec 10 2020, 3:35 AM
lenary accepted this revision.Dec 10 2020, 10:49 AM

LGTM! Let's wait for the spec to be merged before merging this though.

This revision is now accepted and ready to land.Dec 10 2020, 10:49 AM