diff options
| author | Charles.Forsyth <devnull@localhost> | 2006-12-22 17:07:39 +0000 |
|---|---|---|
| committer | Charles.Forsyth <devnull@localhost> | 2006-12-22 17:07:39 +0000 |
| commit | 37da2899f40661e3e9631e497da8dc59b971cbd0 (patch) | |
| tree | cbc6d4680e347d906f5fa7fca73214418741df72 /libkern/strncmp-power.s | |
| parent | 54bc8ff236ac10b3eaa928fd6bcfc0cdb2ba46ae (diff) | |
20060303a
Diffstat (limited to 'libkern/strncmp-power.s')
| -rw-r--r-- | libkern/strncmp-power.s | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/libkern/strncmp-power.s b/libkern/strncmp-power.s new file mode 100644 index 00000000..c55962fa --- /dev/null +++ b/libkern/strncmp-power.s @@ -0,0 +1,29 @@ +TEXT strncmp(SB), $0 +#define BDNZ BC 16,0, + + MOVW s2+4(FP), R4 + MOVW n+8(FP), R7 + + CMP R7, $0 + MOVW R7, CTR + BLE eq + + SUB $1, R3 + SUB $1, R4 +l1: + MOVBZU 1(R3), R5 + MOVBZU 1(R4), R6 + CMP R5, R6 + BNE ne + CMP R5, $0 + BEQ eq + BDNZ l1 +eq: + MOVW $0, R3 + RETURN +ne: + MOVW $1, R3 + BGT ret + MOVW $-1, R3 +ret: + RETURN |
