opcodes.h 4.81 KB
Newer Older
1 2 3
UNARY_SB(absb, "ORC_ABS(%s)")
BINARY_SB(addb, "%s + %s")
BINARY_SB(addssb, "ORC_CLAMP_SB(%s + %s)")
4
BINARY_UB(addusb, "ORC_CLAMP_UB((orc_uint8)%s + (orc_uint8)%s)")
5
BINARY_SB(andb, "%s & %s")
6
BINARY_SB(andnb, "(~%s) & %s")
7
BINARY_SB(avgsb, "(%s + %s + 1)>>1")
8
BINARY_UB(avgub, "((orc_uint8)%s + (orc_uint8)%s + 1)>>1")
9 10 11 12
BINARY_SB(cmpeqb, "(%s == %s) ? (~0) : 0")
BINARY_SB(cmpgtsb, "(%s > %s) ? (~0) : 0")
UNARY_SB(copyb, "%s")
BINARY_SB(maxsb, "ORC_MAX(%s, %s)")
13
BINARY_UB(maxub, "ORC_MAX((orc_uint8)%s, (orc_uint8)%s)")
14
BINARY_SB(minsb, "ORC_MIN(%s, %s)")
15
BINARY_UB(minub, "ORC_MIN((orc_uint8)%s, (orc_uint8)%s)")
16 17
BINARY_SB(mullb, "(%s * %s) & 0xff")
BINARY_SB(mulhsb, "(%s * %s) >> 8")
18
BINARY_UB(mulhub, "((orc_uint32)(orc_uint8)%s * (orc_uint32)(orc_uint8)%s) >> 8")
19 20 21
BINARY_SB(orb, "%s | %s")
BINARY_SB(shlb, "%s << %s")
BINARY_SB(shrsb, "%s >> %s")
22
BINARY_UB(shrub, "((orc_uint8)%s) >> %s")
23 24 25
UNARY_SB(signb, "ORC_CLAMP(%s,-1,1)")
BINARY_SB(subb, "%s - %s")
BINARY_SB(subssb, "ORC_CLAMP_SB(%s - %s)")
26
BINARY_UB(subusb, "ORC_CLAMP_UB((orc_uint8)%s - (orc_uint8)%s)")
27 28 29 30 31
BINARY_SB(xorb, "%s ^ %s")

UNARY_SW(absw, "ORC_ABS(%s)")
BINARY_SW(addw, "%s + %s")
BINARY_SW(addssw, "ORC_CLAMP_SW(%s + %s)")
32
BINARY_UW(addusw, "ORC_CLAMP_UW((orc_uint16)%s + (orc_uint16)%s)")
33
BINARY_SW(andw, "%s & %s")
34
BINARY_SW(andnw, "(~%s) & %s")
35
BINARY_SW(avgsw, "(%s + %s + 1)>>1")
36
BINARY_UW(avguw, "((orc_uint16)%s + (orc_uint16)%s + 1)>>1")
37 38 39 40
BINARY_SW(cmpeqw, "(%s == %s) ? (~0) : 0")
BINARY_SW(cmpgtsw, "(%s > %s) ? (~0) : 0")
UNARY_SW(copyw, "%s")
BINARY_SW(maxsw, "ORC_MAX(%s, %s)")
41
BINARY_UW(maxuw, "ORC_MAX((orc_uint16)%s, (orc_uint16)%s)")
42
BINARY_SW(minsw, "ORC_MIN(%s, %s)")
43
BINARY_UW(minuw, "ORC_MIN((orc_uint16)%s, (orc_uint16)%s)")
44 45
BINARY_SW(mullw, "(%s * %s) & 0xffff")
BINARY_SW(mulhsw, "(%s * %s) >> 16")
46
BINARY_UW(mulhuw, "((orc_uint32)((orc_uint16)%s) * (orc_uint32)((orc_uint16)%s)) >> 16")
47 48 49
BINARY_SW(orw, "%s | %s")
BINARY_SW(shlw, "%s << %s")
BINARY_SW(shrsw, "%s >> %s")
50
BINARY_UW(shruw, "((orc_uint16)%s) >> %s")
51 52 53
UNARY_SW(signw, "ORC_CLAMP(%s,-1,1)")
BINARY_SW(subw, "%s - %s")
BINARY_SW(subssw, "ORC_CLAMP_SW(%s - %s)")
54
BINARY_UW(subusw, "ORC_CLAMP_UW((orc_uint16)%s - (orc_uint16)%s)")
55 56 57 58
BINARY_SW(xorw, "%s ^ %s")

UNARY_SL(absl, "ORC_ABS(%s)")
BINARY_SL(addl, "%s + %s")
59 60
BINARY_SL(addssl, "ORC_CLAMP_SL((orc_int64)%s + (orc_int64)%s)")
BINARY_UL(addusl, "ORC_CLAMP_UL((orc_int64)(orc_uint32)%s + (orc_int64)(orc_uint32)%s)")
61
BINARY_SL(andl, "%s & %s")
62
BINARY_SL(andnl, "(~%s) & %s")
63 64
BINARY_SL(avgsl, "((orc_int64)%s + (orc_int64)%s + 1)>>1")
BINARY_UL(avgul, "((orc_uint64)(orc_uint32)%s + (orc_uint64)(orc_uint32)%s + 1)>>1")
65 66 67 68
BINARY_SL(cmpeql, "(%s == %s) ? (~0) : 0")
BINARY_SL(cmpgtsl, "(%s > %s) ? (~0) : 0")
UNARY_SL(copyl, "%s")
BINARY_SL(maxsl, "ORC_MAX(%s, %s)")
69
BINARY_UL(maxul, "ORC_MAX((orc_uint32)%s, (orc_uint32)%s)")
70
BINARY_SL(minsl, "ORC_MIN(%s, %s)")
71
BINARY_UL(minul, "ORC_MIN((orc_uint32)%s, (orc_uint32)%s)")
72
BINARY_SL(mulll, "(%s * %s) & 0xffffffff")
73 74
BINARY_SL(mulhsl, "((orc_int64)%s * (orc_int64)%s) >> 32")
BINARY_UL(mulhul, "((orc_uint64)%s * (orc_uint64)%s) >> 32")
75 76 77
BINARY_SL(orl, "%s | %s")
BINARY_SL(shll, "%s << %s")
BINARY_SL(shrsl, "%s >> %s")
78
BINARY_UL(shrul, "((orc_uint32)%s) >> %s")
79 80
UNARY_SL(signl, "ORC_CLAMP(%s,-1,1)")
BINARY_SL(subl, "%s - %s")
81 82
BINARY_SL(subssl, "ORC_CLAMP_SL((orc_int64)%s - (orc_int64)%s)")
BINARY_UL(subusl, "ORC_CLAMP_UL((orc_int64)(orc_uint32)%s - (orc_int64)(orc_uint32)%s)")
83 84
BINARY_SL(xorl, "%s ^ %s")

85
UNARY_BW(convsbw, "%s")
86
UNARY_BW(convubw, "(orc_uint8)%s")
87
UNARY_WL(convswl, "%s")
88
UNARY_WL(convuwl, "(orc_uint16)%s")
89 90 91
UNARY_WB(convwb, "%s")
UNARY_WB(convssswb, "ORC_CLAMP_SB(%s)")
UNARY_WB(convsuswb, "ORC_CLAMP_UB(%s)")
92 93
UNARY_WB(convusswb, "ORC_CLAMP_SB((orc_uint16)%s)")
UNARY_WB(convuuswb, "ORC_CLAMP_UB((orc_uint16)%s)")
94 95 96
UNARY_LW(convlw, "%s")
UNARY_LW(convssslw, "ORC_CLAMP_SW(%s)")
UNARY_LW(convsuslw, "ORC_CLAMP_UW(%s)")
97 98
UNARY_LW(convusslw, "ORC_CLAMP_SW((orc_uint32)%s)")
UNARY_LW(convuuslw, "ORC_CLAMP_UW((orc_uint32)%s)")
99 100

BINARY_BW(mulsbw, "%s * %s")
101
BINARY_BW(mulubw, "(orc_uint8)%s * (orc_uint8)%s")
102
BINARY_WL(mulswl, "%s * %s")
103
BINARY_WL(muluwl, "(orc_uint16)%s * (orc_uint16)%s")
104

105 106 107 108 109 110
BINARY_WL(mergewl, "((orc_uint16)%s) | ((orc_uint16)%s << 16)")
BINARY_BW(mergebw, "((orc_uint8)%s) | ((orc_uint8)%s << 8)")
UNARY_WB(select0wb, "(orc_uint16)%s & 0xff")
UNARY_WB(select1wb, "((orc_uint16)%s >> 8)&0xff")
UNARY_LW(select0lw, "(orc_uint32)%s & 0xffff")
UNARY_LW(select1lw, "((orc_uint32)%s >> 16)&0xffff")
David Schleef's avatar
David Schleef committed
111 112 113
UNARY_UW(swapw, "ORC_SWAP_W(%s)")
UNARY_UL(swapl, "ORC_SWAP_L(%s)")

114 115 116 117 118 119 120 121 122 123
BINARY_F(addf, "%s + %s")
BINARY_F(subf, "%s - %s")
BINARY_F(mulf, "%s * %s")
BINARY_F(divf, "%s / %s")
UNARY_F(sqrtf, "sqrt(%s)")
BINARY_F(maxf, "ORC_MAX(%s,%s)")
BINARY_F(minf, "ORC_MIN(%s,%s)")
BINARY_FL(cmpeqf, "(%s == %s) ? (~0) : 0")
BINARY_FL(cmpltf, "(%s < %s) ? (~0) : 0")
BINARY_FL(cmplef, "(%s <= %s) ? (~0) : 0")
124
UNARY_FL(convfl, "(int)%s")
125 126
UNARY_LF(convlf, "%s")