Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!ub!oswego!uupsi!sunic!news.funet.fi!hydra!klaava!cc.helsinki.fi!wirzenius From: wirzenius@cc.helsinki.fi Newsgroups: comp.lang.c Subject: Re: Bug in TC2.0 Optimization Message-ID: <1991Apr28.220249.1@cc.helsinki.fi> Date: 28 Apr 91 20:02:49 GMT References: <1991Apr22.130418.8079@uni-paderborn.de> Sender: news@klaava.Helsinki.FI (Uutis Ankka) Organization: University of Helsinki Lines: 28 In article <1991Apr22.130418.8079@uni-paderborn.de>, higgins@uni-paderborn.de (Frank Westheider) writes: > Input[func(bla)+bla] = !Input[func(bla)+bla] A side note: do you really want to call func(bla) twice? > In Assembly-Mode there will be > xor dx,dx > generated, but dx has never been loaded ! I'm not familiar with assembler, but if this does what I think it does, i.e. xors dx with itself and puts the result back into dx, then it doesn't matter whether dx has been loaded or not. The truth table for xor is: a b a xor b 0 0 0 0 1 1 1 0 1 1 1 0 Since the result is 1 if and only if the operands are different, xoring a value with itself is identical to 0, regardless of the value of the operand. So the assembler statement sets dx to 0. Why didn't they just do it explicitly? Maybe this method is faster, smaller, or has some other virtue. Lars Wirzenius wirzenius@cc.helsinki.fi