3 # Copyright 2000 Free Software Foundation, Inc.
5 # This file is part of the GNU MP Library.
7 # The GNU MP Library is free software; you can redistribute it and/or modify
8 # it under the terms of either:
10 # * the GNU Lesser General Public License as published by the Free
11 # Software Foundation; either version 3 of the License, or (at your
12 # option) any later version.
16 # * the GNU General Public License as published by the Free Software
17 # Foundation; either version 2 of the License, or (at your option) any
20 # or both in parallel, as here.
22 # The GNU MP Library is distributed in the hope that it will be useful, but
23 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
24 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
27 # You should have received copies of the GNU General Public License and the
28 # GNU Lesser General Public License along with the GNU MP Library. If not,
29 # see https://www.gnu.org/licenses/.
32 # Usage: cd $(builddir)/mpn
33 # $(srcdir)/x86/t-zdisp.sh
35 # Run the Zdisp() macro instructions through the assembler to check
36 # the encodings used. Mismatches are printed, no output means all ok.
38 # This program is only meant for use during development. It can be
39 # run in the mpn build directory of any x86 configuration.
41 # For this test the assembler needs to generate byte sized 0
42 # displacements when given something like 0(%eax). Recent versions of
43 # gas are suitable (eg. 2.9.x or 2.10.x).
47 cat >tmp-zdisptest.asm
<<\EOF
49 include
(`../config.m4')
51 dnl Redefine Zdisp_match to output its pattern and encoding.
53 `define(`Zdisp_found',1)dnl
54 ifelse
(`$2',0,` $1 $2$3, $4')`'dnl
55 ifelse
(`$3',0,` $1 $2, $3$4')`'dnl
63 m4 tmp-zdisptest.asm >tmp-zdisptest.s
64 as -o tmp-zdisptest.o tmp-zdisptest.s
66 # Demand duplicates from the instruction patterns and byte encodings.
67 objdump -d tmp-zdisptest.o | awk '
69 sub
(/^
*[a-z0-9
]+:/,"")