Skip to content

Commit

Permalink
ch7_1_vector.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan2251 committed Apr 29, 2020
1 parent cd18f63 commit 0dc96b4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lbdex/input/ch7_1_vector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ int test_cmplt_short() {
volatile vector8short a0 = {0, 1, 2, 3};
volatile vector8short b0 = {2, 2, 2, 2};
volatile vector8short c0;
c0 = a0 < b0; // c0[0] = -2147483647=0x80000001, c0[1] = -2147483647=0x80000001, c0[2] = 0, c0[3] = 0
c0 = a0 < b0; // c0[0] = 1 (since 0 < 2 is true), c0[1] = 1, c0[2] = 0 (since 2 < 2 is false), c0[3] = 0

return (int)(c0[0]+c0[1]+c0[2]+c0[3]); // 2
}
Expand All @@ -22,7 +22,7 @@ int test_cmplt_long() {
volatile vector8long a0 = {2, 2, 2, 2, 1, 1, 1, 1};
volatile vector8long b0 = {1, 1, 1, 1, 2, 2, 2, 2};
volatile vector8long c0;
c0 = a0 < b0; // c0[0..3] = {0, 0, ...}, c0[4..7] = {-2147483647=0x80000001, ...}
c0 = a0 < b0; // c0[0..3] = {0, 0, ...}, c0[4..7] = {1, ...}

return (c0[0]+c0[1]+c0[2]+c0[3]+c0[4]+c0[5]+c0[6]+c0[7]); //4
}
Expand Down

0 comments on commit 0dc96b4

Please sign in to comment.