Mibench

From Msim

Jump to: navigation, search

This page refers to the Mibench benchmarks that can be found here: [1]
We provide a partial set of these benchmarks, inputs, .arg files here

Contents

General Issues

Various MiBenchv1_3 benchmarks try to read a run file to gather information regarding a number of runs. We remove that and only run single executions in our environment.
Various places use "long" expecting 4 bytes. They receive 8 on alpha. This ends up wasting a lot of space in some cases (the cases where the code ran incorrectly have been fixed for a few benchmarks). We are largely not worrying about the extra space at this point.

Automotive

basicmath

Small input set has insignificant precision errors.
Large input set has a huge number of precision errors (apparently insignificant). There is a concern about the reference input:

sqrt(3FED016A) -> 7FED0000 in the reference input.
M-Sim returns 7FED0001.
On a calculator we get 7FED.00010026

bitcount

Outputs are very different. A time measurement is used, therefore, the time differences are probably reasonable. However, the value "bits" is very different and we don't know if this is acceptable.

qsort

No issues.

susan

No issues.

Consumer

jpeg

Binary requires /sbin/loader support.
No other issues.

lame

mad

tiff2bw

tiff2rgba

tiffdither

tiffmedian

typeset

Network

Dijkstra

No issues.

Patricia

For the large input, a line specified as:

<Float> <Hex Number>: Found.

<Float> has precision errors in the range of 10^-3. These may not matter but we are uncertain of that.

Office

ghostscript

ispell

rsynth

sphinx

stringsearch

Security

All security benchmarks appear to work correctly on M-Sim with fixes as specified below.

Blowfish

Encode output does not match the reference output. However, it does decode to the correct result. In bf.c, Blowfish does not handle End-of-file conditions properly (adding a single character to the output file on every run).

Old code:

i=0;
while(!feof(fp))
{
       int j;
       while(!feof(fp) && i<40)
               indata[i++]=getc(fp);

New code:

i=0;
while(!feof(fp))
{
       int j;
       while(!feof(fp) && i<40)
               indata[i++]=getc(fp);

       //While condition out of order, feof can occur and still write to indata
       if(feof(fp))
               i--;

Rijndael

Compiled as: g++ -O4 -non_shared -fast -o rijndael *.c
Rijndael has a huge number unaligned memory accesses - this causes it to run horribly on a native alpha machine. This is fixed with the following change to aes.h:

In typedef struct { ... } c_name(aes);
    byte    mode;               /* encrypt, decrypt or both                   */
should be:
    word    mode;               /* encrypt, decrypt or both                   */

The original code has sizing problems:
Old (aesxam.c):

int encfile(FILE *fin, FILE *fout, aes *ctx, char* fn)
{   unsigned char            inbuf[16], outbuf[16];
...
int decfile(FILE *fin, FILE *fout, aes *ctx, char* ifn, char* ofn)
{   unsigned char    inbuf1[16], inbuf2[16], outbuf[16], *bp1, *bp2, *tp;
   int     i, l, flen;

Corrected:

int encfile(FILE *fin, FILE *fout, aes *ctx, char* fn)
{   unsigned char            inbuf[32], outbuf[32];
...
int decfile(FILE *fin, FILE *fout, aes *ctx, char* ifn, char* ofn)
{   unsigned char    inbuf1[32], inbuf2[32], outbuf[32], *bp1, *bp2, *tp;
   int     i, l, flen;

The size only needed to be 17 but 32 is a nicer number. The problem is that char x[16] on Alpha is only 16 bytes. There is no room for a sentinel character. More specifically, read(X) can not be guaranteed to generated X or less bytes, it may generate up to X+1 bytes due to a sentinel character.

Supplemental Changes

"unsigned long" was used in various places. On alpha this is a 64-bit data type, not a 32-bit data type. All of these references were changed from "unsigned long" to "unsigned int".
In aesxam.c:

56          /* void cycles(unsigned long *rtn)     */
75          {   static unsigned long a[2], mt = 1, count = 4;
90          *(unsigned long*)r = RAND(a[0], a[1]);
103         unsigned long   i=0, l=0; 
203         if(fwrite(outbuf + 16 - l, 1, l, fout) != (unsigned long)l)
229         if(fwrite(outbuf + l, 1, flen, fout) != (unsigned long)flen)

In aes.h:

typedef unsigned long   word;           /* must be a 32-bit storage unit */

Pgp

Did not work due to the M-Sim's loader not handling quotes in the command line.
The default pgp compilation does not generate an output file if the output file already exists. Therefore, you should remove testin.txt.asc and testout.txt before running.
Make using: "make hpux-pa-ansi"

Sha

Wrong endian (change to little -DLITTLE_ENDIAN). Make sure to include "-non_shared" as a linkage parameter.
Type "LONG" is too large, typedef it to "unsigned int" instead (see sha.h).

Telecom

adpcm

No issues.

crc32

First value is preceded by FFFFFFFF in both cases (probably used long as a 32-bit value). Reference output for small input is incorrect (can't verify M-Sim's output).

fft

Significant differences. We are not sure if this is working correctly at all.

gsm

Binary requires /sbin/loader support.
No remaining issues:

decode reports an error handling stdout after output 9 bytes (snd...).
This appears to occur since the test uses "-c" to force output to stdout.
However, a TTY check is made and since redirection is being uses the TTY check fails and causes the program to abort.
On native Tru64, this can't be run with the test provided since the redirection fails the TTY check.
M-Sim returns a successful TTY check if the file is a redirection of stdout/stdin/stderr, therefore, this runs in M-Sim.
Personal tools