From 8b12b7b7342578666e91a2d08e35b012f483a39e Mon Sep 17 00:00:00 2001 From: Stephen Heumann Date: Fri, 29 Jan 2021 23:25:21 -0600 Subject: [PATCH] Handle (unsigned) long long in the front-end code for binary conversions. There is not yet code generation support for the conversion opcodes (pc_cnv/pc_cnn). --- Expression.pas | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/Expression.pas b/Expression.pas index e0814e4..fa4a114 100644 --- a/Expression.pas +++ b/Expression.pas @@ -337,17 +337,41 @@ if (lType^.kind = scalarType) and (rType^.kind = scalarType) then begin rt := Unary(rType^.baseType); if lt <> rt then begin if lt = cgExtended then begin - if rt in [cgWord,cgUWord,cgLong,cgULong] then + if rt in [cgWord,cgUWord,cgLong,cgULong,cgQuad,cgUQuad] then Gen2(pc_cnv, ord(rt), ord(cgExtended)); UsualBinaryConversions := cgExtended; expressionType := extendedPtr; end {if} else if rt = cgExtended then begin - if lt in [cgWord,cgUWord,cgLong,cgULong] then + if lt in [cgWord,cgUWord,cgLong,cgULong,cgQuad,cgUQuad] then Gen2(pc_cnn, ord(lt), ord(cgExtended)); UsualBinaryConversions := cgExtended; expressionType := extendedPtr; end {else if} + else if lt = cgUQuad then begin + if rt in [cgWord,cgUWord,cgLong,cgULong] then + Gen2(pc_cnv, ord(rt), ord(cgUQuad)); + UsualBinaryConversions := cgUQuad; + expressionType := uLongLongPtr; + end {else if} + else if rt = cgUQuad then begin + if lt in [cgWord,cgUWord,cgLong,cgULong] then + Gen2(pc_cnn, ord(lt), ord(cgUQuad)); + UsualBinaryConversions := cgUQuad; + expressionType := uLongLongPtr; + end {else if} + else if lt = cgQuad then begin + if rt in [cgWord,cgUWord,cgLong,cgULong] then + Gen2(pc_cnv, ord(rt), ord(cgQuad)); + UsualBinaryConversions := cgQuad; + expressionType := longLongPtr; + end {else if} + else if rt = cgQuad then begin + if lt in [cgWord,cgUWord,cgLong,cgULong] then + Gen2(pc_cnn, ord(lt), ord(cgQuad)); + UsualBinaryConversions := cgQuad; + expressionType := longLongPtr; + end {else if} else if lt = cgULong then begin if rt in [cgWord,cgUWord] then Gen2(pc_cnv, ord(rt), ord(cgULong));