kerneltest/e32test/bench/t_t64fnc.cpp
author John Imhofe
Mon, 19 Oct 2009 15:55:17 +0100
changeset 0 a41df078684a
permissions -rw-r--r--
Convert Kernelhwsrv package from SFL to EPL kernel\eka\compsupp is subject to the ARM EABI LICENSE userlibandfileserver\fatfilenameconversionplugins\unicodeTables is subject to the Unicode license kernel\eka\kernel\zlib is subject to the zlib license

// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
// All rights reserved.
// This component and the accompanying materials are made available
// under the terms of the License "Eclipse Public License v1.0"
// which accompanies this distribution, and is available
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
//
// Initial Contributors:
// Nokia Corporation - initial contribution.
//
// Contributors:
//
// Description:
// e32test\bench\t_t64fnc.cpp
// 
//

#include <e32std.h>
#include <e32std_private.h>

GLREF_D volatile TInt64 count;
GLREF_D volatile TInt64 a, b, c;

TInt TInt64Addition(TAny*)
    {

      TInt64  al = a;
      const TInt64 bl = b;
      const TInt64 x = 1;
      for(;;)
        {
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;

        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;

        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;

        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;

        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;

        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;

        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;

        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;

        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;

        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;
        al +=bl;

		a = al;
        count += x;
		if (!count)
			break;
      }
      return (TInt)count;
    }

TInt TInt64Subtraction(TAny*)
    {

    a = MAKE_TINT64(0x31514531,0x93471672u);
	b = MAKE_TINT64(0x51514531,0x33847162);

      TInt64  al = a;
      const TInt64 bl = b;
      const TInt64 x = 1;
      for(;;)
        {
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;

        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;

        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;

        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;

        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;

        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;

        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;

        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;

        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;

        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;
        al -=bl;

		a = al;
        count += x;
		if (!count)
			break;
      }
      return (TInt)count;
    }


TInt TInt64Multiplication(TAny*)
    {
    a = MAKE_TINT64(0xffffffff,0xfa0a1f00u);
	b = MAKE_TINT64(0x0,0xfa0a1f00u);
	
      TInt64  al = a;
      const TInt64 bl = b;
      const TInt64 x = 1;

      for(;;)
        {
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;

        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;

        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;

        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;

        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;

        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;

        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;

        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;

        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;

        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;
        al *=bl;

		a = al;
        count += x;
		if (!count)
			break;
      }
      return (TInt)count;
    }

TInt TInt64Division(TAny*)
    {

    a = MAKE_TINT64(0x31514531,0x93471672u);
	b = MAKE_TINT64(0x0,0x05F5E100);
	
      TInt64  al = a;
      const TInt64 bl = b;
      const TInt64 x = 1;

      for(;;)
        {
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;

        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;

        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;

        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;

        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;

        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;

        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;

        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;

        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;

        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;
        al /=bl;

		a = al;
        count += x;
		if (!count)
			break;
      }
      return (TInt)count;    }