)
#define OP_IS_STORE(op) (\
- OP_IS_STORE_R26(op) || \
- op == midgard_op_st_cubemap_coords \
+ OP_IS_STORE_R26(op) \
)
#define OP_IS_PROJECTION(op) ( \
#define OP_IS_VEC4_ONLY(op) ( \
OP_IS_PROJECTION(op) || \
- op == midgard_op_st_cubemap_coords \
+ op == midgard_op_ld_cubemap_coords \
)
#define OP_IS_MOVE(op) ( \
typedef enum {
midgard_op_ld_st_noop = 0x03,
- /* Unclear why this is on the L/S unit, but (with an address of 0,
- * appropriate swizzle, magic constant 0x24, and xy mask?) moves fp32 cube
- * map coordinates in r27 to its cube map texture coordinate
- * destination (e.g r29). 0x4 magic for lding from fp16 instead */
+ /* Unclear why this is on the L/S unit, but moves fp32 cube map
+ * coordinates in r27 to its cube map texture coordinate destination
+ * (e.g r29). */
- midgard_op_st_cubemap_coords = 0x0E,
+ midgard_op_ld_cubemap_coords = 0x0E,
/* Loads a global/local/group ID, depending on arguments */
midgard_op_ld_compute_id = 0x10,
M_LOAD(ld_color_buffer_8);
//M_STORE(st_vary_16);
M_STORE(st_vary_32);
-M_LOAD(st_cubemap_coords);
+M_LOAD(ld_cubemap_coords);
M_LOAD(ld_compute_id);
static midgard_instruction
* texture register */
unsigned temp = make_compiler_temp(ctx);
- midgard_instruction st = m_st_cubemap_coords(temp, 0);
- st.ssa_args.src[0] = index;
- st.mask = 0x3; /* xy */
- st.load_store.arg_1 = 0x20;
- st.load_store.swizzle = alu_src.swizzle;
- emit_mir_instruction(ctx, st);
+ midgard_instruction ld = m_ld_cubemap_coords(temp, 0);
+ ld.ssa_args.src[0] = index;
+ ld.mask = 0x3; /* xy */
+ ld.load_store.arg_1 = 0x20;
+ ld.load_store.swizzle = alu_src.swizzle;
+ emit_mir_instruction(ctx, ld);
ins.ssa_args.src[0] = temp;
ins.texture.in_reg_swizzle = SWIZZLE_XYXX;
};
const char *load_store_opcode_names[256] = {
- [midgard_op_st_cubemap_coords] = "st_cubemap_coords",
+ [midgard_op_ld_cubemap_coords] = "ld_cubemap_coords",
[midgard_op_ld_compute_id] = "ld_compute_id",
[midgard_op_ldst_perspective_division_z] = "ldst_perspective_division_z",
[midgard_op_ldst_perspective_division_w] = "ldst_perspective_division_w",
* whether we are loading or storing -- think about the
* logical dataflow */
- bool encodes_src =
- OP_IS_STORE(ins->load_store.op) &&
- ins->load_store.op != midgard_op_st_cubemap_coords;
+ bool encodes_src = OP_IS_STORE(ins->load_store.op);
if (encodes_src) {
struct phys_reg src = index_to_reg(ctx, g, args.src[0]);