Path: utzoo!mnetor!tmsoft!torsqnt!lethe!yunexus!ists!helios.physics.utoronto.ca!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!apple!mips!winchester!mash From: mash@mips.COM (John Mashey) Newsgroups: comp.arch Subject: Re: standard extensions Message-ID: <46168@mips.mips.COM> Date: 25 Feb 91 20:17:50 GMT References: <1087@kaos.MATH.UCLA.EDU> <14814@lanl.gov> <1991Feb15.192653.9846@rice.edu> <6049@mentor.cc.purdue.edu> <3381.27c548c3@iccgcc.decnet.ab.com> Sender: news@mips.COM Reply-To: mash@mips.COM (John Mashey) Organization: MIPS Computer Systems, Inc. Lines: 22 In article <3381.27c548c3@iccgcc.decnet.ab.com> herrickd@iccgcc.decnet.ab.com (daniel lance herrick) writes: .... >What has frosted me about the languages is that the arithmetic >operators are all single valued. I usually want the quotient >and remainder from a division. I have to tell the compiler to >give me the quotient and then tell it to give me the remainder. >It might be smart enough to notice that it gets both of them in >one machine operation, but if it is, it is only undoing bad language >design. I have no idea if it does it in all cases that would make sense. However, at least the current MIPS compilers and assembler, if faced with: i = j / k; l = j % k; conspire to execute a single division instruction. (To see this, you have to look not at the generated .s file, which has two divs, but at the dis-assembly of the .o or a.out, which shows only 1...) -- -john mashey DISCLAIMER: UUCP: mash@mips.com OR {ames,decwrl,prls,pyramid}!mips!mash DDD: 408-524-7015, 524-8253 or (main number) 408-720-1700 USPS: MIPS Computer Systems, 930 E. Arques, Sunnyvale, CA 94086 Brought to you by Super Global Mega Corp .com