History

Remap registers to avoid clobbering the neon registers q4-q7

According to the calling convention, the registers q4-q7 should be preserved by functions. The caller (generated by the compiler) could be using those registers anywhere for any intermediate data. Functions that use 12 or less of the qX registers can avoid violating the calling convention by simply using other registers instead of the callee saved registers q4-q7. This change only remaps the registers used within functions - therefore this does not affect performance at all. E.g. in functions using registers q0-q7, we now use q0-q3 and q8-q11 instead.

Martin Storsjö committed 12 years ago

Commit 811c6471 parent ca457f59 files · +513 −513Browse files

Showing the changes to codec/processing/src (2 of 9 files). Show all

Unified · Split

2 files
  1. codec/processing/src/arm/down_sample_neon.S +3 −3
  2. codec/processing/src/arm/vaa_calc_neon.S +5 −5
codec/processing/src/arm/down_sample_neon.S+3−3
@@ -257,10 +257,10 @@ WELS_ASM_FUNC_BEGIN GeneralBilinearAccurateDownsampler_neon · 256 unmodified lines
257257 vdup.s32 d1, r11; //init u 16384 16383 16384 16383
258258
259259 mov r11, #16384
260− vdup.s16 d8, r11
260+ vdup.s16 d16, r11
261261 sub r11, #1
262− vdup.s16 d9, r11
263− vext.8 d7, d9, d8, #4 //init v 16384 16384 16383 16383
262+ vdup.s16 d17, r11
263+ vext.8 d7, d17, d16, #4 //init v 16384 16384 16383 16383
264264
265265 veor q14, q14
266266 sub r1, r2 // stride - width
codec/processing/src/arm/vaa_calc_neon.S+5−5
@@ -103,8 +103,8 @@ WELS_ASM_FUNC_BEGIN VAACalcSad_neon · 102 unmodified lines
103103 ldr r4, [sp, #20] //load pic_stride
104104 ldr r5, [sp, #28] //load psad8x8
105105
106− //Initial the Q4 register for save the "psadframe"
107− vmov.s64 q4, #0
106+ //Initial the Q8 register for save the "psadframe"
107+ vmov.s64 q8, #0
108108
109109 //Get the jump distance to use on loop codes
110110 lsl r8, r4, #4
@@ -140,7 +140,7 @@ vaa_calc_sad_loop1: · 29 unmodified lines
140140
141141 //Save to calculate "psadframe"
142142 vadd.u32 q0, q1
143− vadd.u32 q4, q0
143+ vadd.u32 q8, q0
144144
145145 bne vaa_calc_sad_loop1
146146
@@ -152,8 +152,8 @@ vaa_calc_sad_loop1: · 5 unmodified lines
152152 bne vaa_calc_sad_loop0
153153
154154 ldr r6, [sp, #24] //load psadframe
155− vadd.u32 d8, d9
156− vst1.32 {d8[0]}, [r6]
155+ vadd.u32 d16, d17
156+ vst1.32 {d16[0]}, [r6]
157157
158158 ldmia sp!, {r4-r8}
159159

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t