From 4752b0ef96ffffe5dcaa78d7de9c019b1dcac74b Mon Sep 17 00:00:00 2001 From: florian Date: Wed, 1 Nov 2017 16:33:32 +0000 Subject: [PATCH] + tinlinenode calls cpu specific routines for unknown inline numbers git-svn-id: trunk@37543 - --- compiler/ncginl.pas | 8 +++++++- compiler/ninl.pas | 40 ++++++++++++++++++++++++++++++++++++++-- 2 files changed, 45 insertions(+), 3 deletions(-) diff --git a/compiler/ncginl.pas b/compiler/ncginl.pas index 3b609c3368..728b60906e 100644 --- a/compiler/ncginl.pas +++ b/compiler/ncginl.pas @@ -31,6 +31,7 @@ interface type tcginlinenode = class(tinlinenode) procedure pass_generate_code;override; + procedure pass_generate_code_cpu;virtual; procedure second_sizeoftypeof;virtual; procedure second_length;virtual; procedure second_predsucc;virtual; @@ -216,11 +217,16 @@ implementation in_neg_assign_x, in_not_assign_x: second_NegNot_assign; - else internalerror(9); + else + pass_generate_code_cpu; end; end; + procedure tcginlinenode.pass_generate_code_cpu; + begin + Internalerror(2017110103); + end; {***************************************************************************** SIZEOF / TYPEOF GENERIC HANDLING diff --git a/compiler/ninl.pas b/compiler/ninl.pas index 07e0671fd9..8a449a6b66 100644 --- a/compiler/ninl.pas +++ b/compiler/ninl.pas @@ -38,6 +38,7 @@ interface procedure printnodeinfo(var t : text);override; function pass_1 : tnode;override; function pass_typecheck:tnode;override; + function pass_typecheck_cpu:tnode;virtual; function simplify(forinline : boolean): tnode;override; function docompare(p: tnode): boolean; override; @@ -93,6 +94,9 @@ interface {$endif not cpu64bitalu} function first_AndOrXorShiftRot_assign: tnode; virtual; function first_NegNot_assign: tnode; virtual; + function first_cpu : tnode; virtual; + + procedure CheckParameters(count : integer); private function handle_str: tnode; function handle_reset_rewrite_typed: tnode; @@ -3595,7 +3599,7 @@ implementation result:=handle_concat; end; else - internalerror(8); + result:=pass_typecheck_cpu; end; end; @@ -3605,6 +3609,12 @@ implementation end; + function tinlinenode.pass_typecheck_cpu : tnode; + begin + internalerror(2017110102); + end; + + function tinlinenode.pass_1 : tnode; var hp: tnode; @@ -3985,7 +3995,7 @@ implementation in_fma_float128: result:=first_fma; else - internalerror(89); + result:=first_cpu; end; end; {$maxfpuregisters default} @@ -5043,5 +5053,31 @@ implementation expectloc:=left.expectloc; end; + + function tinlinenode.first_cpu : tnode; + begin + internalerror(2017110101); + end; + + + procedure tinlinenode.CheckParameters(count: integer); + var + p: tnode; + begin + if count=1 then + set_varstate(left,vs_read,[vsf_must_be_valid]) + else + begin + p:=left; + while count>0 do + begin + set_varstate(tcallparanode(p).left,vs_read,[vsf_must_be_valid]); + + p:=tcallparanode(p).right; + dec(count); + end; + end; + end; + end.