OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [pr33923.c] - Blame information for rev 689

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
/* PR target/33923 */
2
/* Testcase by Martin Michlmayr <tbm@cyrius.com> */
3
 
4
/* { dg-do compile } */
5
/* { dg-options "-O3 --param max-partial-antic-length=0" } */
6
 
7
static int pendingCommand;
8
static int currentModifiers;
9
typedef struct
10
{
11
  int (*updateKeys) (int *keyPressed);
12
}
13
ProtocolOperations;
14
static const ProtocolOperations *protocol;
15
brl_readCommand (void)
16
{
17
  unsigned long int keys;
18
  int command;
19
  int keyPressed;
20
  unsigned char routingKeys[200];
21
  int routingKeyCount;
22
  signed char rightVerticalSensor;
23
  if (pendingCommand != (-1))
24
    {
25
      return command;
26
    }
27
  if (!protocol->updateKeys (&keyPressed))
28
    {
29
      if (rightVerticalSensor >= 0)
30
        keys |= 1;
31
      if ((routingKeyCount == 0) && keys)
32
        {
33
          if (currentModifiers)
34
            {
35
            doChord:switch (keys);
36
            }
37
          else
38
            {
39
            doCharacter:
40
              command = 0X2200;
41
              if (keys & 0X01UL)
42
                command |= 0001;
43
              if (keys & 0X02UL)
44
                command |= 0002;
45
              if (keys & 0X04UL)
46
                command |= 0004;
47
              if (keys & 0X08UL)
48
                command |= 0010;
49
              if (keys & 0X10UL)
50
                command |= 0020;
51
              if (keys & 0X20UL)
52
                command |= 0040;
53
              if (currentModifiers & (0X0010 | 0X0200))
54
                command |= 0100;
55
              if (currentModifiers & 0X0040)
56
                command |= 0200;
57
              if (currentModifiers & 0X0100)
58
                command |= 0X020000;
59
              if (currentModifiers & 0X0400)
60
                command |= 0X080000;
61
              if (currentModifiers & 0X0800)
62
                command |= 0X040000;
63
            }
64
          unsigned char key1 = routingKeys[0];
65
          if (key1 == 0)
66
            {
67
            } else if (key1 == 1)
68
            if (keys)
69
              {
70
                currentModifiers |= 0X0010;
71
                goto doCharacter;
72
              }
73
        }
74
    }
75
  return command;
76
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.