summaryrefslogtreecommitdiff
path: root/examples/mt19937arorc.orc
blob: 3c6435886835b3725a19ea2d4da95c3f0a13120e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85

.function mt19937ar_mix
.dest 4 mt
.source 4 mt1
.source 4 mt2
.temp 4 y
.temp 4 t1
.temp 4 t2
.const 4 c1 1
.const 4 UPPER_MASK 0x80000000
.const 4 LOWER_MASK 0x7fffffff
.const 4 MATRIX_A 0x9908b0df


loadl t1, mt
andl t1, t1, UPPER_MASK
loadl t2, mt1
andl t2, t2, LOWER_MASK
orl y, t1, t2
andl t1, y, c1
cmpeql t1, t1, c1
andl t1, t1, MATRIX_A
shrul y, y, c1
xorl y, y, t1
xorl mt, mt2, y


.function mt19937ar_temper
.dest 4 d
.source 4 s
.temp 4 y
.temp 4 t

loadl y, s
shrul t, y, 11
xorl y, y, t
shll t, y, 7
andl t, t, 0x9d2c5680
xorl y, y, t
shll t, y, 15 
andl t, t, 0xefc60000
xorl y, y, t
shrul t, y, 18
xorl d, y, t


#.function mt19937ar_mix_temper
#.dest 4 d
#.dest 4 mt
#.source 4 mt1
#.source 4 mt2
#.temp 4 y
#.temp 4 t1
#.temp 4 t2
#.const 4 c1 1
#.const 4 UPPER_MASK 0x80000000
#.const 4 LOWER_MASK 0x7fffffff
#.const 4 MATRIX_A 0x9908b0df
#
#
#loadl t1, mt
#andl t1, t1, UPPER_MASK
#loadl t2, mt1
#andl t2, t2, LOWER_MASK
#orl y, t1, t2
#andl t1, y, c1
#cmpeql t1, t1, c1
#andl t1, t1, MATRIX_A
#shrul y, y, c1
#xorl y, y, t1
#xorl y, mt2, y
#storel mt, y
#shrul t1, y, 11
#xorl y, y, t1
#shll t1, y, 7
#andl t1, t1, 0x9d2c5680
#xorl y, y, t1
#shll t1, y, 15 
#andl t1, t1, 0xefc60000
#xorl y, y, t1
#shrul t1, y, 18
#xorl d, y, t1