Annotation of OpenXM_contrib/gmp/mpn/x86/t-zdisp.sh, Revision 1.1
1.1 ! ohara 1: #! /bin/sh
! 2: #
! 3: # Copyright 2000 Free Software Foundation, Inc.
! 4: #
! 5: # This file is part of the GNU MP Library.
! 6: #
! 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 2.1 of the License, or (at
! 10: # your option) any later version.
! 11: #
! 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.
! 16: #
! 17: # You should have received a copy of the GNU Lesser General Public License
! 18: # along with the GNU MP Library; see the file COPYING.LIB. If not, write to
! 19: # the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
! 20: # MA 02111-1307, USA.
! 21:
! 22:
! 23: # Usage: cd $(builddir)/mpn
! 24: # $(srcdir)/x86/t-zdisp.sh
! 25: #
! 26: # Run the Zdisp() macro instructions through the assembler to check
! 27: # the encodings used. Mismatches are printed, no output means all ok.
! 28: #
! 29: # This program is only meant for use during development. It can be
! 30: # run in the mpn build directory of any x86 configuration.
! 31: #
! 32: # For this test the assembler needs to generate byte sized 0
! 33: # displacements when given something like 0(%eax). Recent versions of
! 34: # gas are suitable (eg. 2.9.x or 2.10.x).
! 35:
! 36: set -e
! 37:
! 38: cat >tmp-zdisptest.asm <<\EOF
! 39:
! 40: include(`../config.m4')
! 41:
! 42: dnl Redefine Zdisp_match to output its pattern and encoding.
! 43: define(`Zdisp_match',
! 44: `define(`Zdisp_found',1)dnl
! 45: ifelse(`$2',0,` $1 $2$3, $4')`'dnl
! 46: ifelse(`$3',0,` $1 $2, $3$4')`'dnl
! 47:
! 48: .byte $5
! 49: ')
! 50: .text
! 51: Zdisp()
! 52: EOF
! 53:
! 54: m4 tmp-zdisptest.asm >tmp-zdisptest.s
! 55: as -o tmp-zdisptest.o tmp-zdisptest.s
! 56:
! 57: # Demand duplicates from the instruction patterns and byte encodings.
! 58: objdump -d tmp-zdisptest.o | awk '
! 59: /^ *[a-z0-9]+:/ {
! 60: sub(/^ *[a-z0-9]+:/,"")
! 61: print
! 62: }' | sort | uniq -u
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>