Skip to content

Commit 95881a0

Browse files
merge 2.50
1 parent 25d2eab commit 95881a0

28 files changed

+382
-1548
lines changed

H/codegenv2.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#pragma once
22

33
#include "globals.h"
4-
#include "parser.h"
54
#include "expreval.h"
65

76
/* This order must remain as-is! */
@@ -178,10 +177,10 @@ enum op_type {
178177
#define VEX_WIG (1<<1) /* Instruction can use C5h(2byte) form (if no VEX.mmmmm) or VEX.W is ignored in C4H(3byte) form */
179178
#define VEX_W0 (1<<2) /* VEX.W = 0, extended opcode bit, or promotion to 64bit of gp register or memory operand */
180179
#define VEX_W1 (1<<3) /* "" */
181-
#define VEX_66 (1<<4)
180+
#define VEX_66 (1<<4)
182181
#define VEX_F2 (1<<5)
183182
#define VEX_F3 (1<<6)
184-
#define VEX_0F (1<<7)
183+
#define VEX_0F (1<<7)
185184
#define VEX_0F3A (1<<8)
186185
#define VEX_0F38 (1<<9)
187186
#define VEX_LIG (1<<10)
@@ -374,16 +373,16 @@ extern struct Instr_Def InstrTableV2[];
374373

375374
/* Public functions */
376375
extern void BuildInstructionTable(void);
377-
extern ret_code CodeGenV2(const char* instr, struct code_info* CodeInfo, uint_32 oldofs, uint_32 opCount, struct expr opExpr[4]);
376+
extern ret_code CodeGenV2(const char* instr, struct code_info *CodeInfo, uint_32 oldofs, uint_32 opCount, struct expr opExpr[4]);
378377

379378
/* Private functions */
380379
enum op_type DemoteOperand(enum op_type op);
381380
void InsertInstruction(struct Instr_Def* pInstruction, uint_32 hash);
382381
struct Instr_Def* AllocInstruction();
383382
uint_32 GenerateInstrHash(struct Instr_Def* pInstruction);
384383
struct Instr_Def* LookupInstruction(struct Instr_Def* instr, bool memReg, unsigned char encodeMode,
385-
int srcRegNo, int dstRegNo, struct code_info* CodeInfo);
386-
enum op_type MatchOperand(struct code_info* CodeInfo, struct opnd_item op, struct expr opExpr);
384+
int srcRegNo, int dstRegNo, struct code_info *CodeInfo);
385+
enum op_type MatchOperand(struct code_info *CodeInfo, struct opnd_item op, struct expr opExpr);
387386

388387
bool Require_OPND_Size_Override(struct Instr_Def* instr, struct code_info* CodeInfo);
389388
bool Require_ADDR_Size_Override(struct Instr_Def* instr, struct code_info* CodeInfo);

H/fastpass.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ struct equ_item {
2929

3030
struct line_item {
3131
struct line_item *next;
32-
uint_32 lineno;
33-
uint_32 srcfile;
34-
uint_32 macro_level;
32+
uint_32 lineno:20, srcfile:12;
3533
uint_32 list_pos; /* position .LST file */
3634
char line[1];
3735
};

H/globals.h

Lines changed: 11 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -65,20 +65,6 @@
6565

6666
#endif
6767

68-
#if !(NOINCREASEDMAXLINELEN)
69-
#define MAX_LINE_LEN 25600 /* no restriction for this number */
70-
#define MAX_TOKEN MAX_LINE_LEN - 32 /* max tokens in one line */
71-
#define MAX_STRING_LEN MAX_LINE_LEN - 32 /* must be < MAX_LINE_LEN */
72-
#define MAX_ID_LEN MAX_LINE_LEN - 32 /*247*/ /* must be < MAX_LINE_LEN */
73-
#define MAX_STRUCT_ALIGN 64
74-
#define MAX_SEGMENT_ALIGN 4096 /* maximum alignment/packing setting for segments */
75-
#define MAX_IF_NESTING 32 /* IFxx block nesting. Must be <=32, see condasm.c */
76-
#define MAX_SEG_NESTING 32 /* limit for segment nesting */
77-
#define MAX_MACRO_NESTING 200 /* macro call nesting */
78-
#define MAX_STRUCT_NESTING 32 /* limit for "anonymous structs" only */
79-
#define MAX_LNAME 255 /* OMF lnames - length must fit in 1 byte */
80-
#define LNAME_NULL 0 /* OMF first entry in lnames array */
81-
#else
8268
#define MAX_LINE_LEN 1024 /* no restriction for this number */
8369
#define MAX_TOKEN MAX_LINE_LEN - 32 /* max tokens in one line */
8470
#define MAX_STRING_LEN MAX_LINE_LEN - 32 /* must be < MAX_LINE_LEN */
@@ -91,7 +77,6 @@
9177
#define MAX_STRUCT_NESTING 32 /* limit for "anonymous structs" only */
9278
#define MAX_LNAME 255 /* OMF lnames - length must fit in 1 byte */
9379
#define LNAME_NULL 0 /* OMF first entry in lnames array */
94-
#endif
9580

9681
/* output format switches */
9782
#ifndef BIN_SUPPORT
@@ -137,16 +122,12 @@
137122
#define AMD64_SUPPORT 1 /* 1=support 64bit */
138123
#endif
139124

140-
#ifndef SYSV_SUPPORT
141-
#define SYSV_SUPPORT 1 /* 1=support 64bit */
142-
#endif
143-
144-
#ifndef DELPHI_SUPPORT
145-
#define DELPHI_SUPPORT 1 /* 1=support 64bit */
125+
#ifndef SYSV_SUPPORT
126+
#define SYSV_SUPPORT 1 /* 1=support 64bit */
146127
#endif
147128

148-
#ifndef REGCALL_SUPPORT
149-
#define REGCALL_SUPPORT 1 /* 1=support 64bit */
129+
#ifndef DELPHI_SUPPORT
130+
#define DELPHI_SUPPORT 1 /* 1=support 64bit */
150131
#endif
151132

152133
#ifndef VMXSUPP
@@ -328,10 +309,8 @@ enum lang_type {
328309
LANG_BASIC = 6,
329310
LANG_FASTCALL = 7,
330311
LANG_VECTORCALL = 8,
331-
LANG_SYSVCALL = 9,
332-
LANG_REGCALL = 10,
333-
LANG_THISCALL = 11,
334-
LANG_DELPHICALL = 12 //
312+
LANG_SYSVCALL = 9,
313+
LANG_DELPHICALL = 10
335314
};
336315

337316
/* Memory model type.
@@ -517,23 +496,8 @@ enum stdcall_decoration {
517496
enum vectorcall_decoration
518497
{
519498
VECTORCALL_FULL,
520-
VECTORCALL_NONE
521-
};
522-
523-
enum regcall_decoration
524-
{
525-
REGCALL_FULL,
526-
REGCALL_NONE
527-
};
528-
529-
enum regcall_version
530-
{
531-
RGCV_0,
532-
RGCV_1, /* 1 */
533-
RGCV_2, /* 2 */
534-
RGCV_3, /* 3 */
535-
RGCV_4, /* 4 */
536-
RGCV_5 /* 5 */
499+
VECTORCALL_NONE,
500+
VECTORCALL_HALF
537501
};
538502

539503
struct qitem {
@@ -694,13 +658,11 @@ struct global_options {
694658
#endif
695659
bool no_cdecl_decoration; /* -zcw & -zcm option */
696660
uint_8 stdcall_decoration; /* -zt<0|1|2> option */
697-
uint_8 vectorcall_decoration; /* -zv<0|1> option */
698-
uint_8 regcall_decoration; /* -ze<0|1> option */
699-
uint_8 regcall_version; /* -Ge<0|1|2|3|4|5> option */
661+
uint_8 vectorcall_decoration; /* -zv<0|1|2> option */
700662
bool no_export_decoration; /* -zze option */
701663
bool entry_decorated; /* -zzs option */
702664
bool write_listing; /* -Fl option */
703-
bool dumpSymbols; /* -Fs option */
665+
bool dumpSymbols; /* -Fs option */
704666
bool write_impdef; /* -Fd option */
705667
bool case_sensitive; /* -C<p|x|u> options */
706668
bool convert_uppercase; /* -C<p|x|u> options */
@@ -720,7 +682,7 @@ struct global_options {
720682
enum oformat output_format; /* -bin, -omf, -coff, -elf options */
721683
enum sformat sub_format; /* -mz, -pe, -win64, -elf64 options */
722684
uint_8 fieldalign; /* -Zp option */
723-
enum lang_type langtype; /* -G<c|d|r|z|v|y|e|t> "Use Pascal, C, Fastcall, Stdcall, Vectorcall, SystemV, Regcall, Thiscall calling convention */
685+
enum lang_type langtype; /* -Gc|d|z option */
724686
enum model_type model; /* -mt|s|m|c|l|h|f option */
725687
enum cpu_info cpu; /* -0|1|2|3|4|5|6 & -fp{0|2|3|5|6|c} option */
726688
enum fastcall_type fctype; /* -zf0 & -zf1 option */

H/ltext.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ ltext(BASIC, "BASIC")
6565
ltext(FASTCALL, "FASTCALL")
6666
ltext(VECTORCALL, "VECTORCALL")
6767
ltext(SYSVCALL, "SYSVCALL")
68-
ltext(REGCALL, "REGCALL")
69-
ltext(THISCALL, "THISCALL")
7068
ltext(DELPHICALL, "DELPHICALL")
7169

7270
ltext(TXT_MACROS, "Macros:")

H/memalloc.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,7 @@ extern void MemFree( void *ptr );
4646

4747
#elif defined(__GNUC__) || defined(__TINYC__)
4848

49-
#ifndef alloca
5049
#define alloca(x) __builtin_alloca(x)
51-
#endif
5250

5351
#define myalloca alloca
5452
#ifndef __FreeBSD__ /* added v2.08 */

H/opndcls.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,10 +236,8 @@ OpCls(XMM, XMM_M128_M32, NONE ) //VGETEXPPS
236236
OpCls(XMM, XMM_M128_M64, NONE ) //VGETEXPPD
237237
OpCls(XMM, XMM, XMM_M128 )
238238
OpCls( XMM, R32_M32, NONE )
239-
#if !INTELMOVQ
240239
OpCls( R32_M32, XMM, NONE )
241240
OpCls( R64_M64, XMM, NONE )
242-
#endif
243241
OpCls( XMM_M_ANY, XMM, NONE )
244242
OpCls( R64, XMM_M64, NONE )
245243
OpCls( R32, XMM_M64, NONE )

H/special.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,8 +385,6 @@ res(FASTCALL, fastcall, RWT_RES_ID, 0, LANG_FASTCALL, 0, P_64, 0)
385385
res(VECTORCALL, vectorcall, RWT_RES_ID, 0, LANG_VECTORCALL, 0, P_64, 0)
386386
/* 2.24 system v and delphi 32 */
387387
res(SYSVCALL, systemv, RWT_RES_ID, 0, LANG_SYSVCALL, 0, P_64, 0)
388-
res(REGCALL, regcall, RWT_RES_ID, 0, LANG_REGCALL, 0, P_64, 0)
389-
res(THISCALL, thiscall, RWT_RES_ID, 0, LANG_THISCALL, 0, P_64, 0)
390388
res(BORLAND, borland, RWT_RES_ID, 0, LANG_DELPHICALL, 0, P_86, 0)
391389
/* 2.46.9 support VOID return type */
392390
res(VOIDARG, voidarg, RWT_RES_ID, 0, 0, 0, P_86, 0)

H/symbols.h

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -373,17 +373,12 @@ struct proc_info {
373373
unsigned parasize; /* total no. of bytes used by parameters */
374374
unsigned localsize; /* PROC: total no. of bytes used by local variables */
375375
unsigned locals;
376-
unsigned vsize;
376+
unsigned vsize;
377377
char *prologuearg; /* PROC: prologuearg attribute */
378378
unsigned char vecregs[6];
379379
unsigned char vecregsize[6];
380380
unsigned char vregs[6];
381381
unsigned char xyzused[6];
382-
unsigned regcsize;
383-
unsigned char regcregs[16];
384-
unsigned char regcregsize[16];
385-
unsigned char rgcregs[16];
386-
unsigned char regcxyzused[16];
387382
unsigned char delregsused[3]; /* added for delphi used registers v.29 */
388383
unsigned char vecused;
389384

@@ -404,11 +399,10 @@ struct proc_info {
404399
struct asym *exc_handler; /* PROC: exc handler set by FRAME */
405400
int ReservedStack; /* PROC: win64: additional reserved stack */
406401
int stored_reg; /* number of stored general registers in home spaces */
407-
int pushed_reg; /* number of pushed registers */
402+
int pushed_reg; /* number of pushed registers */
408403
int home_taken; /* number of taken spaces in a home space */
409404
int xmmsize; /* size of saved xmm registers */
410-
char home_used[6]; /* used shadows home space */
411-
char regcallmshome_used[16]; /* used shadows home space */
405+
char home_used[6]; /* used shadows home space */
412406
#endif
413407
uint_32 prolog_list_pos;/* PROC: prologue list pos */
414408
union {

H/types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
/* prototypes of TYPES.C */
33

4-
#ifndef _TYPES_H_INCLUDED_
4+
#ifndef _TYPES_H_INCLUDED
55
#define _TYPES_H_INCLUDED_
66

77
/* qualified_type us used for parsing a qualified type. */

H/usage.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"-FPi87\0" "80x87 instructions (default)\0"
2929
"-fpc\0" "Disallow floating-point instructions (.NO87)\0"
3030
"-fp<n>\0" "Set FPU, <n> is: 0=8087 (default), 2=80287, 3=80387\0"
31-
"-G<c|d|r|z|v|y|e|t>\0" "Use Pascal, C, Fastcall, Stdcall, Vectorcall, SystemV, Regcall, Thiscall calling convention\0"
31+
"-G<c|d|r|z>\0" "Use Pascal, C, Fastcall or Stdcall calling convention\0"
3232
"-I<directory>\0" "Add directory to list of include directories\0"
3333
"-m<t|s|c|m|l|h|f>\0" "Set memory model:\0"
3434
"\0" "(Tiny, Small, Compact, Medium, Large, Huge, Flat)\0"
@@ -76,9 +76,8 @@
7676
"-Zs\0" "Perform syntax check only\0"
7777
"-zt<0|1|2>\0" "Set STDCALL symbol decoration: 0=No name decoration,\0"
7878
"\0" "1=No '@size' suffix for functions, 2=Full (default)\0"
79-
"-zv<0|1>\0" "Set VECTORCALL symbol decoration: 0=No name decoration\0"
80-
"-ze<0|1>\0" "Set REGCALL symbol decoration: 0=No name decoration\0"
81-
"-ge<0|1|2|3|4|5>\0" "Set REGCALL version number\0"
79+
"-zv<0|1|2>\0" "Set VECTORCALL symbol decoration: 0=No name decoration,\0"
80+
"\0" "1=No '@size' suffix for functions, 2=Full (default)\0"
8281
"-Zv8\0" "Enable Masm v8+ PROC visibility\0"
8382
"-zze\0" "No name decoration for exported symbols\0"
8483
#if COFF_SUPPORT

0 commit comments

Comments
 (0)