Details
Details
- Reviewers
emaste - Commits
- rS318601: [libcompiler-rt] add bswapdi2/bswapsi2
Diff Detail
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Comment Actions
LGTM, we should upstream the contrib part, though. Unfortunately llvm.org is down at the moment...
Comment Actions
I'm fine with this so that we can unblock MIPS w/ xGCC, but would hope we can replace it with a better asm version in the future. Depending on the MIPS ISA we target I suspect there's no huge gain to be had , but there some clever tricks might save a couple of instructions.
Comment Actions
Using -target mips-freebsd, the assembly produced for e.g. bswapsi2.c is:
__bswapsi2: # @__bswapsi2 .frame $fp,8,$ra .mask 0x40000000,-4 .fmask 0x00000000,0 .set noreorder .set nomacro .set noat # BB#0: # %entry addiu $sp, $sp, -8 sw $fp, 4($sp) # 4-byte Folded Spill move $fp, $sp wsbh $1, $4 rotr $2, $1, 16 move $sp, $fp lw $fp, 4($sp) # 4-byte Folded Reload jr $ra addiu $sp, $sp, 8 .set at .set macro .set reorder .end __bswapsi2 $func_end0: .size __bswapsi2, ($func_end0)-__bswapsi2
I'm not a mips expert, but it looks pretty OK to me... :)