27 #define decode_significance decode_significance_loongarch
29 uint8_t *significant_coeff_ctx_base,
int *
index,
int64_t last_off)
31 void *end = significant_coeff_ctx_base + max_coeff - 1;
35 uint8_t *
state = significant_coeff_ctx_base;
39 #if UNCHECKED_BITSTREAM_READER
44 "blt %[bit], %[one], 4f \n\t"
45 "add.d %[state], %[state], %[last_off] \n\t"
46 #if UNCHECKED_BITSTREAM_READER
51 "sub.d %[state], %[state], %[last_off] \n\t"
52 "add.d %[tmp0], %[state], %[minusstart] \n\t"
53 "st.w %[tmp0], %[index], 0 \n\t"
54 "bge %[bit], %[one], 5f \n\t"
55 "addi.d %[index], %[index], 4 \n\t"
57 "addi.d %[state], %[state], 1 \n\t"
58 "blt %[state], %[end], 3b \n\t"
59 "add.d %[tmp0], %[state], %[minusstart] \n\t"
60 "st.w %[tmp0], %[index], 0 \n\t"
62 "add.d %[tmp0], %[index], %[minusindex] \n\t"
63 "srli.d %[tmp0], %[tmp0], 2 \n\t"
64 : [
bit]
"=&r"(
bit), [tmp0]
"=&r"(tmp0), [tmp1]
"=&r"(tmp1), [tmp2]
"=&r"(tmp2),
65 [c_range]
"+&r"(
c->range), [c_low]
"+&r"(
c->low), [
state]
"+&r"(
state),
66 [c_bytestream]
"+&r"(
c->bytestream), [
index]
"+&r"(
index)
68 [minusstart]
"r"(minusstart), [minusindex]
"r"(minusindex),
69 [last_off]
"r"(last_off),
71 [c_bytestream_end]
"r"(
c->bytestream_end),
83 #define decode_significance_8x8 decode_significance_8x8_loongarch
86 int *
index, uint8_t *last_coeff_ctx_base,
const uint8_t *sig_off)
89 int64_t bit, tmp0, tmp1, tmp2, one = 1, end = 63, last = 0;
95 "ldx.bu %[tmp0], %[sig_off], %[last] \n\t"
96 "add.d %[state], %[tmp0], %[significant_coeff_ctx_base] \n\t"
97 #if UNCHECKED_BITSTREAM_READER
102 "blt %[bit], %[one], 4f \n\t"
103 "add.d %[tmp0], %[tables], %[flag_offset] \n\t"
104 "ldx.bu %[tmp1], %[tmp0], %[last] \n\t"
105 "add.d %[state], %[tmp1], %[last_coeff_ctx_base] \n\t"
106 #if UNCHECKED_BITSTREAM_READER
111 "st.w %[last], %[index], 0 \n\t"
112 "bge %[bit], %[one], 5f \n\t"
113 "addi.d %[index], %[index], 4 \n\t"
115 "addi.d %[last], %[last], 1 \n\t"
116 "blt %[last], %[end], 3b \n\t"
117 "st.w %[last], %[index], 0 \n\t"
119 "add.d %[tmp0], %[index], %[minusindex] \n\t"
120 "srli.d %[tmp0], %[tmp0], 2 \n\t"
121 : [
bit]
"=&r"(
bit), [tmp0]
"=&r"(tmp0), [tmp1]
"=&r"(tmp1),
122 [tmp2]
"=&r"(tmp2), [c_range]
"+&r"(
c->range),
123 [c_low]
"+&r"(
c->low), [
state]
"+&r"(
state), [last]
"+&r"(last),
124 [c_bytestream]
"+&r"(
c->bytestream), [
index]
"+&r"(
index)
126 [one]
"r"(one), [minusindex]
"r"(minusindex),
127 [last_coeff_ctx_base]
"r"(last_coeff_ctx_base),
128 [flag_offset]
"r"(flag_offset),
129 #if !UNCHECKED_BITSTREAM_READER
130 [c_bytestream_end]
"r"(
c->bytestream_end),
136 [significant_coeff_ctx_base]
"r"(significant_coeff_ctx_base)