typeAssert: bool float string

This commit is contained in:
visualfc
2024-05-10 13:25:36 +08:00
parent c9cc7ad9f7
commit e985eda857
8 changed files with 412 additions and 238 deletions

View File

@@ -290,10 +290,6 @@ func (p *context) funcOf(fn *ssa.Function) (ret llssa.Function, ftype int) {
ftype = llgoAllocaCStr
case "unreachable":
ftype = llgoUnreachable
case "bitCastTo64F":
ftype = llgoBitCastTo64F
case "bitCastTo32F":
ftype = llgoBitCastTo32F
default:
panic("unknown llgo instruction: " + name)
}
@@ -527,10 +523,6 @@ func (p *context) compileInstrOrValue(b llssa.Builder, iv instrOrValue, asValue
ret = p.allocaCStr(b, args)
case llgoUnreachable: // func unreachable()
b.Unreachable()
case llgoBitCastTo32F:
ret = b.BitCast(p.compileValue(b, args[0]), b.Prog.Type(types.Typ[types.Float32], llssa.InGo))
case llgoBitCastTo64F:
ret = b.BitCast(p.compileValue(b, args[0]), b.Prog.Float64())
default:
panic("todo")
}