libcpu: Use "#define FCT_mod$64r_m FCT_mod$r_m" in i386_data.h
[platform/upstream/elfutils.git] / libcpu / ChangeLog
1 2022-10-21  Yonggang Luo  <luoyonggang@gmail.com>
2
3         * i386_data.h: Define FCT_mod$64r_m as FCT_mod$r_m for i386.
4
5 2022-10-21  Yonggang Luo  <luoyonggang@gmail.com>
6
7         * i386_disasm.c: Don't include endian.h.
8         * memory-access.h: Don't include byteswap.h and endian.h.
9         Do include system.h.
10
11 2022-09-20  Yonggang Luo  <luoyonggang@gmail.com>
12
13         * memory-access.h: Use BYTE_ORDER, LITTLE_ENDIAN and BIG_ENDIAN.
14         * riscv_disasm.c: Likewise.
15
16 2021-12-04  Mark Wielaard  <mark@klomp.org>
17
18         * Makefile.am (GENDIS_ENV): New variable, depends on
19         USE_ADDRESS_SANITIZER.
20
21 2020-12-20  Dmitry V. Levin  <ldv@altlinux.org>
22
23         * .gitignore: New file.
24
25 2020-12-16  Érico Nogueira  <ericonr@disroot.org>
26
27         * Makefile.am (i386_gendis_LDADD): Add obstack_LIBS.
28
29 2020-12-16  Dmitry V. Levin  <ldv@altlinux.org>
30
31         * i386_lex.l (invalid_char): Replace gettext(...) with _(...).
32         * i386_parse.y (yyerror): Likewise.
33
34 2020-12-12  Dmitry V. Levin  <ldv@altlinux.org>
35
36         * bpf_disasm.c (bswap_bpf_insn): Fix spelling typo in comment.
37         * i386_disasm.c (i386_disasm): Likewise.
38
39 2020-05-09  Mark Wielaard  <mark@klomp.org>
40
41         * i386_parse.y (new_bitfield): Call free newp on error.
42
43 2020-04-16  Mark Wielaard  <mark@klomp.org>
44
45         * i386_disasm.c (i386_disasm): Replace assert with goto invalid_op
46         for bad prefix.
47
48 2019-12-11  Omar Sandoval  <osandov@fb.com>
49
50         * Makefile.am (i386_lex_CFLAGS): Add -Wno-implicit-fallthrough.
51
52 2019-10-17  Mark Wielaard  <mark@klomp.org>
53
54         * i386_data.h (FCT_sel): Check for param_start + 2 >= end instead
55         of just >.
56         * i386_disasm.c (i386_disasm): Check param_start < end. Don't
57         assert, but assign INVALID to str. Make sure we get past any
58         unrecognized opcode.
59
60 2019-09-07  Mark Wielaard  <mark@klomp.org>
61
62         * riscv_disasm.c (riscv_disasm): Use UINT64_C to make calculation
63         unsigned.
64
65 2019-07-05  Omar Sandoval  <osandov@fb.com>
66
67         * Makefile.am: Combine libcpu_{i386,x86_64,bpf}.a into libcpu.a.
68         Make libcpu.a non-PIC by default.
69         Add libcpu_pic.a.
70
71 2018-11-04  Mark Wielaard  <mark@klomp.org>
72
73         * bpf_disasm.c (bpf_disasm): Recognize BPF_JLT, BPF_JLE, BPF_JSLT
74         and BPF_JSLE.
75
76 2018-02-09  Joshua Watt  <JPEWhacker@gmail.com>
77
78         * i386_disasm.c (i386_disasm): Use FALLTHOUGH macro instead of
79         comment.
80
81 2017-08-18  Ulf Hermann  <ulf.hermann@qt.io>
82
83         * memory-access.h: Use attribute_packed.
84
85 2017-02-27  Ulf Hermann  <ulf.hermann@qt.io>
86
87         * Makefile.am: Use fpic_CFLAGS.
88
89 2017-07-18  Mark Wielaard  <mark@klomp.org>
90
91         * Makefile.am: Don't check HAVE_LINUX_BPF_H, just define libcpu_bpf.
92         * bpf_disasm.c: Include bpf.h instead of linux/bpf.h. Don't define
93         BPF_PSEUDO_MAP_FD.
94
95 2017-04-20  Ulf Hermann <ulf.hermann@qt.io>
96
97         * Makefile.am: Add EXEEXT to gendis.
98
99 2017-04-20  Ulf Hermann  <ulf.hermann@qt.io>
100
101         * i386_parse.y: Eliminate comparison_fn_t.
102
103 2016-11-02  Mark Wielaard  <mjw@redhat.com>
104
105         * i386_disasm.c (i386_disasm): Add fallthrough comment.
106
107 2016-10-11  Akihiko Odaki  <akihiko.odaki.4i@stu.hosei.ac.jp>
108
109         * i386_lex.l: Remove system.h include, add libeu.h include.
110         * i386_parse.y: Remove sys/param.h include, add libeu.h include.
111         * i386_disasm.c: Remove sys/param.h.
112
113 2016-09-05  Mark Wielaard  <mjw@redhat.com>
114
115         * bpf_disasm.c: Define BPF_PSEUDO_MAP_FD if undefined.
116
117 2016-08-10  Richard Henderson  <rth@redhat.com>
118
119         * bpf_disasm.c (bpf_disasm): Rearrange the printing of instructions
120         to use exactly the operands required.
121
122 2016-06-28  Richard Henderson  <rth@redhat.com>
123
124         * Makefile.am (noinst_LIBRARIES): Add libcpu_bpf.a.
125         (libcpu_bpf_a_SOURCES, libcpu_bpf_a_CFLAGS): New.
126         * bpf_disasm.c: New file.
127         * i386_disasm.c (i386_disasm): Add ebl parameter.
128
129 2015-10-05  Josh Stone  <jistone@redhat.com>
130
131         * Makefile.am (%_defs): Add AM_V_GEN and AM_V_at silencers.
132         ($(srcdir)/%_dis.h): Ditto.
133         (%.mnemonics): Add AM_V_GEN silencer.
134
135 2014-10-29  Jose E. Marchesi  <jose.marchesi@oracle.com>
136
137         * Makefile.am (AM_CFLAGS): Use -fPIC instead of -fpic to avoid
138         relocation overflows in some platforms.
139
140 2014-04-13  Mark Wielaard  <mjw@redhat.com>
141
142         * Makefile.am (i386_gendis_LDADD): Remove libmudflap.
143
144 2013-04-24  Mark Wielaard  <mjw@redhat.com>
145
146         * Makefile.am: Use AM_CPPFLAGS instead of INCLUDES.
147
148 2012-10-10  Roland McGrath  <roland@hack.frob.com>
149
150         * Makefile.am (%_defs, $(srcdir)/%_dis.h): Redirect to temp file,
151         mv into place with separate command.
152
153 2012-06-26  Roland McGrath  <roland@hack.frob.com>
154
155         * Makefile.am [!MAINTAINER_MODE] ($(srcdir)/%_dis.h): New rule.
156
157 2012-02-24  Mark Wielaard  <mjw@redhat.com>
158
159         * Makefile.am (CLEANFILES): Move %_dis.h to...
160         (MAINTAINERCLEANFILES): here.
161
162 2012-01-21  Ulrich Drepper  <drepper@gmail.com>
163
164         * i386_disasm.c (ADD_NSTRING): Define.
165         (i386_disasm): Print color codes in the appropriate places.
166
167 2011-10-16  Roland McGrath  <roland@hack.frob.com>
168
169         * Makefile.am (libcpu_i386_a_SOURCES): Add i386_dis.h.
170         (libcpu_x86_64_a_SOURCES): Add x86_64_dis.h.
171         (i386_disasm.o, x86_64_disasm.o): Depend on those in $(srcdir).
172         (%_dis.h): Renamed target pattern to ...
173         ($(srcdir)/%_dis.h): ... this.
174         (noinst_HEADERS, noinst_PROGRAMS): Put under [MAINTAINER_MODE].
175
176 2010-08-16  Roland McGrath  <roland@redhat.com>
177
178         * Makefile.am (%_defs): New pattern rule.
179         (%_dis.h, %.mnemonics): Define as pattern rules using %_defs input.
180         (CLEANFILES): Include all those files.
181
182 2010-02-15  Roland McGrath  <roland@redhat.com>
183
184         * Makefile.am: Use config/eu.am for common stuff.
185
186 2009-04-14  Roland McGrath  <roland@redhat.com>
187
188         * Makefile.am (AM_CFLAGS): Add -fdollars-in-identifiers; it is not the
189         default on every machine.
190
191 2009-01-23  Roland McGrath  <roland@redhat.com>
192
193         * Makefile.am (i386_parse_CFLAGS): Use quotes around command
194         substitution that can produce leading whitespace.
195
196 2009-01-01  Ulrich Drepper  <drepper@redhat.com>
197
198         * i386_parse.y (instrtable_out): Optimize match_data table by not
199         emitting 0xff masks for leading bytes.
200         * i386_disasm.c (i386_disasm): Adjust reader of match_data.
201
202         * i386_disasm.c (i386_disasm): Reset bufcnt when not matched.  We
203         don't expect snprintf to fail.
204
205 2008-12-31  Ulrich Drepper  <drepper@redhat.com>
206
207         * defs/i386: Add dppd, dpps, insertps, movntdqa, mpsadbw, packusdw,
208         pblendvb, pblendw, pcmpeqq, pcmpestri, pcmpestrm, pcmpistri, pcmpistrm,
209         pcmpgtq, phminposuw, pinsrb, pinsrd, pmaxsb, pmaxsd, pmaxud, pmaxuw,
210         pminsb, pminsd, pminud, pminuw, pmovsxbw, pmovsxbd, pmovsxbq, pmovsxwd,
211         pmovsxwq, pmovsxdq, pmovzxbw, pmovzxbd, pmovzxbq, pmovzxwd, pmovzxwq,
212         pmovzxdq, pmuldq, pmulld, popcnt, ptest, roundss, roundps, roundpd,
213         and roundsd opcodes.
214
215         * i386_disasm.c (i386_disasm): Correct resizing of buffer.
216
217         * i386_parse.y (struct argstring): Add off element.
218         (off_op_str): New global variable.
219         (print_op_str): Print strings as concatenated strings.  Keep track
220         of index and length.  Update ->off element.
221         (print_op_str_idx): New function.
222         (instrtable_out): Mark op%d_fct as const.
223         Emit two tables for the strings: the string itself (op%d_str) and the
224         index table (op%d_str_idx).
225         * i386_disasm.c (i386_disasm): Adjust for new op%d_str definition.
226
227         * i386_disasm.c [X86_64] (i386_disasm): Handle rex prefix when
228         printing only prefix.
229
230         * i386_disasm.c (i386_disasm): Minor optimizations.
231
232         * i386_parse.y (instrtable_out): No need to emit index, the reader can
233         keep track.
234         * i386_disasm.c (i386_disasm): The index is not emitted anymore, no
235         need to skip it.
236
237         * i386_disasm.c (amd3dnow): Mark as const.
238
239         * defs/i386: Add blendvpd and blendvps opcodes.
240
241 2008-12-30  Ulrich Drepper  <drepper@redhat.com>
242
243         * defs/i386: Add blendpd and blendps opcodes.
244
245 2008-12-19  Ulrich Drepper  <drepper@redhat.com>
246
247         * defs/i386: Add entry for AMD 3DNOW.
248         * i386_disasm.c: Implement AMD 3DNOW disassembly.
249
250 2008-12-17  Ulrich Drepper  <drepper@redhat.com>
251
252         * i386_disasm.c (i386_disasm): If instruction matches prefix,
253         undoing the prefix match finishes the instruction.
254
255 2008-01-21  Roland McGrath  <roland@redhat.com>
256
257         * defs/i386: Fix typo in comment.
258         * i386_disasm.c (i386_disasm): Handle cltq, cqto.
259
260         * i386_parse.y: Add sanity check for NMNES macro value.
261         * Makefile.am (i386_parse.o): Fix target in dependency rule.
262         (i386_parse.h): New target with empty commands.
263         (i386_lex.o): Depend on it in place of i386_parse.c.
264
265 2008-01-21  Ulrich Drepper  <drepper@redhat.com>
266
267         * Makefile.am (EXTRA_DIST): Remove defs/x86_64.
268
269 2008-01-14  Ulrich Drepper  <drepper@redhat.com>
270
271         * defs/i386: Add fixes for opcodes with register number in opcode,
272         64-bit immediate forms, nop with rex.B.
273         * i386_data.h [X86_64] (FCT_imm64$w): New function.
274         (FCT_oreg): New function.
275         (FCT_oreg$w): New function.
276         * i386_disasm.c (i386_disasm): Reinitialize fmt always before
277         starting the loop to process the string.  Handle 0x90 special for
278         x86-64.
279         * i386_parse.y (fillin_arg): Expand synonyms before concatening to
280         form the function name.
281
282 2008-01-11  Ulrich Drepper  <drepper@redhat.com>
283
284         * i386_disasm.c (struct output_buffer): Remove symcb and symcbarg.
285         (i386_disasm): Remove appropriate initializers.
286         Use symcb to lookup symbol strings.
287
288         * i386_disasm.c (struct output_buffer): Add labelbuf, labelbufsize,
289         symaddr_use, and symaddr fields.
290         (i386_disasm): Remove labelbuf and labelbufsize variables.
291         Add back %e format.  Implement %a and %l formats.
292
293         * i386_data.h (general_mod$r_m): Set symaddr_use and symaddr for %rip
294         base addressing.
295
296         * i386_disasm.c (i386_disasm): Resize output buffer if necessary.
297         Optimize output_data initialization.  Free buffers before return.
298         (struct output_data): Remove op1str field.  Adjust code.
299         (i386_disasm): Store final NUL btye at end of functions.
300
301 2008-01-10  Ulrich Drepper  <drepper@redhat.com>
302
303         * i386_data.h (FCT_crdb): New function.
304         (FCT_ccc): Use FCT_crdb.
305         (FCT_ddd): Likewise.
306
307         * defs/i386: Fix a few instructions with immediate arguments.
308
309         * i386_disasm.c: Rewrite interface to callback functions for operands
310         to take a single pointer to a structure.
311         * i386_data.h: Adjust all functions.
312
313 2008-01-08  Ulrich Drepper  <drepper@redhat.com>
314
315         * Makefile.am: Enable x86-64 again.
316         * defs/i386: Lots of changes for x86-64.
317         * i386_data.h: Add support for use in x86-64 disassembler.
318         * i386_disasm.c: Likewise.
319         * i386_parse.y: Likewise.
320         * defs/x86_64: Removed.
321
322 2008-01-04  Ulrich Drepper  <drepper@redhat.com>
323
324         * defs/i386: Cleanups, remove masks which are not needed.
325         Add remaining Intel opcodes.
326         * i386_data.h (FCT_imm8): Check for input buffer overrun.
327         * i386_disasm.c (i386_disasm): Likewise.
328         * i386_parse.y: Remove suffixes which are not needed anymore.
329
330 2008-01-03  Ulrich Drepper  <drepper@redhat.com>
331
332         * defs/i386: Add yet more SSE instructions.
333
334 2008-01-02  Ulrich Drepper  <drepper@redhat.com>
335
336         * i386_disasm.c (i386_disasm): Extend matcher to allow tables to
337         contain instructions with prefixes.
338         * defs/i386: Use for many SSE operations.
339         * i386_data.h (FCT_mmxreg2): Removed.
340
341 2008-01-01  Ulrich Drepper  <drepper@redhat.com>
342
343         * defs/i386: More 0f prefix support.
344         * i386_data.h (FCT_mmxreg): Implement.
345         (FCT_mmxreg2): Implement.
346         (FCT_mmreg): Remove.
347         * i386_disasm.c (i386_disasm): More special instructions.
348         Fix tttn suffix for cmov.
349         * i386_parse.y: Simplify test for mod/r_m mode.
350
351 2007-12-31  Ulrich Drepper  <drepper@redhat.com>
352
353         * defs/i386: Fix order or arguments for mov of control/debug registers.
354         * i386_data.h (FCT_ccc): Implement
355         (FCT_ddd): Implement
356
357 2007-12-30  Ulrich Drepper  <drepper@redhat.com>
358
359         * defs/i386: Fix 0f groups 6 and 7.
360         * i386_data.c (FCT_mod$16r_m): Implement.
361         * i386_disasm.c (i386_disasm): Third parameter can also have string.
362
363 2007-12-29  Ulrich Drepper  <drepper@redhat.com>
364
365         * defs/i386: Add lots of floating point ops.
366         * i386_data.h (FCT_fmod$fr_m): Removed.
367         (FCT_freg): Implement.
368         * i386_disasm.c (i386_disasm): Implement suffix_D.
369         * i386_parse.y: Emit suffix_D.
370
371         * defs/i386: Use rel instead of dispA.
372         Fix lcall, dec, div, idiv, imul, inc, jmp, ljmp, mul, neg, not, push,
373         test.
374
375         * i386_data.h (FCT_dispA): Removed.
376         (FCT_ds_xx): Add test for end of input buffer.
377         * i386_disasm.c (ABORT_ENTRY): Removed.
378         (i386_disasm): Fix handling of SIB.  Pass correct address value to
379         operand callbacks.
380
381         * Makefile.am (*.mnemonics): Filter out INVALID entry.
382         * defs/i386: Define imms8 and use in appropriate places.
383         Add INVALID entries for special opcodes with special mnemonics.
384         Fix int3.  Fix typo in shl.  Correct xlat.
385         * i386_data.h (FCT_ds_xx): New function.
386         (FCT_ds_si): Use it.
387         (FCT_ds_bx): New function.
388         (FCT_imms8): New function.
389         * i386_disasm.c (MNE_INVALID): Define.
390         (i386_disasm): Handle invalid opcodes in mnemonics printing, not
391         separately.  Fix address value passed to operand handlers.
392         * i386_parse.y (bx_reg): Define.
393         (instrtable_out): Handle INVALID entries differently, just use
394         MNE_INVALID value for .mnemonic.
395
396 2007-12-28  Ulrich Drepper  <drepper@redhat.com>
397
398         * defs/i386: Fix shift and mov immediate instructions.
399         * i386_data.h (FCT_imm16): Implement.
400
401         * defs/i386: Use absval instead of abs of lcall and ljmp.
402         Add parameters for cmps.  Fix test and mov immediate.
403         * i386_data.h: Implement FCT_absval.
404         * i386_disasm.c: Handle data16 for suffix_w  and FCT_imm.
405
406         * defs/i386: Move entries with 0x9b prefix together.
407         * i386_disasm.c (i386_disasm): Fix recognizing insufficient bytes in
408         input.  Handle data16 with suffix_W.
409
410         * i386_data.h (FCT_*): Add end parameter to all functions.  Check
411         before using more bytes.
412         (FCT_sel): Implement.
413         * i386_disasm.c (i386_disasm): Better handle end of input buffer.
414         Specal opcode 0x99.
415
416         * Makefile.am: Use m4 to preprocess defs/* files.
417         * defs/i386: Adjust appropriately.
418         * i386_data.c (FCT_ax): Implement.
419         (FCT_ax$w): Use FCT_ax.
420         * i386_disasm.c (ADD_STRING): Use _len instead of len.
421         (i386_disasm): If no instruction can be matched because of lack of
422         input and prefixes have been matched, print prefixes.
423         Recognize abort entries.
424         Handle special cases.
425         * i386_gendis.c: Recognize - input file name.
426         * i386_lex.c: Recognize INVALID token.
427         * i386_parse.y: Handle INVALID token input.
428
429         * defs/i386: Fix mov, pop.
430         * i386_data.h (FCT_sreg3): Implement.
431
432 2007-12-27  Ulrich Drepper  <drepper@redhat.com>
433
434         * defs/i386: Fix adc, add, cmp, or, sbb, sub, xchg, xor.
435         * i386_data.h (FCT_imms): New function.
436         (FCT_imm$s): Use FCT_imms for handling of signed values.
437         (FCT_imm8): Sign extend values.
438         * i386_disasm.c (i386_disasm): Implement suffix_w0.
439         * i386_parse.y: Emit suffix w0.
440
441         * i386_data.h (FCT_disp8): Add 0x prefix.
442         (FCT_ds_si): Implement.
443         * i386_disasm.c (i386_disasm): Increment addr for invalid prefixes.
444         Implement tttn suffix.
445         * i386_parse.y: Emit tttn suffix definition.
446
447 2007-12-26  Ulrich Drepper  <drepper@redhat.com>
448
449         * i386_data.h (struct instr_enc): Use suffix field.
450         (FCT_dx): Fill in body.
451         (FCT_es_di): Likewise.
452         (FCT_imm$s): Sign-extended byte values.
453         * i386_disasm.c: Protect ADD_CHAR and ADD_STRING macros.  Adjust uses.
454         (i386_disasm): Handle suffix.
455         * i386_parse.y: Emit suffix information.
456         * defs/i386: Remove unnecessary suffixes.
457
458         * Makefile.am: Disable building x86-64 version for now.
459
460         * defs/i386: Fix and, bound, cmp, or, pop, sbb, sub, xor.
461         * i386_data.h: Pass pointer to prefix to functions.  If not prefixes
462         are consumed this means invalid input.
463         * i386_disasm.c: Fix prefix printing.  Adjust function calls for
464         parameter change.
465         * i386_parse.y: Recognize moda prefix.
466
467 2007-12-21  Ulrich Drepper  <drepper@redhat.com>
468
469         * i386_data.h: Fix SIB handling.
470         * i386_disasm.c: Likewise.
471
472 2007-12-19  Ulrich Drepper  <drepper@redhat.com>
473
474         * defs/i386: Fix up 'and' opcode.
475
476 2007-10-31  Ulrich Drepper  <drepper@redhat.com>
477
478         * Makefile.am: Add dependencies of the generated files on the source
479         files.
480         (i386_lex_CFLAGS): Add -Wno-sign-compare.
481
482         * defs/i386: A lot more data.
483         * defs/x86_64: Likewise.
484         * i386_data.h (struct instr_enc): Add off1_3, off2_3, and off3_3
485         fields.
486         (opfct_t): Add parameter for third operand.
487         (FCT_*): Likewise.
488         (data_prefix): New function.
489         (FCT_abs): Implement.
490         (FCT_ax): Renamed to FCT_ax$w amd implement.
491         (FCT_disp8): Implement.
492         (FCT_dispA): Implement.
493         (FCT_imm): Implement.
494         (FCT_imm$w): Implement.
495         (FCT_imm$s): Don't zero-pad numbers.
496         (FCT_imm8): Likewise.
497         (FCT_rel): Likewise.
498         (general_mod$r_m): New function.
499         (FCT_mod$r_m): Use it.
500         (FCT_mod$r_m$w): New function.
501         (FCT_mod$8r_m): New function.
502         (FCT_reg): Correctly handle 16-bit registers.
503         (FCT_reg$w): New function.
504         * i386_disasm.c (i386_disasm): Handle prefixes better.
505         Pass third parameter to operand functions.
506         * i386_parse.y (struct instruction): Add off3 field.
507         Handle third operand throughout.
508
509 2007-02-05  Ulrich Drepper  <drepper@redhat.com>
510
511         * i386_disasm.c: New file.
512         * i386_data.h: New file.
513         * i386_gendis.c: New file.
514         * i386_lex.l: New file.
515         * i386_parse.y: New file.
516         * memory-access.h: New file.
517         * x86_64_disasm.c: New file.
518         * defs/i386: New file.
519         * defs/i386.doc: New file.
520         * defs/x86_64: New file.
521
522 2005-02-15  Ulrich Drepper  <drepper@redhat.com>
523
524         * Makefile (AM_CFLAGS): Add -Wunused -Wextra -Wformat=2.
525
526 2005-02-05  Ulrich Drepper  <drepper@redhat.com>
527
528         * Makefile.am (AM_CFLAGS): Define, instead of adding things to DEFS.
529
530 2003-08-11  Ulrich Drepper  <drepper@redhat.com>
531
532         * Moved to CVS archive.