aboutsummaryrefslogtreecommitdiff
path: root/src/codegen/c.zig
diff options
context:
space:
mode:
authorJacob Young <jacobly0@users.noreply.github.com>2023-03-05 00:30:55 -0500
committerJacob Young <jacobly0@users.noreply.github.com>2023-03-05 02:59:02 -0500
commit8f6da78fb1bfc9d5e8b3d5affd33cf6a62f5e8c7 (patch)
tree2ded76abd083b0e8b09cec69409f8f3b247984c1 /src/codegen/c.zig
parentc478c7609e4529267d1ce030577777e836ffc10b (diff)
downloadzig-8f6da78fb1bfc9d5e8b3d5affd33cf6a62f5e8c7.tar.gz
zig-8f6da78fb1bfc9d5e8b3d5affd33cf6a62f5e8c7.zip
CBE: implement vector element pointers
Diffstat (limited to 'src/codegen/c.zig')
-rw-r--r--src/codegen/c.zig10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/codegen/c.zig b/src/codegen/c.zig
index 5e92a6f76c..60f93311a4 100644
--- a/src/codegen/c.zig
+++ b/src/codegen/c.zig
@@ -17,12 +17,6 @@ const LazySrcLoc = Module.LazySrcLoc;
const Air = @import("../Air.zig");
const Liveness = @import("../Liveness.zig");
-const target_util = @import("../target.zig");
-const libcFloatPrefix = target_util.libcFloatPrefix;
-const libcFloatSuffix = target_util.libcFloatSuffix;
-const compilerRtFloatAbbrev = target_util.compilerRtFloatAbbrev;
-const compilerRtIntAbbrev = target_util.compilerRtIntAbbrev;
-
const BigIntLimb = std.math.big.Limb;
const BigInt = std.math.big.int;
@@ -3317,7 +3311,7 @@ fn airLoad(f: *Function, inst: Air.Inst.Index) !CValue {
try writer.writeAll(", sizeof(");
try f.renderType(writer, src_ty);
try writer.writeAll("))");
- } else if (ptr_info.host_size != 0) {
+ } else if (ptr_info.host_size > 0 and ptr_info.vector_index == .none) {
var host_pl = Type.Payload.Bits{
.base = .{ .tag = .int_unsigned },
.data = ptr_info.host_size * 8,
@@ -3647,7 +3641,7 @@ fn airStore(f: *Function, inst: Air.Inst.Index) !CValue {
if (src_val == .constant) {
try freeLocal(f, inst, array_src.new_local, 0);
}
- } else if (ptr_info.host_size != 0) {
+ } else if (ptr_info.host_size > 0 and ptr_info.vector_index == .none) {
const host_bits = ptr_info.host_size * 8;
var host_pl = Type.Payload.Bits{ .base = .{ .tag = .int_unsigned }, .data = host_bits };
const host_ty = Type.initPayload(&host_pl.base);