-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrnd.isa
53 lines (50 loc) · 1.36 KB
/
rnd.isa
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
#ifndef _RND_ISA_
#define _RND_ISA_
#define rnd(a, b, c, d, e, f, g, h, k, t0, t1) \
; rnd begin;; \
; a, b, c, d, e, f, g, h, k, t0, t1;; \
\
v_alignbit_b32 t0, e, e, 6;; \
v_alignbit_b32 t1, e, e, 11;; \
v_xor_b32 t0, t0, t1;; \
v_alignbit_b32 t1, e, e, 25;; \
v_xor_b32 t0, t0, t1;; \
v_add_i32 h, h, t0;; \
\
v_bfi_b32 t0, e, f, g;; \
v_add_i32 h, h, t0;; \
v_add_i32 h, k, h;; \
v_add_i32 d, d, h;; \
\
v_alignbit_b32 t0, a, a, 2;; \
v_alignbit_b32 t1, a, a, 13;; \
v_xor_b32 t0, t0, t1;; \
v_alignbit_b32 t1, a, a, 22;; \
v_xor_b32 t0, t0, t1;; \
v_add_i32 h, h, t0;; \
\
v_xor_b32 t0, a, c;; \
v_bfi_b32 t1, t0, b, c;; \
v_add_i32 h, h, t1;; \
; rnd end
#define wr(a, b, c, d, t0, t1) \
; wr begin;; \
; a, b, c, d, t0, t1;; \
v_alignbit_b32 t0, b, b, 17;; \
v_alignbit_b32 t1, b, b, 19;; \
v_xor_b32 t0, t0, t1;; \
v_lshrrev_b32 t1, 10, b;; \
v_xor_b32 t0, t0, t1;; \
v_add_i32 a, a, t0;; \
\
v_add_i32 a, c, a;; \
\
v_alignbit_b32 t0, d, d, 7;; \
v_alignbit_b32 t1, d, d, 18;; \
v_xor_b32 t0, t0, t1;; \
v_lshrrev_b32 t1, 3, d;; \
v_xor_b32 t0, t0, t1;; \
v_add_i32 a, a, t0;; \
\
; wr end
#endif