New registers FRM, FFLAGS and FCSR was defined. They represent
corresponding system registers. The new registers are necessary to
properly order floating point instructions in non-default modes.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Time | Test | |
---|---|---|
2,250 ms | x64 debian > libarcher.races::lock-unrelated.c |
Event Timeline
llvm/lib/Target/RISCV/RISCVInstrInfo.td | ||
---|---|---|
1167 | Should we use the names of the mnemonics that are defined for these operations? Though I guess there's no name defined for "write" just for swap and read. |
llvm/lib/Target/RISCV/RISCVInstrInfo.td | ||
---|---|---|
1167 | Did you mean frrm and fsrm? Name like Read* are more readable. Besides it seems there are no advantages of having codegen pseudos named identically to corresponding instruction aliases. And you are right, Write* and Swap* correspond to the same mnemonic. |
llvm/lib/Target/RISCV/RISCVInstrInfo.td | ||
---|---|---|
1176 | ReadFRM is used in the implementation of FLT_ROUNDS_ (D90854). int old_rm = fegetround(); fesetround(new_rm); ... fesetround(old_rm); which is likely to be used in the implementation of #pragma STDC FENV_ROUND. Operations with FFLAGS are not used now. They would be needed to implement functions like fetestexcept and similar, but now there are no such attempts AFAIK. Operations would be needed for target specific implementation of intrinsics that access FP control modes (D82525) and FP environment (D71742). | |
llvm/lib/Target/RISCV/RISCVRegisterInfo.td | ||
543 | The first operand of RISCVReg is HWEncoding, 1, 2 and 3 represent hardware addresses of the respective system registers which are specified in the RISCV specification (https://github.com/riscv/riscv-isa-manual/releases/download/draft-20210402-1271737/riscv-spec.pdf), chapter 25 (RV32/64G Instruction Set Listings), table 25.3 (RISC-V control and status register (CSR) address map). On the other hand, these special registers are not used as operands in any of non-pseudo instruction, so these definitions are not used in instruction emitter. It means that particular values are not important, at least now. |
llvm/lib/Target/RISCV/RISCVInstrInfo.td | ||
---|---|---|
1176 | I don't think we want unused pseudos that might be used someday. We should include them when they're needed. | |
llvm/lib/Target/RISCV/RISCVRegisterInfo.td | ||
543 | I think these should probably just be 0 like the flags registers on other targets. It's only a 5 bit field and the CSR addresses are 12 bits so its purely a coincidence that these CSRs happen to be representable in 5 bits. |
I don't think we should have unused pseudo instructions since they should all have lit tests. So if they can't be tested soon, they should be added when they are needed.
You said that there no patches ready that use the Swap pseudos or the fflags pseudos. Are those patches going to be created soon or should we remove the pseudos until they are used?
Should we use the names of the mnemonics that are defined for these operations? Though I guess there's no name defined for "write" just for swap and read.