improve style
This commit is contained in:
parent
a7c9533a73
commit
bd68d3d8f4
1 changed files with 4 additions and 4 deletions
|
|
@ -776,11 +776,11 @@ proc genCastIntFloat(c: PCtx; n: PNode; dest: var TDest) =
|
||||||
let src = n.sons[1].typ.skipTypes(abstractRange)#.kind
|
let src = n.sons[1].typ.skipTypes(abstractRange)#.kind
|
||||||
let dst = n.sons[0].typ.skipTypes(abstractRange)#.kind
|
let dst = n.sons[0].typ.skipTypes(abstractRange)#.kind
|
||||||
let src_size = getSize(c.config, src)
|
let src_size = getSize(c.config, src)
|
||||||
|
let dst_size = getSize(c.config, dst)
|
||||||
if c.config.target.intSize < 8:
|
if c.config.target.intSize < 8:
|
||||||
signedIntegers.incl(tyInt)
|
signedIntegers.incl(tyInt)
|
||||||
unsignedIntegers.incl(tyUInt)
|
unsignedIntegers.incl(tyUInt)
|
||||||
if src_size == getSize(c.config, dst) and src.kind in allowedIntegers and
|
if src_size == dst_size and src.kind in allowedIntegers and
|
||||||
dst.kind in allowedIntegers:
|
dst.kind in allowedIntegers:
|
||||||
let tmp = c.genx(n.sons[1])
|
let tmp = c.genx(n.sons[1])
|
||||||
var tmp2 = c.getTemp(n.sons[1].typ)
|
var tmp2 = c.getTemp(n.sons[1].typ)
|
||||||
|
|
@ -809,7 +809,7 @@ proc genCastIntFloat(c: PCtx; n: PNode; dest: var TDest) =
|
||||||
c.freeTemp(tmp)
|
c.freeTemp(tmp)
|
||||||
c.freeTemp(tmp2)
|
c.freeTemp(tmp2)
|
||||||
c.freeTemp(tmp3)
|
c.freeTemp(tmp3)
|
||||||
elif src_size == getSize(c.config, dst) and src.kind in allowedIntegers and
|
elif src_size == dst_size and src.kind in allowedIntegers and
|
||||||
dst.kind in {tyFloat, tyFloat32, tyFloat64}:
|
dst.kind in {tyFloat, tyFloat32, tyFloat64}:
|
||||||
|
|
||||||
let tmp = c.getTemp(n.sons[1].typ)
|
let tmp = c.getTemp(n.sons[1].typ)
|
||||||
|
|
@ -820,7 +820,7 @@ proc genCastIntFloat(c: PCtx; n: PNode; dest: var TDest) =
|
||||||
c.gABC(n, opcAsgnFloat64FromInt, dest, tmp)
|
c.gABC(n, opcAsgnFloat64FromInt, dest, tmp)
|
||||||
c.freeTemp(tmp)
|
c.freeTemp(tmp)
|
||||||
|
|
||||||
elif src_size == getSize(c.config, dst) and src.kind in {tyFloat, tyFloat32, tyFloat64} and
|
elif src_size == dst_size and src.kind in {tyFloat, tyFloat32, tyFloat64} and
|
||||||
dst.kind in allowedIntegers:
|
dst.kind in allowedIntegers:
|
||||||
|
|
||||||
let tmp = c.getTemp(n.sons[1].typ)
|
let tmp = c.getTemp(n.sons[1].typ)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue