ncgcon.pas 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617
  1. {
  2. Copyright (c) 1998-2002 by Florian Klaempfl
  3. Generate assembler for constant nodes which are the same for
  4. all (most) processors
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. ****************************************************************************
  17. }
  18. unit ncgcon;
  19. {$i fpcdefs.inc}
  20. interface
  21. uses
  22. aasmbase,
  23. symtype,
  24. node,ncon;
  25. type
  26. tcgdataconstnode = class(tdataconstnode)
  27. procedure pass_generate_code;override;
  28. end;
  29. tcgrealconstnode = class(trealconstnode)
  30. procedure pass_generate_code;override;
  31. end;
  32. tcgordconstnode = class(tordconstnode)
  33. procedure pass_generate_code;override;
  34. end;
  35. tcgpointerconstnode = class(tpointerconstnode)
  36. procedure pass_generate_code;override;
  37. end;
  38. tcgstringconstnode = class(tstringconstnode)
  39. procedure pass_generate_code;override;
  40. protected
  41. procedure load_dynstring(const strpointerdef: tdef; const elementdef: tdef; const winlikewidestring: boolean); virtual;
  42. end;
  43. tcgsetconstnode = class(tsetconstnode)
  44. protected
  45. function emitvarsetconst: tasmsymbol; virtual;
  46. procedure handlevarsetconst;
  47. public
  48. procedure pass_generate_code;override;
  49. end;
  50. tcgnilnode = class(tnilnode)
  51. procedure pass_generate_code;override;
  52. end;
  53. tcgguidconstnode = class(tguidconstnode)
  54. procedure pass_generate_code;override;
  55. end;
  56. implementation
  57. uses
  58. globtype,widestr,systems,
  59. verbose,globals,cutils,
  60. aasmcnst,
  61. symconst,symdef,aasmtai,aasmdata,aasmcpu,defutil,
  62. cpuinfo,cpubase,
  63. cgbase,cgobj,cgutils,
  64. ncgutil,hlcgobj,cclasses,tgobj
  65. ;
  66. {*****************************************************************************
  67. TCGDATACONSTNODE
  68. *****************************************************************************}
  69. procedure tcgdataconstnode.pass_generate_code;
  70. var
  71. l : tasmlabel;
  72. i : longint;
  73. b : byte;
  74. begin
  75. location_reset_ref(location,LOC_CREFERENCE,OS_NO,const_align(maxalign));
  76. current_asmdata.getdatalabel(l);
  77. maybe_new_object_file(current_asmdata.asmlists[al_typedconsts]);
  78. new_section(current_asmdata.asmlists[al_typedconsts],sec_rodata_norel,l.name,const_align(maxalign));
  79. current_asmdata.asmlists[al_typedconsts].concat(Tai_label.Create(l));
  80. data.seek(0);
  81. for i:=0 to data.size-1 do
  82. begin
  83. data.read(b,1);
  84. current_asmdata.asmlists[al_typedconsts].concat(Tai_const.Create_8bit(b));
  85. end;
  86. location.reference.symbol:=l;
  87. end;
  88. {*****************************************************************************
  89. TCGREALCONSTNODE
  90. *****************************************************************************}
  91. procedure tcgrealconstnode.pass_generate_code;
  92. { I suppose the parser/pass_1 must make sure the generated real }
  93. { constants are actually supported by the target processor? (JM) }
  94. const
  95. floattype2ait:array[tfloattype] of tairealconsttype=
  96. (aitrealconst_s32bit,aitrealconst_s64bit,aitrealconst_s80bit,aitrealconst_s80bit,aitrealconst_s64comp,aitrealconst_s64comp,aitrealconst_s128bit);
  97. { Since the value is stored always as bestreal, we share a single pool
  98. between all float types. This requires type and hiloswapped flag to
  99. be matched along with the value }
  100. type
  101. tfloatkey = record
  102. value: bestreal;
  103. typ: tfloattype;
  104. swapped: boolean;
  105. end;
  106. var
  107. lastlabel : tasmlabel;
  108. realait : tairealconsttype;
  109. entry : PHashSetItem;
  110. key: tfloatkey;
  111. {$ifdef ARM}
  112. hiloswapped : boolean;
  113. {$endif ARM}
  114. begin
  115. location_reset_ref(location,LOC_CREFERENCE,def_cgsize(resultdef),const_align(resultdef.alignment));
  116. lastlabel:=nil;
  117. realait:=floattype2ait[tfloatdef(resultdef).floattype];
  118. {$ifdef ARM}
  119. hiloswapped:=is_double_hilo_swapped;
  120. {$endif ARM}
  121. { const already used ? }
  122. if not assigned(lab_real) then
  123. begin
  124. { there may be gap between record fields, zero it out }
  125. fillchar(key,sizeof(key),0);
  126. key.value:=value_real;
  127. key.typ:=tfloatdef(resultdef).floattype;
  128. {$ifdef ARM}
  129. key.swapped:=hiloswapped;
  130. {$endif ARM}
  131. entry := current_asmdata.ConstPools[sp_floats].FindOrAdd(@key, sizeof(key));
  132. lab_real := TAsmLabel(entry^.Data); // is it needed anymore?
  133. { :-(, we must generate a new entry }
  134. if not(assigned(lab_real)) then
  135. begin
  136. current_asmdata.getdatalabel(lastlabel);
  137. entry^.Data:=lastlabel;
  138. lab_real:=lastlabel;
  139. maybe_new_object_file(current_asmdata.asmlists[al_typedconsts]);
  140. new_section(current_asmdata.asmlists[al_typedconsts],sec_rodata_norel,lastlabel.name,const_align(resultdef.alignment));
  141. current_asmdata.asmlists[al_typedconsts].concat(Tai_label.Create(lastlabel));
  142. case realait of
  143. aitrealconst_s32bit :
  144. begin
  145. current_asmdata.asmlists[al_typedconsts].concat(tai_realconst.create_s32real(ts32real(value_real)));
  146. { range checking? }
  147. if floating_point_range_check_error and
  148. (tai_realconst(current_asmdata.asmlists[al_typedconsts].last).value.s32val=MathInf.Value) then
  149. Message(parser_e_range_check_error);
  150. end;
  151. aitrealconst_s64bit :
  152. begin
  153. {$ifdef ARM}
  154. if hiloswapped then
  155. current_asmdata.asmlists[al_typedconsts].concat(tai_realconst.create_s64real_hiloswapped(ts64real(value_real)))
  156. else
  157. {$endif ARM}
  158. current_asmdata.asmlists[al_typedconsts].concat(tai_realconst.create_s64real(ts64real(value_real)));
  159. { range checking? }
  160. if floating_point_range_check_error and
  161. (tai_realconst(current_asmdata.asmlists[al_typedconsts].last).value.s64val=MathInf.Value) then
  162. Message(parser_e_range_check_error);
  163. end;
  164. aitrealconst_s80bit :
  165. begin
  166. current_asmdata.asmlists[al_typedconsts].concat(tai_realconst.create_s80real(value_real,tfloatdef(resultdef).size));
  167. { range checking? }
  168. if floating_point_range_check_error and
  169. (tai_realconst(current_asmdata.asmlists[al_typedconsts].last).value.s80val=MathInf.Value) then
  170. Message(parser_e_range_check_error);
  171. end;
  172. {$ifdef cpufloat128}
  173. aitrealconst_s128bit :
  174. begin
  175. current_asmdata.asmlists[al_typedconsts].concat(tai_realconst.create_s128real(value_real));
  176. { range checking? }
  177. if floating_point_range_check_error and
  178. (tai_realconst(current_asmdata.asmlists[al_typedconsts].last).value.s128val=MathInf.Value) then
  179. Message(parser_e_range_check_error);
  180. end;
  181. {$endif cpufloat128}
  182. { the round is necessary for native compilers where comp isn't a float }
  183. aitrealconst_s64comp :
  184. if (value_real>9223372036854775807.0) or (value_real<-9223372036854775808.0) then
  185. message(parser_e_range_check_error)
  186. else
  187. current_asmdata.asmlists[al_typedconsts].concat(tai_realconst.create_s64compreal(round(value_real)));
  188. else
  189. internalerror(10120);
  190. end;
  191. end;
  192. end;
  193. location.reference.symbol:=lab_real;
  194. end;
  195. {*****************************************************************************
  196. TCGORDCONSTNODE
  197. *****************************************************************************}
  198. procedure tcgordconstnode.pass_generate_code;
  199. begin
  200. location_reset(location,LOC_CONSTANT,def_cgsize(resultdef));
  201. {$ifdef cpu64bitalu}
  202. location.value:=value.svalue;
  203. {$else cpu64bitalu}
  204. location.value64:=value.svalue;
  205. {$endif cpu64bitalu}
  206. end;
  207. {*****************************************************************************
  208. TCGPOINTERCONSTNODE
  209. *****************************************************************************}
  210. procedure tcgpointerconstnode.pass_generate_code;
  211. begin
  212. { an integer const. behaves as a memory reference }
  213. location_reset(location,LOC_CONSTANT,OS_ADDR);
  214. location.value:=aint(value);
  215. end;
  216. {*****************************************************************************
  217. TCGSTRINGCONSTNODE
  218. *****************************************************************************}
  219. procedure tcgstringconstnode.pass_generate_code;
  220. var
  221. lastlabel: tasmlabofs;
  222. pc: pchar;
  223. l: longint;
  224. pool: THashSet;
  225. entry: PHashSetItem;
  226. winlikewidestring: boolean;
  227. elementdef: tdef;
  228. strpointerdef: tdef;
  229. datatcb: ttai_typedconstbuilder;
  230. datadef: tdef;
  231. const
  232. PoolMap: array[tconststringtype] of TConstPoolType = (
  233. sp_conststr,
  234. sp_shortstr,
  235. sp_longstr,
  236. sp_ansistr,
  237. sp_widestr,
  238. sp_unicodestr
  239. );
  240. begin
  241. case cst_type of
  242. cst_shortstring,
  243. cst_conststring,
  244. cst_ansistring:
  245. begin
  246. elementdef:=cansichartype;
  247. strpointerdef:=charpointertype;
  248. end;
  249. cst_widestring,
  250. cst_unicodestring:
  251. begin
  252. elementdef:=cwidechartype;
  253. strpointerdef:=widecharpointertype;
  254. end;
  255. else
  256. internalerror(2014032803);
  257. end;
  258. { for empty ansistrings we could return a constant 0 }
  259. if (cst_type in [cst_ansistring,cst_widestring,cst_unicodestring]) and (len=0) then
  260. begin
  261. location_reset(location,LOC_CONSTANT,def_cgsize(strpointerdef));
  262. location.value:=0;
  263. exit;
  264. end;
  265. winlikewidestring:=(cst_type=cst_widestring) and (tf_winlikewidestring in target_info.flags);
  266. { const already used ? }
  267. if not assigned(lab_str) then
  268. begin
  269. pool := current_asmdata.ConstPools[PoolMap[cst_type]];
  270. if cst_type in [cst_widestring, cst_unicodestring] then
  271. entry := pool.FindOrAdd(pcompilerwidestring(value_str)^.data,len*cwidechartype.size)
  272. else
  273. if cst_type = cst_ansistring then
  274. entry := PHashSetItem(TTagHashSet(pool).FindOrAdd(value_str,len,tstringdef(resultdef).encoding))
  275. else
  276. entry := pool.FindOrAdd(value_str,len);
  277. lab_str := TAsmLabel(entry^.Data); // is it needed anymore?
  278. { :-(, we must generate a new entry }
  279. if not assigned(entry^.Data) then
  280. begin
  281. case cst_type of
  282. cst_ansistring:
  283. begin
  284. if len=0 then
  285. InternalError(2008032301) { empty string should be handled above }
  286. else
  287. begin
  288. lastlabel:=ctai_typedconstbuilder.emit_ansistring_const(current_asmdata.AsmLists[al_typedconsts],value_str,len,tstringdef(resultdef).encoding,true);
  289. { because we hardcode the offset below due to it
  290. not being stored in the hashset, check here }
  291. if lastlabel.ofs<>ctai_typedconstbuilder.get_string_symofs(st_ansistring,false) then
  292. internalerror(2012051703);
  293. end;
  294. end;
  295. cst_unicodestring,
  296. cst_widestring:
  297. begin
  298. if len=0 then
  299. InternalError(2008032302) { empty string should be handled above }
  300. else
  301. begin
  302. lastlabel:=ctai_typedconstbuilder.emit_unicodestring_const(current_asmdata.AsmLists[al_typedconsts],
  303. value_str,
  304. tstringdef(resultdef).encoding,
  305. winlikewidestring);
  306. { because we hardcode the offset below due to it
  307. not being stored in the hashset, check here }
  308. if lastlabel.ofs<>ctai_typedconstbuilder.get_string_symofs(tstringdef(resultdef).stringtype,winlikewidestring) then
  309. internalerror(2012051704);
  310. end;
  311. end;
  312. cst_shortstring:
  313. begin
  314. current_asmdata.getdatalabel(lastlabel.lab);
  315. datatcb:=ctai_typedconstbuilder.create([tcalo_is_lab,tcalo_new_section]);
  316. { truncate strings larger than 255 chars }
  317. if len>255 then
  318. l:=255
  319. else
  320. l:=len;
  321. { include length and terminating zero for quick conversion to pchar }
  322. getmem(pc,l+2);
  323. move(value_str^,pc[1],l);
  324. pc[0]:=chr(l);
  325. pc[l+1]:=#0;
  326. datadef:=getarraydef(cansichartype,l+1);
  327. datatcb.maybe_begin_aggregate(datadef);
  328. datatcb.emit_tai(Tai_string.Create_pchar(pc,l+1),datadef);
  329. datatcb.maybe_end_aggregate(datadef);
  330. current_asmdata.asmlists[al_typedconsts].concatList(
  331. datatcb.get_final_asmlist(lastlabel.lab,datadef,sec_rodata_norel,lastlabel.lab.name,const_align(sizeof(pint)))
  332. );
  333. datatcb.free;
  334. end;
  335. cst_conststring:
  336. begin
  337. current_asmdata.getdatalabel(lastlabel.lab);
  338. datatcb:=ctai_typedconstbuilder.create([tcalo_is_lab,tcalo_new_section]);
  339. { include terminating zero }
  340. getmem(pc,len+1);
  341. move(value_str^,pc[0],len);
  342. pc[len]:=#0;
  343. { the data includes the terminating #0 because this
  344. string can be used for pchar assignments (but it's
  345. also used for array-of-char assignments, in which
  346. case the terminating #0 is not part of the data) }
  347. datadef:=getarraydef(cansichartype,len+1);
  348. datatcb.maybe_begin_aggregate(datadef);
  349. datatcb.emit_tai(Tai_string.Create_pchar(pc,len+1),datadef);
  350. datatcb.maybe_end_aggregate(datadef);
  351. current_asmdata.asmlists[al_typedconsts].concatList(
  352. datatcb.get_final_asmlist(lastlabel.lab,datadef,sec_rodata_norel,lastlabel.lab.name,const_align(sizeof(pint)))
  353. );
  354. datatcb.free;
  355. end;
  356. else
  357. internalerror(2013120103);
  358. end;
  359. lab_str:=lastlabel.lab;
  360. entry^.Data:=lastlabel.lab;
  361. end;
  362. end;
  363. if cst_type in [cst_ansistring, cst_widestring, cst_unicodestring] then
  364. begin
  365. location_reset(location, LOC_REGISTER, def_cgsize(strpointerdef));
  366. location.register:=hlcg.getaddressregister(current_asmdata.CurrAsmList,strpointerdef);
  367. load_dynstring(strpointerdef, elementdef, winlikewidestring);
  368. end
  369. else
  370. begin
  371. location_reset_ref(location, LOC_CREFERENCE, def_cgsize(resultdef), const_align(strpointerdef.size));
  372. location.reference.symbol:=lab_str;
  373. end;
  374. end;
  375. procedure tcgstringconstnode.load_dynstring(const strpointerdef: tdef; const elementdef: tdef; const winlikewidestring: boolean);
  376. var
  377. href: treference;
  378. begin
  379. reference_reset_symbol(href, lab_str,
  380. ctai_typedconstbuilder.get_string_symofs(tstringdef(resultdef).stringtype, winlikewidestring),
  381. const_align(strpointerdef.size));
  382. hlcg.a_loadaddr_ref_reg(current_asmdata.CurrAsmList, elementdef, strpointerdef, href, location.register)
  383. end;
  384. {*****************************************************************************
  385. TCGSETCONSTNODE
  386. *****************************************************************************}
  387. function tcgsetconstnode.emitvarsetconst: tasmsymbol;
  388. type
  389. setbytes=array[0..31] of byte;
  390. Psetbytes=^setbytes;
  391. var
  392. lab: tasmlabel;
  393. i: longint;
  394. begin
  395. current_asmdata.getdatalabel(lab);
  396. result:=lab;
  397. lab_set:=lab;
  398. maybe_new_object_file(current_asmdata.asmlists[al_typedconsts]);
  399. new_section(current_asmdata.asmlists[al_typedconsts],sec_rodata_norel,result.name,const_align(8));
  400. current_asmdata.asmlists[al_typedconsts].concat(Tai_label.Create(lab));
  401. if (source_info.endian=target_info.endian) then
  402. for i:=0 to 31 do
  403. current_asmdata.asmlists[al_typedconsts].concat(Tai_const.Create_8bit(Psetbytes(value_set)^[i]))
  404. else
  405. for i:=0 to 31 do
  406. current_asmdata.asmlists[al_typedconsts].concat(Tai_const.Create_8bit(reverse_byte(Psetbytes(value_set)^[i])));
  407. end;
  408. procedure tcgsetconstnode.handlevarsetconst;
  409. var
  410. entry : PHashSetItem;
  411. begin
  412. location_reset_ref(location,LOC_CREFERENCE,OS_NO,const_align(8));
  413. { const already used ? }
  414. if not assigned(lab_set) then
  415. begin
  416. entry := current_asmdata.ConstPools[sp_varsets].FindOrAdd(value_set, 32);
  417. { :-(, we must generate a new entry }
  418. if not assigned(entry^.Data) then
  419. entry^.Data:=emitvarsetconst;
  420. lab_set := TAsmSymbol(entry^.Data);
  421. end;
  422. location.reference.symbol:=lab_set;
  423. end;
  424. procedure tcgsetconstnode.pass_generate_code;
  425. type
  426. setbytes=array[0..31] of byte;
  427. Psetbytes=^setbytes;
  428. procedure smallsetconst;
  429. begin
  430. location_reset(location,LOC_CONSTANT,int_cgsize(resultdef.size));
  431. if (source_info.endian=target_info.endian) then
  432. begin
  433. { not plongint, because that will "sign extend" the set on 64 bit platforms }
  434. { if changed to "paword", please also modify "32-resultdef.size*8" and }
  435. { cross-endian code below }
  436. { Extra aint type cast to avoid range errors }
  437. location.value:=aint(pCardinal(value_set)^)
  438. end
  439. else
  440. begin
  441. location.value:=aint(swapendian(Pcardinal(value_set)^));
  442. location.value:=aint(
  443. reverse_byte (location.value and $ff) or
  444. (reverse_byte((location.value shr 8) and $ff) shl 8) or
  445. (reverse_byte((location.value shr 16) and $ff) shl 16) or
  446. (reverse_byte((location.value shr 24) and $ff) shl 24)
  447. );
  448. end;
  449. if (target_info.endian=endian_big) then
  450. location.value:=location.value shr (32-resultdef.size*8);
  451. end;
  452. procedure varsetconst;
  453. var
  454. lastlabel : tasmlabel;
  455. i : longint;
  456. entry : PHashSetItem;
  457. begin
  458. location_reset_ref(location,LOC_CREFERENCE,OS_NO,const_align(8));
  459. lastlabel:=nil;
  460. { const already used ? }
  461. if not assigned(lab_set) then
  462. begin
  463. entry := current_asmdata.ConstPools[sp_varsets].FindOrAdd(value_set, 32);
  464. lab_set := TAsmLabel(entry^.Data); // is it needed anymore?
  465. { :-(, we must generate a new entry }
  466. if not assigned(entry^.Data) then
  467. begin
  468. current_asmdata.getdatalabel(lastlabel);
  469. lab_set:=lastlabel;
  470. entry^.Data:=lastlabel;
  471. maybe_new_object_file(current_asmdata.asmlists[al_typedconsts]);
  472. new_section(current_asmdata.asmlists[al_typedconsts],sec_rodata_norel,lastlabel.name,const_align(8));
  473. current_asmdata.asmlists[al_typedconsts].concat(Tai_label.Create(lastlabel));
  474. if (source_info.endian=target_info.endian) then
  475. for i:=0 to 31 do
  476. current_asmdata.asmlists[al_typedconsts].concat(Tai_const.Create_8bit(Psetbytes(value_set)^[i]))
  477. else
  478. for i:=0 to 31 do
  479. current_asmdata.asmlists[al_typedconsts].concat(Tai_const.Create_8bit(reverse_byte(Psetbytes(value_set)^[i])));
  480. end;
  481. end;
  482. location.reference.symbol:=lab_set;
  483. end;
  484. begin
  485. adjustforsetbase;
  486. { small sets are loaded as constants }
  487. if is_smallset(resultdef) then
  488. smallsetconst
  489. else
  490. handlevarsetconst;
  491. end;
  492. {*****************************************************************************
  493. TCGNILNODE
  494. *****************************************************************************}
  495. procedure tcgnilnode.pass_generate_code;
  496. begin
  497. location_reset(location,LOC_CONSTANT,OS_ADDR);
  498. location.value:=0;
  499. end;
  500. {*****************************************************************************
  501. TCGGUIDCONSTNODE
  502. *****************************************************************************}
  503. procedure tcgguidconstnode.pass_generate_code;
  504. var
  505. lastlabel : tasmlabel;
  506. i : longint;
  507. entry : PHashSetItem;
  508. begin
  509. location_reset_ref(location,LOC_CREFERENCE,OS_NO,const_align(16));
  510. lastlabel:=nil;
  511. { const already used ? }
  512. if not assigned(lab_set) then
  513. begin
  514. entry := current_asmdata.ConstPools[sp_guids].FindOrAdd(@value,sizeof(value));
  515. lab_set := TAsmLabel(entry^.Data); // is it needed anymore?
  516. { :-(, we must generate a new entry }
  517. if not assigned(entry^.Data) then
  518. begin
  519. current_asmdata.getdatalabel(lastlabel);
  520. lab_set:=lastlabel;
  521. entry^.Data:=lastlabel;
  522. maybe_new_object_file(current_asmdata.asmlists[al_typedconsts]);
  523. new_section(current_asmdata.asmlists[al_typedconsts],sec_rodata_norel,lastlabel.name,const_align(16));
  524. current_asmdata.asmlists[al_typedconsts].concat(Tai_label.Create(lastlabel));
  525. current_asmdata.asmlists[al_typedconsts].concat(Tai_const.Create_32bit(longint(value.D1)));
  526. current_asmdata.asmlists[al_typedconsts].concat(Tai_const.Create_16bit(value.D2));
  527. current_asmdata.asmlists[al_typedconsts].concat(Tai_const.Create_16bit(value.D3));
  528. for i:=low(value.D4) to high(value.D4) do
  529. current_asmdata.asmlists[al_typedconsts].concat(Tai_const.Create_8bit(value.D4[i]));
  530. end;
  531. end;
  532. location.reference.symbol:=lab_set;
  533. end;
  534. begin
  535. cdataconstnode:=tcgdataconstnode;
  536. crealconstnode:=tcgrealconstnode;
  537. cordconstnode:=tcgordconstnode;
  538. cpointerconstnode:=tcgpointerconstnode;
  539. cstringconstnode:=tcgstringconstnode;
  540. csetconstnode:=tcgsetconstnode;
  541. cnilnode:=tcgnilnode;
  542. cguidconstnode:=tcgguidconstnode;
  543. end.