 Chromium Code Reviews
 Chromium Code Reviews Issue 2521263002:
  [MIPS] Remove explicit masks from assembly code  (Closed)
    
  
    Issue 2521263002:
  [MIPS] Remove explicit masks from assembly code  (Closed) 
  | Index: pnacl/support/setjmp_mips32.S | 
| diff --git a/pnacl/support/setjmp_mips32.S b/pnacl/support/setjmp_mips32.S | 
| index 3a906f47343a3fb4b115aefc7d818c9c30a1ceca..e7bd719de3bbb6c62b1ac6e6a456da91045897f5 100644 | 
| --- a/pnacl/support/setjmp_mips32.S | 
| +++ b/pnacl/support/setjmp_mips32.S | 
| @@ -20,77 +20,40 @@ setjmp: | 
| /* The code here is grouped by instruction bundle. */ | 
| 
Mark Seaborn
2016/11/22 19:41:40
You should remove this comment.
 
petarj
2016/11/23 16:04:17
Done.
 | 
| /* NACL_CALLEE_SAVE_LIST BEGIN */ | 
| - and $a0, $a0, STORE_MASK | 
| - sw $s0, 0($a0) | 
| - and $a0, $a0, STORE_MASK | 
| - sw $s1, 4($a0) | 
| - | 
| - and $a0, $a0, STORE_MASK | 
| - sw $s2, 8($a0) | 
| - and $a0, $a0, STORE_MASK | 
| - sw $s3, 12($a0) | 
| - | 
| - and $a0, $a0, STORE_MASK | 
| - sw $s4, 16($a0) | 
| - and $a0, $a0, STORE_MASK | 
| - sw $s5, 20($a0) | 
| - | 
| - and $a0, $a0, STORE_MASK | 
| - sw $s6, 24($a0) | 
| - and $a0, $a0, STORE_MASK | 
| - sw $s7, 28($a0) | 
| - | 
| - and $a0, $a0, STORE_MASK | 
| - sw $sp, 32($a0) | 
| - and $a0, $a0, STORE_MASK | 
| - sw $fp, 36($a0) | 
| - | 
| - and $a0, $a0, STORE_MASK | 
| - sw $ra, 40($a0) | 
| - and $a0, $a0, STORE_MASK | 
| + sw $s0, 0($a0) | 
| + sw $s1, 4($a0) | 
| + sw $s2, 8($a0) | 
| + sw $s3, 12($a0) | 
| + sw $s4, 16($a0) | 
| + sw $s5, 20($a0) | 
| + sw $s6, 24($a0) | 
| + sw $s7, 28($a0) | 
| + sw $sp, 32($a0) | 
| + sw $fp, 36($a0) | 
| + sw $ra, 40($a0) | 
| swc1 $f20, 44($a0) | 
| - | 
| - and $a0, $a0, STORE_MASK | 
| swc1 $f21, 48($a0) | 
| - and $a0, $a0, STORE_MASK | 
| swc1 $f22, 52($a0) | 
| - | 
| - and $a0, $a0, STORE_MASK | 
| swc1 $f23, 56($a0) | 
| - and $a0, $a0, STORE_MASK | 
| swc1 $f24, 60($a0) | 
| - | 
| - and $a0, $a0, STORE_MASK | 
| swc1 $f25, 64($a0) | 
| - and $a0, $a0, STORE_MASK | 
| swc1 $f26, 68($a0) | 
| - | 
| - and $a0, $a0, STORE_MASK | 
| swc1 $f27, 72($a0) | 
| - and $a0, $a0, STORE_MASK | 
| swc1 $f28, 76($a0) | 
| - | 
| - and $a0, $a0, STORE_MASK | 
| swc1 $f29, 80($a0) | 
| - and $a0, $a0, STORE_MASK | 
| swc1 $f30, 84($a0) | 
| - | 
| - and $a0, $a0, STORE_MASK | 
| swc1 $f31, 88($a0) | 
| /* NACL_CALLEE_SAVE_LIST END */ | 
| - move $v0, $zero | 
| + move $v0, $zero | 
| nop | 
| - | 
| - and $ra, $ra, JUMP_MASK | 
| j $ra | 
| nop | 
| - nop | 
| .end setjmp | 
| .text | 
| .p2align 4 | 
| - .align NACL_BLOCK_SHIFT | 
| + .align 4 | 
| 
Mark Seaborn
2016/11/22 19:41:40
Code above still has NACL_BLOCK_SHIFT.  I suggest
 
petarj
2016/11/23 16:04:17
Done.
 | 
| .globl longjmp | 
| .ent longjmp | 
| .set noreorder | 
| @@ -99,64 +62,29 @@ setjmp: | 
| longjmp: | 
| /* NACL_CALLEE_LOAD_LIST BEGIN */ | 
| - and $a0, $a0, STORE_MASK | 
| - lw $s0, 0($a0) | 
| - and $a0, $a0, STORE_MASK | 
| - lw $s1, 4($a0) | 
| - | 
| - and $a0, $a0, STORE_MASK | 
| - lw $s2, 8($a0) | 
| - and $a0, $a0, STORE_MASK | 
| - lw $s3, 12($a0) | 
| - | 
| - and $a0, $a0, STORE_MASK | 
| - lw $s4, 16($a0) | 
| - and $a0, $a0, STORE_MASK | 
| - lw $s5, 20($a0) | 
| - | 
| - and $a0, $a0, STORE_MASK | 
| - lw $s6, 24($a0) | 
| - and $a0, $a0, STORE_MASK | 
| - lw $s7, 28($a0) | 
| - | 
| - and $a0, $a0, STORE_MASK | 
| - lw $sp, 32($a0) | 
| - and $sp, $sp, STORE_MASK | 
| + lw $s0, 0($a0) | 
| + lw $s1, 4($a0) | 
| + lw $s2, 8($a0) | 
| + lw $s3, 12($a0) | 
| + lw $s4, 16($a0) | 
| + lw $s5, 20($a0) | 
| + lw $s6, 24($a0) | 
| + lw $s7, 28($a0) | 
| + lw $sp, 32($a0) | 
| nop | 
| 
Mark Seaborn
2016/11/22 19:41:40
Not needed now?
 
petarj
2016/11/23 16:04:17
Done.
 | 
| - | 
| - and $a0, $a0, STORE_MASK | 
| - lw $fp, 36($a0) | 
| - and $a0, $a0, STORE_MASK | 
| - lw $ra, 40($a0) | 
| - | 
| - and $a0, $a0, STORE_MASK | 
| + lw $fp, 36($a0) | 
| + lw $ra, 40($a0) | 
| lwc1 $f20, 44($a0) | 
| - and $a0, $a0, STORE_MASK | 
| lwc1 $f21, 48($a0) | 
| - | 
| - and $a0, $a0, STORE_MASK | 
| lwc1 $f22, 52($a0) | 
| - and $a0, $a0, STORE_MASK | 
| lwc1 $f23, 56($a0) | 
| - | 
| - and $a0, $a0, STORE_MASK | 
| lwc1 $f24, 60($a0) | 
| - and $a0, $a0, STORE_MASK | 
| lwc1 $f25, 64($a0) | 
| - | 
| - and $a0, $a0, STORE_MASK | 
| lwc1 $f26, 68($a0) | 
| - and $a0, $a0, STORE_MASK | 
| lwc1 $f27, 72($a0) | 
| - | 
| - and $a0, $a0, STORE_MASK | 
| lwc1 $f28, 76($a0) | 
| - and $a0, $a0, STORE_MASK | 
| lwc1 $f29, 80($a0) | 
| - | 
| - and $a0, $a0, STORE_MASK | 
| lwc1 $f30, 84($a0) | 
| - and $a0, $a0, STORE_MASK | 
| lwc1 $f31, 88($a0) | 
| /* NACL_CALLEE_LOAD_LIST END */ | 
| @@ -165,8 +93,6 @@ longjmp: | 
| ori $a1, $zero, 1 | 
| 1: | 
| move $v0, $a1 | 
| - | 
| - and $ra, $ra, JUMP_MASK | 
| j $ra | 
| nop | 
| nop |