mirror of
https://github.com/ziglang/zig.git
synced 2026-02-12 20:37:54 +00:00
Sema: implement @setFloatMode
We are putting off actual optimization of floats because we have a couple proposals being considered which would change how it works. In the meantime, lowering optimized float mode to be the same as strict is a perfectly legal way to implement the Zig language specification.
This commit is contained in:
parent
c8f8440271
commit
3fc0e0c57b
@ -4315,7 +4315,13 @@ fn zirSetCold(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!voi
|
||||
fn zirSetFloatMode(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!void {
|
||||
const inst_data = sema.code.instructions.items(.data)[inst].un_node;
|
||||
const src: LazySrcLoc = inst_data.src();
|
||||
return sema.fail(block, src, "TODO: implement Sema.zirSetFloatMode", .{});
|
||||
const float_mode = try sema.resolveBuiltinEnum(block, src, inst_data.operand, "FloatMode");
|
||||
switch (float_mode) {
|
||||
.Strict => return,
|
||||
.Optimized => {
|
||||
// TODO implement optimized float mode
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
fn zirSetRuntimeSafety(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!void {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user