The fdiv instruction
- Area
- LLVM IR constructs
- Kind
- construct
- Level
- L1 (modelled in Lean). Next: L2 needs a recorded GPU run (a conformance test, not a proof).
- Evidence present above the level
- None above the level.
- Reference
LLVM LangRef 24.0.0git #fdiv-instruction- Quote
The ‘fdiv’ instruction returns the quotient of its two operands.
- Lean declarations
MojoProof.LLVM.Parser.instMojoProof.LLVM.InstMojoProof.Sem.execMojoProof.Sem.floatBinMojoProof.Sym.exec_fbinMojoProof.Sym.exec_fbinC
- Corpus files
tests/corpus/layernorm/ln_rowwise_block_t0_r1_ax0_w1_bs1024_c4d21970.nvptx.lltests/corpus/layernorm/ln_rowwise_block_t0_r1_ax0_w1_bs128_847b1b53.nvptx.lltests/corpus/layernorm/ln_rowwise_block_t0_r1_ax0_w1_bs256_762bdc07.nvptx.lltests/corpus/layernorm/ln_rowwise_block_t0_r1_ax0_w1_bs64_f6f88241.nvptx.lltests/corpus/layernorm/ln_rowwise_block_t0_r1_ax0_w4_bs1024_43a5be9b.nvptx.ll
5 kernel files (
.ll) in the corpus.- Tests
MojoProofTest.RuleMojoProofTest.CorpusMojoProofTest.Modelled
- Upstream issue
- None filed.
- Depends on
- No other card.
Rule
LangRef's section on fdiv (the quote is the first sentence of its overview). The importer reads fdiv as Inst.fbin with FBinOp.fdiv (Parser.inst); the semantics gives it a meaning in MojoProof.Sem.exec, with MojoProof.Sem.floatBin. MojoProofTest/Modelled.lean runs a kernel of it (its row fdiv), and the run returns. The block checker (MojoProof/Sym/Rules.lean): Sym.exec_fbin (on a float element type, but fmul contract); Sym.exec_fbinC (on a float element type, fmul contract included, with coversC); refused (fmul contract without coversC, or a non-float element type): SState.stmt takes a contracted fmul only with its contract flag and no fbin on a non-float element type.
Corpus
34 of the 116 corpus files use it (445 uses); corpus lists the first 5 in path order.
Out of scope
Forms of the instruction the corpus does not use are read by the same parser case, but no corpus file exercises them. That the semantics gives fdiv the meaning LLVM gives it rests on reading LangRef (docs/TRUST.md T7), not on a check against LLVM.
Open
L2 needs a recorded GPU run of a test of the construct; there is none.