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 the GNU Lesser General Public License as published
9 # by the Free Software Foundation; either version 3 of the License, or (at
10 # your option) any later version.
12 # The GNU MP Library is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
15 # License for more details.
17 # You should have received a copy of the GNU Lesser General Public License
18 # along with the GNU MP Library. If not, see http://www.gnu.org/licenses/.
21 # Usage: cd $(builddir)/mpn
22 # $(srcdir)/x86/t-zdisp.sh
24 # Run the Zdisp() macro instructions through the assembler to check
25 # the encodings used. Mismatches are printed, no output means all ok.
27 # This program is only meant for use during development. It can be
28 # run in the mpn build directory of any x86 configuration.
30 # For this test the assembler needs to generate byte sized 0
31 # displacements when given something like 0(%eax). Recent versions of
32 # gas are suitable (eg. 2.9.x or 2.10.x).
36 cat >tmp-zdisptest.asm <<\EOF
38 include(`../config.m4')
40 dnl Redefine Zdisp_match to output its pattern and encoding.
42 `define(`Zdisp_found',1)dnl
43 ifelse(`$2',0,` $1 $2$3, $4')`'dnl
44 ifelse(`$3',0,` $1 $2, $3$4')`'dnl
52 m4 tmp-zdisptest.asm >tmp-zdisptest.s
53 as -o tmp-zdisptest.o tmp-zdisptest.s
55 # Demand duplicates from the instruction patterns and byte encodings.
56 objdump -d tmp-zdisptest.o | awk '
58 sub(/^ *[a-z0-9]+:/,"")