public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* [Linux-ia64] Re: gas dependency checker bug [forwarded message from Xavier Leroy]
@ 2000-07-07  9:09 Xavier Leroy
  2000-07-07 19:50 ` Jim Wilson
  2000-08-16  2:27 ` Jim Wilson
  0 siblings, 2 replies; 3+ messages in thread
From: Xavier Leroy @ 2000-07-07  9:09 UTC (permalink / raw)
  To: linux-ia64

> Attached below is a bug report for gas.  I did verify that gas indeed
> fails to detect the RAW hazard on r2 in the sample code.

While we're at it, I found a third case of missed RAW dependency.
The IA64 has a special bypass allowing predicates set by e.g. a "cmp"
instruction to be used to predicate a branch in the same instruction
group:

        cmp.eq p6, p7 = r32, r33
        (p6) br ...

However, non-branch instructions predicated on the result of the "cmp"
cannot be executed in the same instruction group.  gas doesn't realize
this.  Consider:

[xleroy@tl2 essais]$ more preds.s
        .global f#
        .proc   f#
f:
        cmp.eq p6, p7 = r32, r33
        (p6) mov r8 = 1
        (p7) mov r8 = 0
        br.ret.sptk b0

        .endp f#

[xleroy@tl2 essais]$ as -xauto -xdebug preds.s
Checking cmp.eq for violations (line 4, 18/12)
Registering 'cmp.eq' resource usage
  Adding RAW 'PR%, % in 1 - 62' (7)
  Adding RAW 'PR%, % in 1 - 62' (6)
  Adding WAW 'PR%, % in 1 - 62' (7)
  Adding WAW 'PR%, % in 1 - 62' (6)
  Adding WAW 'PR%, % in 1 - 62' (7)
  Adding WAW 'PR%, % in 1 - 62' (6)
  Registering mutex on p6, p7
Checking mov for violations (line 5, 8/2)
Registering 'mov' resource usage
  Adding RAW 'GR%, % in 1 - 127' (8)
  Adding WAW 'GR%, % in 1 - 127' (8)
Checking mov for violations (line 6, 8/2)
Registering 'mov' resource usage
  Adding RAW 'GR%, % in 1 - 127' (8)
  Adding WAW 'GR%, % in 1 - 127' (8)
Checking br.ret.sptk for violations (line 7, 27/13)
Registering 'br.ret.sptk' resource usage
  Clearing register values
  Clearing mutex relation p6, p7
  Insn group break (w/stop)
  Insn group break (w/stop)
  Insn group break (w/stop)
  Insn group break (w/stop)

[xleroy@tl2 essais]$ objdump -d a.out  

a.out:     file format elf64-ia64-little

Disassembly of section .text:

0000000000000000 <f>:
   0:   00 30 80 42 07 b8       [MII]       cmp.eq p6,p7=r32,r33
   6:   81 08 00 00 c2 03             (p06) mov r8=1
   c:   01 00 00 84                   (p07) mov r8=r0
  10:   11 00 00 00 01 00       [MIB]       nop.m 0x0
  16:   00 00 00 02 00 80                   nop.i 0x0
  1c:   00 00 84 00                         br.ret.sptk.few b0;;

This is incorrect: there should be a stop after the cmp.eq.

Best regards,

- Xavier Leroy



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Linux-ia64] Re: gas dependency checker bug [forwarded message from Xavier Leroy]
  2000-07-07  9:09 [Linux-ia64] Re: gas dependency checker bug [forwarded message from Xavier Leroy] Xavier Leroy
@ 2000-07-07 19:50 ` Jim Wilson
  2000-08-16  2:27 ` Jim Wilson
  1 sibling, 0 replies; 3+ messages in thread
From: Jim Wilson @ 2000-07-07 19:50 UTC (permalink / raw)
  To: linux-ia64

The assembler DV support is in a funny state at the moment.  Intel has run
gas through their DV testsuite, identified a number of bugs, and wrote patches
for them.  Unfortunately, I can't use the Intel patches without FSF copyright
assignments, and it isn't clear when this issue will be resolved.  Meanwhile,
Red Hat doesn't have anyone actively working on the assembler, so we are
waiting to see if we can use the Intel patches, and we will probably wait
quite a while before giving up and doing the work ourselves.

Jim



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Linux-ia64] Re: gas dependency checker bug [forwarded message from Xavier Leroy]
  2000-07-07  9:09 [Linux-ia64] Re: gas dependency checker bug [forwarded message from Xavier Leroy] Xavier Leroy
  2000-07-07 19:50 ` Jim Wilson
@ 2000-08-16  2:27 ` Jim Wilson
  1 sibling, 0 replies; 3+ messages in thread
From: Jim Wilson @ 2000-08-16  2:27 UTC (permalink / raw)
  To: linux-ia64

	While we're at it, I found a third case of missed RAW dependency.

        cmp.eq p6, p7 = r32, r33
        (p6) mov r8 = 1
        (p7) mov r8 = 0

This turns out to be a bug in the DV tables that we got from Intel.  The
pr-readers-nobr-nomovpr instruction class is missing addl and adds.  If
you use any instruction except addl/adds/mov, then the DV will be reported.

This instruction class is correct in the July 2000 version of the SDM.
See Vol 2, Appendix A, page A-21.  If I update that line by hand, then the
DV is reported for this testcase.  I don't want to update 21 pages of info
by hand, so I will ask Intel for updated copies of these tables.

The following patch fixes this.  This requires running the ia64-gen program
to rebuild the ia64-asmtab.c file.

Index: ia64-ic.tbl
=================================RCS file: /cvs/cvsfiles/devo/opcodes/ia64-ic.tbl,v
retrieving revision 1.3
diff -p -r1.3 ia64-ic.tbl
*** ia64-ic.tbl	2000/08/15 19:44:19	1.3
--- ia64-ic.tbl	2000/08/16 02:18:33
*************** pr-norm-writers-fp;	IC:pr-gen-writers-fp
*** 202,208 ****
  pr-norm-writers-int;	IC:pr-gen-writers-int[Field(ctype)=]
  pr-or-writers;	IC:pr-gen-writers-int[Field(ctype) in {or orcm}], IC:pr-gen-writers-int[Field(ctype) in {or.andcm and.orcm}]
  pr-readers-br;	br.call, br.cond, brl.call, brl.cond, br.ret, br.wexit, br.wtop, break.b, break, nop.b, nop, IC:ReservedBQP
! pr-readers-nobr-nomovpr;	add, addp4, and, andcm, break.f, break.i, break.m, break.x, break, chk.s, IC:chk-a, cmp, cmp4, IC:cmpxchg, IC:czx, dep, extr, IC:fp-arith, IC:fp-non-arith, fc, fchkf, fclrf, fcmp, IC:fetchadd, fpcmp, fsetc, fwb, getf, IC:invala-all, itc.i, itc.d, itr.i, itr.d, IC:ld, IC:ldf, IC:ldfp, IC:lfetch-all, mf, IC:mix, IC:mov-from-AR-M, IC:mov-from-AR-IM, IC:mov-from-AR-I, IC:mov-to-AR-M, IC:mov-to-AR-I, IC:mov-to-AR-IM, IC:mov-to-BR, IC:mov-from-BR, IC:mov-to-CR, IC:mov-from-CR, IC:mov-to-IND, IC:mov-from-IND, IC:mov-ip, IC:mov-immediate, IC:mov-to-PSR-l, IC:mov-to-PSR-um, IC:mov-from-PSR, IC:mov-from-PSR-um, movl, IC:mux, nop.f, nop.i, nop.m, nop.x, nop, or, IC:pack, IC:padd, IC:pavg, IC:pavgsub, IC:pcmp, IC:pmax, IC:pmin, IC:pmpy, IC:pmpyshr, popcnt, IC:probe-all, IC:psad, IC:pshl, IC:pshladd, IC:pshr, IC:pshradd, IC:psub, ptc.e, ptc.g, ptc.ga, ptc.l, ptr.d, ptr.i, IC:ReservedQP, rsm, setf, shl, shladd, shladdp4, shr, shrp, srlz.i, srlz.d, ssm, IC:st, IC:s!
tf, sub, sum, IC:sxt, sync, tak, tbit, thash, tnat, tpa, ttag, IC:unpack, IC:xchg, xma, xmpy, xor, IC:zxt
  pr-unc-writers-fp;	IC:pr-gen-writers-fp[Field(ctype)=unc]+11, fprcpa+11, fprsqrta+11, frcpa+11, frsqrta+11
  pr-unc-writers-int;	IC:pr-gen-writers-int[Field(ctype)=unc]+11
  pr-writers;	IC:pr-writers-int, IC:pr-writers-fp
--- 202,208 ----
  pr-norm-writers-int;	IC:pr-gen-writers-int[Field(ctype)=]
  pr-or-writers;	IC:pr-gen-writers-int[Field(ctype) in {or orcm}], IC:pr-gen-writers-int[Field(ctype) in {or.andcm and.orcm}]
  pr-readers-br;	br.call, br.cond, brl.call, brl.cond, br.ret, br.wexit, br.wtop, break.b, break, nop.b, nop, IC:ReservedBQP
! pr-readers-nobr-nomovpr;	add, addl, addp4, adds, and, andcm, break.f, break.i, break.m, break.x, chk.s, IC:chk-a, cmp, cmp4, IC:cmpxchg, IC:czx, dep, extr, IC:fp-arith, IC:fp-non-arith, fc, fchkf, fclrf, fcmp, IC:fetchadd, fpcmp, fsetc, fwb, getf, IC:invala-all, itc.i, itc.d, itr.i, itr.d, IC:ld, IC:ldf, IC:ldfp, IC:lfetch-all, mf, IC:mix, IC:mov-from-AR-M, IC:mov-from-AR-IM, IC:mov-from-AR-I, IC:mov-to-AR-M, IC:mov-to-AR-I, IC:mov-to-AR-IM, IC:mov-to-BR, IC:mov-from-BR, IC:mov-to-CR, IC:mov-from-CR, IC:mov-to-IND, IC:mov-from-IND, IC:mov-ip, IC:mov-to-PSR-l, IC:mov-to-PSR-um, IC:mov-from-PSR, IC:mov-from-PSR-um, movl, IC:mux, nop.f, nop.i, nop.m, nop.x, or, IC:pack, IC:padd, IC:pavg, IC:pavgsub, IC:pcmp, IC:pmax, IC:pmin, IC:pmpy, IC:pmpyshr, popcnt, IC:probe-all, IC:psad, IC:pshl, IC:pshladd, IC:pshr, IC:pshradd, IC:psub, ptc.e, ptc.g, ptc.ga, ptc.l, ptr.d, ptr.i, IC:ReservedQP, rsm, setf, shl, shladd, shladdp4, shr, shrp, srlz.i, srlz.d, ssm, IC:st, IC:stf, sub, sum, IC:s!
xt, sync, tak, tbit, thash, tnat, tpa, ttag, IC:unpack, IC:xchg, xma, xmpy, xor, IC:zxt
  pr-unc-writers-fp;	IC:pr-gen-writers-fp[Field(ctype)=unc]+11, fprcpa+11, fprsqrta+11, frcpa+11, frsqrta+11
  pr-unc-writers-int;	IC:pr-gen-writers-int[Field(ctype)=unc]+11
  pr-writers;	IC:pr-writers-int, IC:pr-writers-fp


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2000-08-16  2:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-07-07  9:09 [Linux-ia64] Re: gas dependency checker bug [forwarded message from Xavier Leroy] Xavier Leroy
2000-07-07 19:50 ` Jim Wilson
2000-08-16  2:27 ` Jim Wilson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox