Skip to content

Commit 7602ea1

Browse files
committed
Fix SSE families
The previous commit actually uses SSSE3 instruction.
1 parent 5b7c3a9 commit 7602ea1

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/implementation/c/compilation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ type WrappedNode = frontend.IWrap<frontend.node.Node>;
2121

2222
// The SSE versions in use with the generator.
2323
export enum SseFamily {
24-
SSE2 = 'SSE2',
24+
SSSE3 = 'SSSE3',
2525
SSE4_2 = 'SSE4_2',
2626
}
2727

src/implementation/c/node/table-lookup.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export class TableLookup extends Node<frontend.node.TableLookup> {
6666
out.push('}');
6767
}
6868

69-
private buildSSE2(out: string[]): boolean {
69+
private buildSSSE3(out: string[]): boolean {
7070
// return false;
7171
const ctx = this.compilation;
7272

@@ -99,10 +99,10 @@ export class TableLookup extends Node<frontend.node.TableLookup> {
9999
return false;
100100
}
101101

102-
const blob1 = ctx.blob(Buffer.from(result[0]), SSE_ALIGNMENT, SseFamily.SSE2);
103-
const blob2 = ctx.blob(Buffer.from(result[1]), SSE_ALIGNMENT, SseFamily.SSE2);
102+
const blob1 = ctx.blob(Buffer.from(result[0]), SSE_ALIGNMENT, SseFamily.SSSE3);
103+
const blob2 = ctx.blob(Buffer.from(result[1]), SSE_ALIGNMENT, SseFamily.SSSE3);
104104

105-
out.push('#ifdef __SSE2__');
105+
out.push('#ifdef __SSSE3__');
106106
out.push(`if (${ctx.endPosArg()} - ${ctx.posArg()} >= 16) {`);
107107
out.push(' int index;');
108108
out.push(' __m128i lut_tlo;');
@@ -141,7 +141,7 @@ export class TableLookup extends Node<frontend.node.TableLookup> {
141141
});
142142
ctx.indent(out, tmp, ' ');
143143
out.push('}');
144-
out.push('#endif /* __SSE2__ */');
144+
out.push('#endif /* __SSSE3__ */');
145145
return true;
146146
}
147147

@@ -248,7 +248,7 @@ export class TableLookup extends Node<frontend.node.TableLookup> {
248248
}
249249

250250
private buildSSE(out: string[]): boolean {
251-
if (this.buildSSE2(out)){
251+
if (this.buildSSSE3(out)){
252252
return true;
253253
}
254254
return this.buildSSE42(out);

0 commit comments

Comments
 (0)