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

Subversion Repositories 1664

[/] [1664/] [trunk/] [c/] [cpu_1664/] [cpu_1664_opera__shr.c] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 mrdmkg
#include "cpu_1664.h"
2
 
3
void cpu_1664_opera__shr(struct cpu_1664 *cpu, n1 bait)
4
{
5
 cpu->opera_sicle=cpu_1664_sicle_opera_shr;
6
 n1 sinia_destina=bait&((1<<cpu_1664_bitio_rd)-1);
7
 n1 sinia_fonte=bait>>cpu_1664_bitio_rd;
8
 cpu_1664_sinia_t dest=cpu->sinia[sinia_destina];
9
 cpu_1664_sinia_t desloca;
10
 n1 bool_depende_c=0;
11
 
12
 if(sinia_destina==sinia_fonte)
13
 {
14
  desloca=1;
15
 }
16
 else
17
 {
18
  desloca=cpu->sinia[sinia_fonte]&((sizeof(cpu_1664_sinia_t)*8)-1);
19
 }
20
 
21
 if(desloca!=0)
22
 {
23
  nN i;
24
  for(i=desloca-1;i>31;i-=31)
25
  {
26
   dest>>=31;
27
  }
28
  dest>>=i;
29
 
30
  bool_depende_c=dest&1;
31
  dest>>=1;
32
 }
33
 
34
 cpu->sinia[bait&((1<<cpu_1664_bitio_rd)-1)]=dest;
35
 
36
 if (cpu->depende[cpu_1664_depende_bitio_depende_influe]!=0)
37
 {
38
  cpu->depende[cpu_1664_depende_c] = bool_depende_c;
39
  cpu->depende[cpu_1664_depende_z] = dest==0;
40
  cpu->depende[cpu_1664_depende_n] = cpu->depende[cpu_1664_depende_z]==0;
41
 }
42
}

powered by: WebSVN 2.1.0

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