1*b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */ 27cff82f5SDavid S. Miller #ifndef _OPCODES_H 37cff82f5SDavid S. Miller #define _OPCODES_H 47cff82f5SDavid S. Miller 510803624SDavid S. Miller #define SPARC_CR_OPCODE_PRIORITY 300 610803624SDavid S. Miller 77cff82f5SDavid S. Miller #define F3F(x,y,z) (((x)<<30)|((y)<<19)|((z)<<5)) 87cff82f5SDavid S. Miller 97cff82f5SDavid S. Miller #define FPD_ENCODE(x) (((x) >> 5) | ((x) & ~(0x20))) 107cff82f5SDavid S. Miller 117cff82f5SDavid S. Miller #define RS1(x) (FPD_ENCODE(x) << 14) 127cff82f5SDavid S. Miller #define RS2(x) (FPD_ENCODE(x) << 0) 137cff82f5SDavid S. Miller #define RS3(x) (FPD_ENCODE(x) << 9) 147cff82f5SDavid S. Miller #define RD(x) (FPD_ENCODE(x) << 25) 157cff82f5SDavid S. Miller #define IMM5_0(x) ((x) << 0) 167cff82f5SDavid S. Miller #define IMM5_9(x) ((x) << 9) 177cff82f5SDavid S. Miller 187cff82f5SDavid S. Miller #define CRC32C(a,b,c) \ 197cff82f5SDavid S. Miller .word (F3F(2,0x36,0x147)|RS1(a)|RS2(b)|RD(c)); 207cff82f5SDavid S. Miller 217cff82f5SDavid S. Miller #define MD5 \ 227cff82f5SDavid S. Miller .word 0x81b02800; 237cff82f5SDavid S. Miller #define SHA1 \ 247cff82f5SDavid S. Miller .word 0x81b02820; 257cff82f5SDavid S. Miller #define SHA256 \ 267cff82f5SDavid S. Miller .word 0x81b02840; 277cff82f5SDavid S. Miller #define SHA512 \ 287cff82f5SDavid S. Miller .word 0x81b02860; 297cff82f5SDavid S. Miller 307cff82f5SDavid S. Miller #define AES_EROUND01(a,b,c,d) \ 317cff82f5SDavid S. Miller .word (F3F(2, 0x19, 0)|RS1(a)|RS2(b)|RS3(c)|RD(d)); 327cff82f5SDavid S. Miller #define AES_EROUND23(a,b,c,d) \ 337cff82f5SDavid S. Miller .word (F3F(2, 0x19, 1)|RS1(a)|RS2(b)|RS3(c)|RD(d)); 347cff82f5SDavid S. Miller #define AES_DROUND01(a,b,c,d) \ 357cff82f5SDavid S. Miller .word (F3F(2, 0x19, 2)|RS1(a)|RS2(b)|RS3(c)|RD(d)); 367cff82f5SDavid S. Miller #define AES_DROUND23(a,b,c,d) \ 377cff82f5SDavid S. Miller .word (F3F(2, 0x19, 3)|RS1(a)|RS2(b)|RS3(c)|RD(d)); 387cff82f5SDavid S. Miller #define AES_EROUND01_L(a,b,c,d) \ 397cff82f5SDavid S. Miller .word (F3F(2, 0x19, 4)|RS1(a)|RS2(b)|RS3(c)|RD(d)); 407cff82f5SDavid S. Miller #define AES_EROUND23_L(a,b,c,d) \ 417cff82f5SDavid S. Miller .word (F3F(2, 0x19, 5)|RS1(a)|RS2(b)|RS3(c)|RD(d)); 427cff82f5SDavid S. Miller #define AES_DROUND01_L(a,b,c,d) \ 437cff82f5SDavid S. Miller .word (F3F(2, 0x19, 6)|RS1(a)|RS2(b)|RS3(c)|RD(d)); 447cff82f5SDavid S. Miller #define AES_DROUND23_L(a,b,c,d) \ 457cff82f5SDavid S. Miller .word (F3F(2, 0x19, 7)|RS1(a)|RS2(b)|RS3(c)|RD(d)); 467cff82f5SDavid S. Miller #define AES_KEXPAND1(a,b,c,d) \ 477cff82f5SDavid S. Miller .word (F3F(2, 0x19, 8)|RS1(a)|RS2(b)|IMM5_9(c)|RD(d)); 487cff82f5SDavid S. Miller #define AES_KEXPAND0(a,b,c) \ 497cff82f5SDavid S. Miller .word (F3F(2, 0x36, 0x130)|RS1(a)|RS2(b)|RD(c)); 507cff82f5SDavid S. Miller #define AES_KEXPAND2(a,b,c) \ 517cff82f5SDavid S. Miller .word (F3F(2, 0x36, 0x131)|RS1(a)|RS2(b)|RD(c)); 527cff82f5SDavid S. Miller 537cff82f5SDavid S. Miller #define DES_IP(a,b) \ 547cff82f5SDavid S. Miller .word (F3F(2, 0x36, 0x134)|RS1(a)|RD(b)); 557cff82f5SDavid S. Miller #define DES_IIP(a,b) \ 567cff82f5SDavid S. Miller .word (F3F(2, 0x36, 0x135)|RS1(a)|RD(b)); 577cff82f5SDavid S. Miller #define DES_KEXPAND(a,b,c) \ 587cff82f5SDavid S. Miller .word (F3F(2, 0x36, 0x136)|RS1(a)|IMM5_0(b)|RD(c)); 597cff82f5SDavid S. Miller #define DES_ROUND(a,b,c,d) \ 607cff82f5SDavid S. Miller .word (F3F(2, 0x19, 0x009)|RS1(a)|RS2(b)|RS3(c)|RD(d)); 617cff82f5SDavid S. Miller 627cff82f5SDavid S. Miller #define CAMELLIA_F(a,b,c,d) \ 637cff82f5SDavid S. Miller .word (F3F(2, 0x19, 0x00c)|RS1(a)|RS2(b)|RS3(c)|RD(d)); 647cff82f5SDavid S. Miller #define CAMELLIA_FL(a,b,c) \ 657cff82f5SDavid S. Miller .word (F3F(2, 0x36, 0x13c)|RS1(a)|RS2(b)|RD(c)); 667cff82f5SDavid S. Miller #define CAMELLIA_FLI(a,b,c) \ 677cff82f5SDavid S. Miller .word (F3F(2, 0x36, 0x13d)|RS1(a)|RS2(b)|RD(c)); 687cff82f5SDavid S. Miller 697cff82f5SDavid S. Miller #define MOVDTOX_F0_O4 \ 707cff82f5SDavid S. Miller .word 0x99b02200 717cff82f5SDavid S. Miller #define MOVDTOX_F2_O5 \ 727cff82f5SDavid S. Miller .word 0x9bb02202 737cff82f5SDavid S. Miller #define MOVXTOD_G1_F60 \ 747cff82f5SDavid S. Miller .word 0xbbb02301 757cff82f5SDavid S. Miller #define MOVXTOD_G1_F62 \ 767cff82f5SDavid S. Miller .word 0xbfb02301 777cff82f5SDavid S. Miller #define MOVXTOD_G3_F4 \ 787cff82f5SDavid S. Miller .word 0x89b02303; 797cff82f5SDavid S. Miller #define MOVXTOD_G7_F6 \ 807cff82f5SDavid S. Miller .word 0x8db02307; 817cff82f5SDavid S. Miller #define MOVXTOD_G3_F0 \ 827cff82f5SDavid S. Miller .word 0x81b02303; 837cff82f5SDavid S. Miller #define MOVXTOD_G7_F2 \ 847cff82f5SDavid S. Miller .word 0x85b02307; 857cff82f5SDavid S. Miller #define MOVXTOD_O0_F0 \ 867cff82f5SDavid S. Miller .word 0x81b02308; 877cff82f5SDavid S. Miller #define MOVXTOD_O5_F0 \ 887cff82f5SDavid S. Miller .word 0x81b0230d; 897cff82f5SDavid S. Miller #define MOVXTOD_O5_F2 \ 907cff82f5SDavid S. Miller .word 0x85b0230d; 917cff82f5SDavid S. Miller #define MOVXTOD_O5_F4 \ 927cff82f5SDavid S. Miller .word 0x89b0230d; 937cff82f5SDavid S. Miller #define MOVXTOD_O5_F6 \ 947cff82f5SDavid S. Miller .word 0x8db0230d; 957cff82f5SDavid S. Miller #define MOVXTOD_G3_F60 \ 967cff82f5SDavid S. Miller .word 0xbbb02303; 977cff82f5SDavid S. Miller #define MOVXTOD_G7_F62 \ 987cff82f5SDavid S. Miller .word 0xbfb02307; 997cff82f5SDavid S. Miller 1007cff82f5SDavid S. Miller #endif /* _OPCODES_H */ 101