cpubase.pas 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673
  1. {
  2. Copyright (c) 1998-2012 by Florian Klaempfl and Peter Vreman
  3. Copyright (c) 2014 by Jonas Maebe and Florian Klaempfl
  4. Contains the base types for Aarch64
  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. { Base unit for processor information. This unit contains
  19. enumerations of registers, opcodes, sizes, and other
  20. such things which are processor specific.
  21. }
  22. unit cpubase;
  23. {$define USEINLINE}
  24. {$i fpcdefs.inc}
  25. interface
  26. uses
  27. cutils,cclasses,
  28. globtype,globals,
  29. cpuinfo,
  30. aasmbase,
  31. cgbase
  32. ;
  33. {*****************************************************************************
  34. Assembler Opcodes
  35. *****************************************************************************}
  36. type
  37. TAsmOp= {$i a64op.inc}
  38. TAsmOps = set of TAsmOp;
  39. { This should define the array of instructions as string }
  40. op2strtable=array[tasmop] of string[11];
  41. const
  42. { First value of opcode enumeration }
  43. firstop = low(tasmop);
  44. { Last value of opcode enumeration }
  45. lastop = high(tasmop);
  46. {*****************************************************************************
  47. Registers
  48. *****************************************************************************}
  49. type
  50. { Number of registers used for indexing in tables }
  51. tregisterindex=0..{$i ra64nor.inc}-1;
  52. const
  53. { Available Superregisters }
  54. {$i ra64sup.inc}
  55. RS_IP0 = RS_X16;
  56. RS_IP1 = RS_X17;
  57. R_SUBWHOLE = R_SUBQ;
  58. { Available Registers }
  59. {$i ra64con.inc}
  60. NR_IP0 = NR_X16;
  61. NR_IP1 = NR_X17;
  62. { Integer Super registers first and last }
  63. first_int_supreg = RS_X0;
  64. { xzr and sp take up a separate super register because some instructions
  65. are ambiguous otherwise }
  66. first_int_imreg = $21;
  67. { Integer Super registers first and last }
  68. first_fpu_supreg = RS_S0;
  69. first_fpu_imreg = $20;
  70. { MM Super register first and last }
  71. first_mm_supreg = RS_S0;
  72. first_mm_imreg = $20;
  73. { Required parameter alignment when calling a routine declared as
  74. stdcall and cdecl. The alignment value should be the one defined
  75. by GCC or the target ABI.
  76. The value of this constant is equal to the constant
  77. PARM_BOUNDARY / BITS_PER_UNIT in the GCC source.
  78. }
  79. std_param_align = 8;
  80. { TODO: Calculate bsstart}
  81. regnumber_count_bsstart = 256;
  82. regnumber_table : array[tregisterindex] of tregister = (
  83. {$i ra64num.inc}
  84. );
  85. regstabs_table : array[tregisterindex] of shortint = (
  86. {$i ra64sta.inc}
  87. );
  88. regdwarf_table : array[tregisterindex] of shortint = (
  89. {$i ra64dwa.inc}
  90. );
  91. { registers which may be destroyed by calls }
  92. VOLATILE_INTREGISTERS = [RS_X0..RS_X18,RS_X30];
  93. VOLATILE_MMREGISTERS = [RS_D0..RS_D7,RS_D16..RS_D31];
  94. {*****************************************************************************
  95. Instruction post fixes
  96. *****************************************************************************}
  97. type
  98. { ARM instructions load/store and arithmetic instructions
  99. can have several instruction post fixes which are collected
  100. in this enumeration
  101. }
  102. TOpPostfix = (PF_None,
  103. { update condition flags }
  104. PF_S,
  105. { load/store sizes }
  106. PF_B,PF_SB,PF_H,PF_SH,PF_W,PF_SW
  107. );
  108. TOpPostfixes = set of TOpPostfix;
  109. const
  110. tcgsizep2size: array[OS_NO..OS_F128] of byte =
  111. {OS_NO }
  112. (0,
  113. {OS_8,OS_16,OS_32,OS_64,OS_128,OS_S8,OS_S16,OS_S32,OS_S64,OS_S128}
  114. 0, 1, 2, 3, 4, 0, 1, 2, 3, 4,
  115. {OS_F32,OS_F64,OS_F80,OS_C64,OS_F128,}
  116. 2, 3, 0, 3, 4);
  117. oppostfix2str: array[TOpPostfix] of string[2] = ('',
  118. 's',
  119. 'b','sb','h','sh','w','sw');
  120. {*****************************************************************************
  121. Conditions
  122. *****************************************************************************}
  123. type
  124. TAsmCond=(C_None,
  125. C_EQ,C_NE,C_HS,C_LO,C_MI,C_PL,C_VS,C_VC,C_HI,C_LS,
  126. C_GE,C_LT,C_GT,C_LE,C_AL,C_NV
  127. );
  128. TAsmConds = set of TAsmCond;
  129. const
  130. C_CS = C_HS;
  131. C_CC = C_LO;
  132. cond2str : array[TAsmCond] of string[2]=('',
  133. 'eq','ne','hs','lo','mi','pl','vs','vc','hi','ls',
  134. 'ge','lt','gt','le','al','nv'
  135. );
  136. uppercond2str : array[TAsmCond] of string[2]=('',
  137. 'EQ','NE','HS','LO','MI','PL','VS','VC','HI','LS',
  138. 'GE','LT','GT','LE','AL','NV'
  139. );
  140. {*****************************************************************************
  141. Flags
  142. *****************************************************************************}
  143. type
  144. TResFlags = (F_EQ,F_NE,F_CS,F_CC,F_MI,F_PL,F_VS,F_VC,F_HI,F_LS,
  145. F_GE,F_LT,F_GT,F_LE);
  146. const
  147. F_HS = F_CS;
  148. F_LO = F_CC;
  149. {*****************************************************************************
  150. Operands
  151. *****************************************************************************}
  152. type
  153. taddressmode = (AM_OFFSET,AM_PREINDEXED,AM_POSTINDEXED);
  154. tshiftmode = (SM_None,
  155. { shifted register instructions. LSL can also be used for
  156. the index register of certain loads/stores }
  157. SM_LSL,SM_LSR,SM_ASR,SM_ROR,
  158. { extended register instructions: zero/sign extension +
  159. optional shift (interpreted as LSL after extension)
  160. -- the index register of certain loads/stores can be
  161. extended via (s|u)xtw with a shiftval of either 0 or
  162. log2(transfer size of the load/store)
  163. }
  164. SM_UXTB,SM_UXTH,SM_UXTW,SM_UXTX,SM_SXTB,SM_SXTH,SM_SXTW,SM_SXTX);
  165. tupdatereg = (UR_None,UR_Update);
  166. pshifterop = ^tshifterop;
  167. tshifterop = record
  168. shiftmode : tshiftmode;
  169. shiftimm : byte;
  170. end;
  171. {*****************************************************************************
  172. Constants
  173. *****************************************************************************}
  174. const
  175. max_operands = 6;
  176. maxintregs = 32;
  177. maxfpuregs = 32;
  178. maxaddrregs = 0;
  179. shiftedregmodes = [SM_LSL,SM_UXTB,SM_UXTH,SM_UXTW,SM_UXTX,SM_SXTB,SM_SXTH,SM_SXTW,SM_SXTX];
  180. extendedregmodes = [SM_LSL,SM_LSR,SM_ASR];
  181. {*****************************************************************************
  182. Operand Sizes
  183. *****************************************************************************}
  184. type
  185. topsize = (S_NO,
  186. S_B,S_W,S_L,S_BW,S_BL,S_WL,
  187. S_IS,S_IL,S_IQ,
  188. S_FS,S_FL,S_FX,S_D,S_Q,S_FV,S_FXX
  189. );
  190. {*****************************************************************************
  191. Default generic sizes
  192. *****************************************************************************}
  193. const
  194. { Defines the default address size for a processor, }
  195. OS_ADDR = OS_64;
  196. { the natural int size for a processor,
  197. has to match osuinttype/ossinttype as initialized in psystem }
  198. OS_INT = OS_64;
  199. OS_SINT = OS_S64;
  200. { the maximum float size for a processor, }
  201. OS_FLOAT = OS_F64;
  202. { the size of a vector register for a processor }
  203. OS_VECTOR = OS_M128;
  204. {*****************************************************************************
  205. Generic Register names
  206. *****************************************************************************}
  207. NR_FP = NR_X29;
  208. RS_FP = RS_X29;
  209. NR_WFP = NR_W29;
  210. RS_WFP = RS_W29;
  211. NR_LR = NR_X30;
  212. RS_LR = RS_X30;
  213. NR_WLR = NR_W30;
  214. RS_WLR = RS_W30;
  215. { Stack pointer register }
  216. NR_STACK_POINTER_REG = NR_SP;
  217. RS_STACK_POINTER_REG = RS_SP;
  218. { Frame pointer register }
  219. NR_FRAME_POINTER_REG = NR_X29;
  220. RS_FRAME_POINTER_REG = RS_X29;
  221. { Register for addressing absolute data in a position independant way,
  222. such as in PIC code. The exact meaning is ABI specific. For
  223. further information look at GCC source : PIC_OFFSET_TABLE_REGNUM
  224. }
  225. NR_PIC_OFFSET_REG = NR_X18;
  226. { Results are returned in this register (32-bit values) }
  227. NR_FUNCTION_RETURN_REG = NR_X0;
  228. RS_FUNCTION_RETURN_REG = RS_X0;
  229. { The value returned from a function is available in this register }
  230. NR_FUNCTION_RESULT_REG = NR_FUNCTION_RETURN_REG;
  231. RS_FUNCTION_RESULT_REG = RS_FUNCTION_RETURN_REG;
  232. NR_FPU_RESULT_REG = NR_NO;
  233. NR_MM_RESULT_REG = NR_D0;
  234. NR_RETURN_ADDRESS_REG = NR_FUNCTION_RETURN_REG;
  235. { Offset where the parent framepointer is pushed }
  236. PARENT_FRAMEPOINTER_OFFSET = 0;
  237. NR_DEFAULTFLAGS = NR_NZCV;
  238. RS_DEFAULTFLAGS = RS_NZCV;
  239. {*****************************************************************************
  240. Helpers
  241. *****************************************************************************}
  242. { Returns the tcgsize corresponding with the size of reg.}
  243. function reg_cgsize(const reg: tregister) : tcgsize;
  244. function cgsize2subreg(regtype: tregistertype; s:Tcgsize):Tsubregister;
  245. function is_calljmp(o:tasmop):boolean;{$ifdef USEINLINE}inline;{$endif USEINLINE}
  246. procedure inverse_flags(var f: TResFlags);
  247. function flags_to_cond(const f: TResFlags) : TAsmCond;
  248. function findreg_by_number(r:Tregister):tregisterindex;
  249. function std_regnum_search(const s:string):Tregister;
  250. function std_regname(r:Tregister):string;
  251. function inverse_cond(const c: TAsmCond): TAsmCond; {$ifdef USEINLINE}inline;{$endif USEINLINE}
  252. function conditions_equal(const c1, c2: TAsmCond): boolean; {$ifdef USEINLINE}inline;{$endif USEINLINE}
  253. { Checks if Subset is a subset of c (e.g. "less than" is a subset of "less than or equal" }
  254. function condition_in(const Subset, c: TAsmCond): Boolean;
  255. procedure shifterop_reset(var so : tshifterop); {$ifdef USEINLINE}inline;{$endif USEINLINE}
  256. function dwarf_reg(r:tregister):shortint;
  257. function dwarf_reg_no_error(r:tregister):shortint;
  258. function eh_return_data_regno(nr: longint): longint;
  259. function is_shifter_const(d: aint; size: tcgsize): boolean;
  260. function IsFloatImmediate(ft : tfloattype;value : bestreal) : boolean;
  261. implementation
  262. uses
  263. systems,rgBase,verbose;
  264. const
  265. std_regname_table : TRegNameTable = (
  266. {$i ra64std.inc}
  267. );
  268. regnumber_index : array[tregisterindex] of tregisterindex = (
  269. {$i ra64rni.inc}
  270. );
  271. std_regname_index : array[tregisterindex] of tregisterindex = (
  272. {$i ra64sri.inc}
  273. );
  274. function cgsize2subreg(regtype: tregistertype; s:Tcgsize):Tsubregister;
  275. begin
  276. case regtype of
  277. R_INTREGISTER:
  278. begin
  279. case s of
  280. { there's only Wn and Xn }
  281. OS_64,
  282. OS_S64:
  283. cgsize2subreg:=R_SUBWHOLE;
  284. else
  285. cgsize2subreg:=R_SUBD;
  286. end;
  287. end;
  288. R_MMREGISTER:
  289. begin
  290. case s of
  291. { records }
  292. OS_32,
  293. OS_F32:
  294. cgsize2subreg:=R_SUBMMS;
  295. OS_64,
  296. OS_F64:
  297. cgsize2subreg:=R_SUBMMD;
  298. else
  299. internalerror(2009112701);
  300. end;
  301. end;
  302. else
  303. cgsize2subreg:=R_SUBWHOLE;
  304. end;
  305. end;
  306. function reg_cgsize(const reg: tregister): tcgsize;
  307. begin
  308. case getregtype(reg) of
  309. R_INTREGISTER:
  310. case getsubreg(reg) of
  311. R_SUBD:
  312. result:=OS_32
  313. else
  314. result:=OS_64;
  315. end;
  316. R_MMREGISTER :
  317. begin
  318. case getsubreg(reg) of
  319. R_SUBMMD:
  320. result:=OS_F64;
  321. R_SUBMMS:
  322. result:=OS_F32;
  323. R_SUBMMWHOLE:
  324. result:=OS_M128;
  325. else
  326. internalerror(2009112903);
  327. end;
  328. end;
  329. else
  330. internalerror(200303181);
  331. end;
  332. end;
  333. function is_calljmp(o:tasmop):boolean;{$ifdef USEINLINE}inline;{$endif USEINLINE}
  334. begin
  335. is_calljmp:=o in [A_B,A_BL,A_BLR,A_RET,A_CBNZ,A_CBZ,A_TBNZ,A_TBZ];
  336. end;
  337. procedure inverse_flags(var f: TResFlags);
  338. const
  339. inv_flags: array[TResFlags] of TResFlags =
  340. (F_NE,F_EQ,F_CC,F_CS,F_PL,F_MI,F_VC,F_VS,F_LS,F_HI,
  341. F_LT,F_GE,F_LE,F_GT);
  342. begin
  343. f:=inv_flags[f];
  344. end;
  345. function flags_to_cond(const f: TResFlags) : TAsmCond;
  346. const
  347. flag_2_cond: array[TResFlags] of TAsmCond =
  348. (C_EQ,C_NE,C_HS,C_LO,C_MI,C_PL,C_VS,C_VC,C_HI,C_LS,
  349. C_GE,C_LT,C_GT,C_LE);
  350. begin
  351. if f>high(flag_2_cond) then
  352. internalerror(200112301);
  353. result:=flag_2_cond[f];
  354. end;
  355. function findreg_by_number(r:Tregister):tregisterindex;
  356. begin
  357. result:=rgBase.findreg_by_number_table(r,regnumber_index);
  358. end;
  359. function std_regnum_search(const s:string):Tregister;
  360. begin
  361. result:=regnumber_table[findreg_by_name_table(s,std_regname_table,std_regname_index)];
  362. end;
  363. function std_regname(r:Tregister):string;
  364. var
  365. p : tregisterindex;
  366. begin
  367. p:=findreg_by_number_table(r,regnumber_index);
  368. if p<>0 then
  369. result:=std_regname_table[p]
  370. else
  371. result:=generic_regname(r);
  372. end;
  373. procedure shifterop_reset(var so : tshifterop);{$ifdef USEINLINE}inline;{$endif USEINLINE}
  374. begin
  375. FillChar(so,sizeof(so),0);
  376. end;
  377. function inverse_cond(const c: TAsmCond): TAsmCond; {$ifdef USEINLINE}inline;{$endif USEINLINE}
  378. const
  379. inverse: array[TAsmCond] of TAsmCond=(C_None,
  380. C_NE,C_EQ,C_LO,C_HS,C_PL,C_MI,C_VC,C_VS,C_LS,C_HI,
  381. C_LT,C_GE,C_LE,C_GT,C_None,C_None
  382. );
  383. begin
  384. result := inverse[c];
  385. end;
  386. function conditions_equal(const c1, c2: TAsmCond): boolean; {$ifdef USEINLINE}inline;{$endif USEINLINE}
  387. begin
  388. result := c1 = c2;
  389. end;
  390. { Checks if Subset is a subset of c (e.g. "less than" is a subset of "less than or equal" }
  391. function condition_in(const Subset, c: TAsmCond): Boolean;
  392. begin
  393. Result := (c = C_None) or conditions_equal(Subset, c);
  394. { Please update as necessary. [Kit] }
  395. if not Result then
  396. case Subset of
  397. C_EQ:
  398. Result := (c in [C_GE, C_LE]);
  399. C_LT:
  400. Result := (c in [C_LE]);
  401. C_GT:
  402. Result := (c in [C_GE]);
  403. else
  404. Result := False;
  405. end;
  406. end;
  407. function dwarf_reg(r:tregister):shortint;
  408. begin
  409. result:=regdwarf_table[findreg_by_number(r)];
  410. if result=-1 then
  411. internalerror(200603251);
  412. end;
  413. function dwarf_reg_no_error(r:tregister):shortint;
  414. begin
  415. result:=regdwarf_table[findreg_by_number(r)];
  416. end;
  417. function is_shifter_const(d: aint; size: tcgsize): boolean;
  418. var
  419. pattern, checkpattern: qword;
  420. patternlen, maxbits, replicatedlen: longint;
  421. rightmostone, rightmostzero, checkbit, secondrightmostbit: longint;
  422. begin
  423. result:=false;
  424. { patterns with all bits 0 or 1 cannot be represented this way }
  425. if (d=0) then
  426. exit;
  427. case size of
  428. OS_64,
  429. OS_S64:
  430. begin
  431. if d=-1 then
  432. exit;
  433. maxbits:=64;
  434. end
  435. else
  436. begin
  437. if longint(d)=-1 then
  438. exit;
  439. { we'll generate a 32 bit pattern -> ignore upper sign bits in
  440. case of negative longint value }
  441. d:=cardinal(d);
  442. maxbits:=32;
  443. end;
  444. end;
  445. { "The Logical (immediate) instructions accept a bitmask immediate value
  446. that is a 32-bit pattern or a 64-bit pattern viewed as a vector of
  447. identical elements of size e = 2, 4, 8, 16, 32 or, 64 bits. Each
  448. element contains the same sub-pattern, that is a single run of
  449. 1 to (e - 1) nonzero bits from bit 0 followed by zero bits, then
  450. rotated by 0 to (e - 1) bits." (ARMv8 ARM)
  451. Rather than generating all possible patterns and checking whether they
  452. match our constant, we check whether the lowest 2/4/8/... bits are
  453. a valid pattern, and if so whether the constant consists of a
  454. replication of this pattern. Such a valid pattern has the form of
  455. either (regexp notation)
  456. * 1+0+1*
  457. * 0+1+0* }
  458. patternlen:=2;
  459. while patternlen<=maxbits do
  460. begin
  461. { try lowest <patternlen> bits of d as pattern }
  462. if patternlen<>64 then
  463. pattern:=qword(d) and ((qword(1) shl patternlen)-1)
  464. else
  465. pattern:=qword(d);
  466. { valid pattern? If it contains too many 1<->0 transitions, larger
  467. parts of d cannot be a valid pattern either }
  468. rightmostone:=BsfQWord(pattern);
  469. rightmostzero:=BsfQWord(not(pattern));
  470. { pattern all ones or zeroes -> not a valid pattern (but larger ones
  471. can still be valid, since we have too few transitions) }
  472. if (rightmostone<patternlen) and
  473. (rightmostzero<patternlen) then
  474. begin
  475. if rightmostone>rightmostzero then
  476. begin
  477. { we have .*1*0* -> check next zero position by shifting
  478. out the existing zeroes (shr rightmostone), inverting and
  479. then again looking for the rightmost one position }
  480. checkpattern:=not(pattern);
  481. checkbit:=rightmostone;
  482. end
  483. else
  484. begin
  485. { same as above, but for .*0*1* }
  486. checkpattern:=pattern;
  487. checkbit:=rightmostzero;
  488. end;
  489. secondrightmostbit:=BsfQWord(checkpattern shr checkbit)+checkbit;
  490. { if this position is >= patternlen -> ok (1 transition),
  491. otherwise we now have 2 transitions and have to check for a
  492. third (if there is one, abort)
  493. bsf returns 255 if no 1 bit is found, so in that case it's
  494. also ok
  495. }
  496. if secondrightmostbit<patternlen then
  497. begin
  498. secondrightmostbit:=BsfQWord(not(checkpattern) shr secondrightmostbit)+secondrightmostbit;
  499. if secondrightmostbit<patternlen then
  500. exit;
  501. end;
  502. { ok, this is a valid pattern, now does d consist of a
  503. repetition of this pattern? }
  504. replicatedlen:=patternlen;
  505. checkpattern:=pattern;
  506. while replicatedlen<maxbits do
  507. begin
  508. { douplicate current pattern }
  509. checkpattern:=checkpattern or (checkpattern shl replicatedlen);
  510. replicatedlen:=replicatedlen*2;
  511. end;
  512. if qword(d)=checkpattern then
  513. begin
  514. { yes! }
  515. result:=true;
  516. exit;
  517. end;
  518. end;
  519. patternlen:=patternlen*2;
  520. end;
  521. end;
  522. function eh_return_data_regno(nr: longint): longint;
  523. begin
  524. if (nr>=0) and (nr<2) then
  525. result:=nr
  526. else
  527. result:=-1;
  528. end;
  529. function IsFloatImmediate(ft : tfloattype;value : bestreal) : boolean;
  530. var
  531. singlerec : tcompsinglerec;
  532. doublerec : tcompdoublerec;
  533. begin
  534. Result:=false;
  535. case ft of
  536. s32real:
  537. begin
  538. singlerec.value:=value;
  539. singlerec:=tcompsinglerec(NtoLE(DWord(singlerec)));
  540. Result:=(singlerec.bytes[0]=0) and (singlerec.bytes[1]=0) and ((singlerec.bytes[2] and 7)=0) and
  541. (((singlerec.bytes[3] and $7e)=$40) or ((singlerec.bytes[3] and $7e)=$3e));
  542. end;
  543. s64real:
  544. begin
  545. doublerec.value:=value;
  546. doublerec:=tcompdoublerec(NtoLE(QWord(doublerec)));
  547. Result:=(doublerec.bytes[0]=0) and (doublerec.bytes[1]=0) and (doublerec.bytes[2]=0) and
  548. (doublerec.bytes[3]=0) and (doublerec.bytes[4]=0) and (doublerec.bytes[5]=0) and
  549. ((((doublerec.bytes[6] and $c0)=$0) and ((doublerec.bytes[7] and $7f)=$40)) or
  550. (((doublerec.bytes[6] and $c0)=$c0) and ((doublerec.bytes[7] and $7f)=$3f)));
  551. end;
  552. else
  553. ;
  554. end;
  555. end;
  556. end.