RECIP_IEEE.

This commit is contained in:
Ben Vanik 2014-01-19 11:07:12 -08:00
parent cb3f2308af
commit 55fe3aca05
2 changed files with 29 additions and 1 deletions

10
docs/gpu.md Normal file
View File

@ -0,0 +1,10 @@
# GPU Documentation
## References
### Command Buffer/Registers
### Shaders
* [LLVM R600 Tables](https://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/R600/R600Instructions.td)
** The opcode formats don't match, but the name->psuedo code is correct.

View File

@ -1242,6 +1242,24 @@ int TranslateALU_SETNEs(
return TranslateALU_SETXXs(ctx, alu, "!="); return TranslateALU_SETXXs(ctx, alu, "!=");
} }
int TranslateALU_RECIP_IEEE(
xe_gpu_translate_ctx_t& ctx, const instr_alu_t& alu) {
AppendDestReg(ctx, alu.scalar_dest, alu.scalar_write_mask, alu.export_data);
ctx.output->append(" = ");
if (alu.scalar_clamp) {
ctx.output->append("saturate(");
}
ctx.output->append("(1.0 / ");
AppendSrcReg(ctx, alu.src3_reg, alu.src3_sel, alu.src3_swiz, alu.src3_reg_negate, alu.src3_reg_abs);
ctx.output->append(")");
if (alu.scalar_clamp) {
ctx.output->append(")");
}
ctx.output->append(";\n");
AppendDestRegPost(ctx, alu.scalar_dest, alu.scalar_write_mask, alu.export_data);
return 0;
}
int TranslateALU_MUL_CONST_0( int TranslateALU_MUL_CONST_0(
xe_gpu_translate_ctx_t& ctx, const instr_alu_t& alu) { xe_gpu_translate_ctx_t& ctx, const instr_alu_t& alu) {
AppendDestReg(ctx, alu.scalar_dest, alu.scalar_write_mask, alu.export_data); AppendDestReg(ctx, alu.scalar_dest, alu.scalar_write_mask, alu.export_data);
@ -1392,7 +1410,7 @@ static xe_gpu_translate_alu_info_t scalar_alu_instrs[0x40] = {
ALU_INSTR(LOG_IEEE, 1), // 16 ALU_INSTR(LOG_IEEE, 1), // 16
ALU_INSTR(RECIP_CLAMP, 1), // 17 ALU_INSTR(RECIP_CLAMP, 1), // 17
ALU_INSTR(RECIP_FF, 1), // 18 ALU_INSTR(RECIP_FF, 1), // 18
ALU_INSTR(RECIP_IEEE, 1), // 19 ALU_INSTR_IMPL(RECIP_IEEE, 1), // 19
ALU_INSTR(RECIPSQ_CLAMP, 1), // 20 ALU_INSTR(RECIPSQ_CLAMP, 1), // 20
ALU_INSTR(RECIPSQ_FF, 1), // 21 ALU_INSTR(RECIPSQ_FF, 1), // 21
ALU_INSTR(RECIPSQ_IEEE, 1), // 22 ALU_INSTR(RECIPSQ_IEEE, 1), // 22