|
@@ -98,7 +98,7 @@ implementation
|
|
verbose,globals,cutils,compinnr,
|
|
verbose,globals,cutils,compinnr,
|
|
globtype,constexp,
|
|
globtype,constexp,
|
|
symconst,symtype,symdef,
|
|
symconst,symtype,symdef,
|
|
- defutil,
|
|
|
|
|
|
+ defcmp,defutil,
|
|
htypechk,pass_1,
|
|
htypechk,pass_1,
|
|
cgbase,
|
|
cgbase,
|
|
ncon,ncnv,ncal,nadd,nld,nbas,nflw,ninl,
|
|
ncon,ncnv,ncal,nadd,nld,nbas,nflw,ninl,
|
|
@@ -790,36 +790,52 @@ implementation
|
|
exit;
|
|
exit;
|
|
end;
|
|
end;
|
|
|
|
|
|
- { calculations for ordinals < 32 bit have to be done in
|
|
|
|
- 32 bit for backwards compatibility. That way 'shl 33' is
|
|
|
|
- the same as 'shl 1'. It's ugly but compatible with delphi/tp/gcc }
|
|
|
|
- if (not is_64bit(left.resultdef)) and
|
|
|
|
- (torddef(left.resultdef).ordtype<>u32bit) then
|
|
|
|
|
|
+{$ifdef SUPPORT_MMX}
|
|
|
|
+ if (cs_mmx in current_settings.localswitches) and
|
|
|
|
+ is_mmx_able_array(left.resultdef) and
|
|
|
|
+ ((is_mmx_able_array(right.resultdef) and
|
|
|
|
+ equal_defs(left.resultdef,right.resultdef)
|
|
|
|
+ ) or is_constintnode(right)) then
|
|
|
|
+ begin
|
|
|
|
+ if not(mmx_type(left.resultdef) in [mmxu16bit,mmxs16bit,mmxfixed16,mmxu32bit,mmxs32bit,mmxu64bit,mmxs64bit]) then
|
|
|
|
+ CGMessage3(type_e_operator_not_supported_for_types,node2opstr(nodetype),left.resultdef.typename,right.resultdef.typename);
|
|
|
|
+ if not(is_mmx_able_array(right.resultdef)) then
|
|
|
|
+ inserttypeconv(right,sinttype);
|
|
|
|
+ end
|
|
|
|
+ else
|
|
|
|
+{$endif SUPPORT_MMX}
|
|
begin
|
|
begin
|
|
- { keep singness of orignal type }
|
|
|
|
- if is_signed(left.resultdef) then
|
|
|
|
|
|
+ { calculations for ordinals < 32 bit have to be done in
|
|
|
|
+ 32 bit for backwards compatibility. That way 'shl 33' is
|
|
|
|
+ the same as 'shl 1'. It's ugly but compatible with delphi/tp/gcc }
|
|
|
|
+ if (not is_64bit(left.resultdef)) and
|
|
|
|
+ (torddef(left.resultdef).ordtype<>u32bit) then
|
|
begin
|
|
begin
|
|
|
|
+ { keep singness of orignal type }
|
|
|
|
+ if is_signed(left.resultdef) then
|
|
|
|
+ begin
|
|
{$if defined(cpu64bitalu) or defined(cpu32bitalu)}
|
|
{$if defined(cpu64bitalu) or defined(cpu32bitalu)}
|
|
- inserttypeconv(left,s32inttype)
|
|
|
|
|
|
+ inserttypeconv(left,s32inttype)
|
|
{$elseif defined(cpu16bitalu) or defined(cpu8bitalu)}
|
|
{$elseif defined(cpu16bitalu) or defined(cpu8bitalu)}
|
|
- inserttypeconv(left,get_common_intdef(torddef(left.resultdef),torddef(sinttype),true));
|
|
|
|
|
|
+ inserttypeconv(left,get_common_intdef(torddef(left.resultdef),torddef(sinttype),true));
|
|
{$else}
|
|
{$else}
|
|
- internalerror(2013031301);
|
|
|
|
|
|
+ internalerror(2013031301);
|
|
{$endif}
|
|
{$endif}
|
|
- end
|
|
|
|
- else
|
|
|
|
- begin
|
|
|
|
|
|
+ end
|
|
|
|
+ else
|
|
|
|
+ begin
|
|
{$if defined(cpu64bitalu) or defined(cpu32bitalu)}
|
|
{$if defined(cpu64bitalu) or defined(cpu32bitalu)}
|
|
- inserttypeconv(left,u32inttype);
|
|
|
|
|
|
+ inserttypeconv(left,u32inttype);
|
|
{$elseif defined(cpu16bitalu) or defined(cpu8bitalu)}
|
|
{$elseif defined(cpu16bitalu) or defined(cpu8bitalu)}
|
|
- inserttypeconv(left,get_common_intdef(torddef(left.resultdef),torddef(uinttype),true));
|
|
|
|
|
|
+ inserttypeconv(left,get_common_intdef(torddef(left.resultdef),torddef(uinttype),true));
|
|
{$else}
|
|
{$else}
|
|
- internalerror(2013031301);
|
|
|
|
|
|
+ internalerror(2013031301);
|
|
{$endif}
|
|
{$endif}
|
|
- end
|
|
|
|
- end;
|
|
|
|
|
|
+ end
|
|
|
|
+ end;
|
|
|
|
|
|
- inserttypeconv(right,sinttype);
|
|
|
|
|
|
+ inserttypeconv(right,sinttype);
|
|
|
|
+ end;
|
|
|
|
|
|
resultdef:=left.resultdef;
|
|
resultdef:=left.resultdef;
|
|
|
|
|