OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [tree-ssa/] [pr33922.c] - Blame information for rev 300

Go to most recent revision | Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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